fix: show correct icons in the sidebar for units with custom XBlocks - #36135
Conversation
|
Thanks for the pull request, @Agrendalath! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
farhaanbukhsh
left a comment
There was a problem hiding this comment.
@Agrendalath a small nit everything else looks good. Thank you for the amazing work here.
Currently, the sidebar relies only on the XBlock's `category` class attribute (called `type` in the transformers). This behavior is inconsistent with the legacy subsection navigation, which relies on the `XModuleMixin.get_icon_class` method. This commit adds the `icon_class` to the fields collected by the transformers and uses it to determine whether the "problem" or "video" icon should be displayed for a unit in the sidebar.
9a55a41 to
9439627
Compare
|
@farhaanbukhsh, I squashed the fixup commit, as I had to rebase this branch for the CI anyway. |
farhaanbukhsh
left a comment
There was a problem hiding this comment.
👍
- ✅ I tested this with tutor devstack and made sure the icon_class is working.
- ✅ I read through the code
- ❌ I checked for accessibility issues
- ❌ Includes documentation
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
|
2U Release Notice: This PR has been deployed to the edX production environment. |
Currently, the sidebar relies only on the XBlock's
categoryclass attribute (calledtypein the transformers). This behavior is inconsistent with the legacy subsection navigation, which relies on theXModuleMixin.get_icon_classmethod. This commit adds theicon_classto the fields collected by the transformers and uses it to determine whether the "problem" or "video" icon should be displayed for a unit in the sidebar.Testing instructions
/admin/waffle/flag/) set to "Yes":courseware.enable_navigation_sidebarcourseware.disable_navigation_sidebar_blocks_cachingfa-book.icon_class = 'video'field to the HtmlBlockMixin class (we could use a custom XBlock here, but this is a faster way to test this).fa-video.fa-edit.Private-ref: BB-9332