-
Notifications
You must be signed in to change notification settings - Fork 0
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: Add support for showing and hiding parts of the progress page #36
base: opencraft-release/palm.1
Are you sure you want to change the base?
feat: Add support for showing and hiding parts of the progress page #36
Conversation
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.
@xitij2000, please see the following recording. We cannot have this kind of delay when hiding the elements on the page:
Screencast_20241008_182416.webm
I just noticed that there is already a model with a per-course Progress page configuration that's used by the Course Home API. If we would need to add artificial delays to rendering the interface until the Course Blocks API gives us the response, maybe extending this configuration would actually be better?
Also, a note about the Pages & Resources - the options should either:
- Default to True.
- Be "Hide the component" instead of "Show the component".
Otherwise, visiting the "Configure progress" modal and pressing "Save" changes the Progress page configuration, which is confusing.
@Agrendalath Sure, I think it makes sense to hide by default. I did intend in the code to default an undefined value to true, but I guess that didn't work? The logic should be to hide till the value is known, but have an undefined value equate to true so that if this isn't configured, then the component is shown by default. The issue isn't with extending that configuration, it's with extending it in a way that is upstream-friendly. Making a change to an existing model is asking for trouble during upgrades when we need to cherrypick migrations etc. If upstream is okay with having this feature, then we can move this to the man course structure and return it with the existing API. |
What are the next steps here?
If needed, we can backport this change only for this client and handle it during the upgrade. It won't be upstream-unfriendly this way. |
I've hopefully already fixed this issue in the latest commit.
I think I miswrote. It maybe is upstream friendly, but it isn't upgrade-friendly. Maintaining diverging migration histories is not a good idea, I feel. Also, that config is derived from It would be better to add a separate model for this if needed, but in that case, it won't be part of course reruns or import-export, which might be OK. |
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.
@xitij2000, the problem with disappearing elements is resolved, but there are some more issues:
- There is no way to hide the "Course completion" section.
- When the grades are hidden, an empty
.grades.raised-card
node is still visible. - The
CertificateStatus
option is not implemented in this PR. The[data-testid=certificate-status-component]
node is always visible. - The second part of this comment is still not addressed.
This is a feature that already existed for the progress page, it's called "Enable progress graph"
I've changed it, so the entire component is hidden now.
I seems that got dropped during some rebase, I've added it back.
Fixed as well. |
(cherry picked from commit 391ea08)
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.
@xitij2000, after the most recent change, the "Show grades" toggle does not do anything. The "Show Grade Breakdown" toggle hides the entire .grades.rounded
node.
This is a feature that already existed for the progress page, it's called "Enable progress graph"
I see. I cherry-picked openedx#1194 into your branch,so that we can use it in Palm. I also opened open-craft/edx-platform#698 to backport the backend changes.
@Agrendalath Not sure why the show grades toggle is doing nothing. I think I'll fix up my palm devstack since right now I'm not able to test this myself. |
I fixed up my palm devstack and the show grades toggle is working fine for me? It shows and hides the "Grades" widget. Could check again? Are you using tutor or is this a different setup? |
@xitij2000, ah, sorry. I forgot we're hiding this section with the branding package. Everything's good here. Please add the description to the PR and link the related PRs and tickets so that we can easily navigate between all related work. |
@Agrendalath Done! |
This PR adds support for hiding or showing components on the progress page based on configuration stored in
other_course_settings
.These settings can be toggled with: open-craft/frontend-app-authoring#71
Private-ref: BB-9200