Skip to content

enrollments dashboard expand collapse #2195

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

Merged
merged 11 commits into from
Apr 11, 2025

Conversation

gumaerc
Copy link
Contributor

@gumaerc gumaerc commented Apr 10, 2025

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/7042

Description (What does it do?)

This PR adds expand / collapse functionality to the My Learning dashboard. By default, only started or not started enrollments are shown. Ended enrollments are revealed by clicking the "Show all" link button.

Screenshots (if appropriate):

image
image
image
image

How can this be tested?

  • Ensure you have Posthog connected to your local instance of mit-learn
  • In your connected Posthog project, make sure you have added and enabled the enrollment-dashboard feature flag
  • Visit http://open.odl.local:8062/dashboard and log in (if you are not already logged in)
  • Click "Show all" and verify that the ended enrollments are revealed
  • Click "Show less" and verify that the ended enrollments are hidden again

@gumaerc gumaerc added the Needs Review An open Pull Request that is ready for review label Apr 10, 2025
Copy link

OpenAPI Changes

Show/hide No detectable change.

@gumaerc
Copy link
Contributor Author

gumaerc commented Apr 10, 2025

@mbilalmughal I noticed that the Figma prototype has a smooth transition when you expand / collapse. Is that desired here?

@mbilalmughal
Copy link

@mbilalmughal I noticed that the Figma prototype has a smooth transition when you expand / collapse. Is that desired here?

@gumaerc Not particularly, but some sliding animation that indicates to the user that the section is expandable—similar to an accordion.

@ChristopherChudzicki ChristopherChudzicki self-assigned this Apr 11, 2025
Copy link

OpenAPI Changes

Show/hide No detectable change.

Copy link

OpenAPI Changes

Show/hide No detectable change.

Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki left a comment

Choose a reason for hiding this comment

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

This all looks good except for the sorting issue I mentioned.

Additionally, I noticed an existing layout issue that these cards really highlight at some widths. https://github.com/mitodl/hq/issues/7097

Comment on lines 177 to 178
const { ended, started, notStarted } = sortEnrollments(enrolledCourses || [])
const sorted = [...started, ...notStarted, ...ended]
const shownEnrollments = [...started, ...notStarted]
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding of the sorting and collapse logic is that it should be:

  1. Started
  2. Not started
  3. Course over, user "Completed = Certificate Earned"
  4. other cases where course is over

1–3 should be always visible, and 4 should be hidden by default.

@sovsey Can you confirm?

Assuming ☝️ is correct, we'll need to modify sortEnrollments... right now it doesn't distinguish between cases (3) and (4)

Copy link
Contributor

Choose a reason for hiding this comment

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

@gumaerc Separately, I think the term "Completed" is pretty confusing. I would be 100% in favor of renaming EnrollmentStatus.Completed to EnrollmentStatus.CertificateEarned.

Copy link

OpenAPI Changes

Show/hide No detectable change.

Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki left a comment

Choose a reason for hiding this comment

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

👍

Copy link

OpenAPI Changes

Show/hide No detectable change.

@gumaerc gumaerc merged commit 65811d5 into main Apr 11, 2025
12 checks passed
@gumaerc gumaerc deleted the cg/enrollments-dashboard-show-more-less branch April 11, 2025 17:00
This was referenced May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review An open Pull Request that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants