fix: Issue with read-only units in libraries & published version of units in library units picker [FC-0083] - #1926
Conversation
|
Thanks for the pull request, @ChrisChV! 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. |
c1b95c4 to
85b4b5b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1926 +/- ##
==========================================
- Coverage 93.82% 93.82% -0.01%
==========================================
Files 1147 1147
Lines 23976 23983 +7
Branches 5155 5057 -98
==========================================
+ Hits 22495 22501 +6
- Misses 1413 1414 +1
Partials 68 68 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1cc680f to
98d5557
Compare
98d5557 to
275db21
Compare
pomegranited
left a comment
There was a problem hiding this comment.
👍
- I tested this using the excellent testing instructions on the PR
- I read through the code
-
I checked for accessibility issuesN/A -
Includes documentationN/A -
User-facing strings are extracted for translationN/A
…nits in library units picker [FC-0083] (openedx#1926) Fixes the issues from openedx#1633 (comment) * In successfully added units, the "add new component" widget appears sometimes * In the "add existing unit" modal, the preview shows draft versions of units
| const { unitId, readOnly } = useLibraryContext(); | ||
| const { readOnly, showOnlyPublished } = useLibraryContext(); | ||
| const { sidebarComponentInfo } = useSidebarContext(); | ||
| const unitId = sidebarComponentInfo?.id; |
There was a problem hiding this comment.
@ChrisChV This is breaking unit page when you select any component inside it and reload. The reason being that sidebarComponentInfo?.id is set to component when selected. Getting unitId from useLibraryContext fixes it, but I might be missing something. Is a reason for doing this?
There was a problem hiding this comment.
When I wanted to add a unit to a course, in the component picker, when I opened the unit info sidebar, it generated an error in the context. This code fixed that, but when I reverted that code, it seems that it no longer generates the error, so I think it's safe to revert the code 👍
Description
Fixes the issues from #1633 (comment):
Supporting information
Testing instructions
enable discussionvalue in unit settings, verify that the unit is on read-onlt mode.Other information
This issue:
Has been fixed in openedx/openedx-platform#36630