-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: reverse courses list for easier access to newer courses #158
Conversation
Hi @laporchen, what you think about the review comment. I can take over this issue if you're not available |
Which review comment you are talking about here. I don't think I see one in this PR? |
src/pages/courses/index.vue
Outdated
@@ -44,7 +44,7 @@ const rolesCanCreateCourse = [UserRole.Admin, UserRole.Teacher]; | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<tr v-for="{ course, teacher } in courses" :key="course" class="hover"> | |||
<tr v-for="{ course, teacher } in (courses ?? []).reverse()" :key="course" class="hover"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should use Array.prototype.toReversed()
to avoid mutating the list. How do you think?
Optionally, we can have a toggle to decide the order (new->old OR old->new), and store this preference in local storage, but overall I think reversing course list is great and will be appreciated by most of the users. So it's optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@laporchen here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer keeping only one order method just for now for simplicity, and I'll change toReversed
to prevent potential issue in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using a destructing array to prevent mutation to the original list, since we can't use es2023
stuff now.
Deploying nfe with Cloudflare Pages
|
This is just a personal preference. Since most users would only use the newest courses (probably)