-
Notifications
You must be signed in to change notification settings - Fork 3
Fix ordering of modules in UAI dashboard #2232
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
Conversation
OpenAPI ChangesShow/hide No detectable change.
|
|
||
export { mitx as enrollment, programs, courses } | ||
const setupProgramsAndCourses = () => { |
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.
Request: IMO a better spot for this would be frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/test-utils.ts
. (Or a sinilka
Factory files should be data-creators, not API mockers.
Also, I think it would be good to add a docstring describing what test scenario it sets up:
/**
* blah blah
*/
const setupProgramsAndCourses = () => {}
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.
Makes sense 👍 , but two small requests.
if (!aCompleted && bCompleted) { | ||
return 1 | ||
} | ||
return ( |
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.
Request: The goal here is to keep original order, right? If yes, just return 0.
From MDN:
compareFn(a, b) return value sort order > 0 sort a after b, e.g., [b, a] < 0 sort a before b, e.g., [a, b] === 0 keep original order of a and b
Also... copy pasting from MDN gave me legit markdown. That's cool.
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.
For some reason I thought in our conversation about this that we had thought the proper order wasn't being returned from the API, but this wouldn't be the way to deal with that anyway. Good suggestion.
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 believe that the API does return a meaningful order, it's just that we want to use that order as a fallback only.
OpenAPI ChangesShow/hide No detectable change.
|
OpenAPI ChangesShow/hide No detectable change.
|
@ChristopherChudzicki Thanks, it's ready for another look. |
What are the relevant tickets?
https://github.com/mitodl/hq/issues/7255
Description (What does it do?)
This PR adds a transform function for properly sorting the modules listed in the UAI dashboard, sorting them by Enrolled, Completed, and then the rest sorted by the order defined within the Program.
Screenshots (if appropriate):
How can this be tested?
mit-learn
enrollment-dashboard
andmitlearn-organization-dashboard
feature flags