Skip to content
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

[#12287] Student home page: Make it easier to navigate courses #12493

Merged
merged 27 commits into from
Jul 16, 2023

Conversation

Zxun2
Copy link
Contributor

@Zxun2 Zxun2 commented Jun 25, 2023

Fixes #12287

Outline of Solution
For students who link multiple courses to the same account, the number of courses on the home page may build up over the years, making it difficult to find a specific course.

Currently, these courses and their feedback sessions are loaded immediately on page load, resulting in long loading periods.

This PR introduces lazy loading to courses, loading feedback sessions only when needed. In addition, an accordion is used to make the UI cleaner (the top 3 (or 5?) most recent courses are open by default).

Overview of changes

image

Demo

Sort.Courses.by.Creation.Date.and.Lazy.Loading.mp4

@domlimm domlimm added the s.ToReview The PR is waiting for review(s) label Jun 25, 2023
@NicolasCwy NicolasCwy self-requested a review June 29, 2023 04:28
Copy link
Contributor

@NicolasCwy NicolasCwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM but got a query about the testing part. Let's also wait for @wkurniawan07 on allowing students to see course creation and deletion time.

Could you also update your branch with the latest master?

@Zxun2
Copy link
Contributor Author

Zxun2 commented Jun 30, 2023

Hmm 🤔 Should i be worried about the failing E2E Tests? It is passing on my fork.

@domlimm
Copy link
Contributor

domlimm commented Jun 30, 2023

@Zxun2 It fails sometimes, and we will re-run it. If not, we will need you to look into it. No worries ZX!

@Zxun2
Copy link
Contributor Author

Zxun2 commented Jun 30, 2023

@domlimm Alright, thanks dom! 😊

@weiquu
Copy link
Contributor

weiquu commented Jul 6, 2023

Overall LGTM but got a query about the testing part. Let's also wait for @wkurniawan07 on allowing students to see course creation and deletion time.

Bumping @wkurniawan07!

@Zxun2
Copy link
Contributor Author

Zxun2 commented Jul 11, 2023

Any update on this?

@weiquu
Copy link
Contributor

weiquu commented Jul 11, 2023

Hi @Zxun2, we're still waiting on @wkurniawan07 to weigh in on the hiding/unhiding of the creation time information. Also pinging other senior members @zhaojj2209 and @samuelfangjw for help :')

@zhaojj2209
Copy link
Contributor

From looking at the issue #10264 thread, both creation and deletion timestamp are labelled as "good to hide" instead of "must hide", so at the very least exposing them won't cause serious security issues. My take is that it should be safe to expose creation timestamp for the sake of sorting courses by creation date. It would be good if we can continue hiding deletion timestamp though, let's not expose more than necessary.

@weiquu weiquu requested a review from NicolasCwy July 12, 2023 16:58
@samuelfangjw
Copy link
Member

samuelfangjw commented Jul 12, 2023

Idea behind hiding these attributes is to, as a general principle, expose only as little as necessary for the app to function since we can never be sure how different bits of information can be used in an attack. I'm ok with exposing creation time since it is required for this functionality and I doubt exposing this attribute is inherently insecure.

@Zxun2
Copy link
Contributor Author

Zxun2 commented Jul 13, 2023

@samuelfangjw @zhaojj2209 @weiquu @NicolasCwy Thanks for the inputs! I will make the changes shortly :)

@weiquu
Copy link
Contributor

weiquu commented Jul 16, 2023

Hi @Zxun2, looks great (: Can I just check 1 small thing:

  • On initial page load, only the feedback sessions for the first 3 courses are loaded (lines 118-121 of student-home-page.component.ts)
  • When any of the sort buttons are clicked, the feedback sessions for all courses are loaded (lines 309-312 of student-home-page.component.ts)
  • E.g. if I reload the page and expand the tabs, the sessions need to be loaded. If I reload the page, click the "Course ID" button and then expand the tabs, the sessions do not need to be loaded (they are loaded upon clicking the button)

Wondering if I've understood this correctly (seems to be the behaviour I saw as well), and if so, whether this difference was intentional

Anyway, didn't spot any other issues so all's good!

@Zxun2
Copy link
Contributor Author

Zxun2 commented Jul 16, 2023

@weiquu Thanks for the catch! That was not intentional 😅

Copy link
Contributor

@NicolasCwy NicolasCwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for working on this @Zxun2 and sorry for the initial review delays!

@NicolasCwy NicolasCwy requested a review from weiquu July 16, 2023 14:02
@NicolasCwy NicolasCwy added s.FinalReview The PR is ready for final review and removed s.ToReview The PR is waiting for review(s) labels Jul 16, 2023
Copy link
Contributor

@weiquu weiquu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@weiquu weiquu merged commit 2fb5035 into TEAMMATES:master Jul 16, 2023
8 checks passed
@samuelfangjw samuelfangjw added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging c.Feature User-facing feature; can be new feature or enhancement to existing feature and removed s.FinalReview The PR is ready for final review labels Aug 21, 2023
@samuelfangjw samuelfangjw added this to the V8.29.0 milestone Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Feature User-facing feature; can be new feature or enhancement to existing feature s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Student home page: Make it easier to navigate courses
6 participants