Repository navigation
[BB-3710] Stop rendering Visibility button on libraries - #26885
Conversation
|
Thanks for the pull request, @spokerman12! I've created OSPR-5657 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
26b0b78 to
1315e31
Compare
|
@spokerman12 Thank you for your contribution. Is this ready for our review? |
shimulch
left a comment
There was a problem hiding this comment.
LGTM 👍
- I tested this on my local devstack. Checked if the Cog icon shows while adding a new xblock.
- I read through the code.
|
Hi, @natabene! Yes, this is ready for review. |
|
@natabene I'd be happy to review this one if you'd like? |
|
@bradenmacdonald Thanks for offering. @sarina Are you ok with Braden reviewing this as a core committer? |
|
I'm not 100% familiar with libraries but the description makes sense to me. I trust @bradenmacdonald more than myself on this one 😄 |
|
@bradenmacdonald It is yours to review, thanks! |
bradenmacdonald
left a comment
There was a problem hiding this comment.
This PR makes sense, thanks. I just had a small request about how we fix it.
There was a problem hiding this comment.
Instead of adding this new context variable to the template, I would prefer that you correctly set can_edit_visibility, perhaps by changing the default on the line below:
'can_edit_visibility': context.get('can_edit_visibility', xblock.course_id.is_course), # Default to true for courses, false for libraries
since it was pointed out on Jira that the move button has the same issue, we can fix it at the same time:
'can_move': context.get('can_move', xblock.course_id.is_course),
BTW, the reason for this is that if we're telling the template "can_edit_visibility: true or false", the template should not need additional logic to know if the user can really edit visibility or not; that's confusing and that type of logic belongs where the can_edit_visibility is set.
There was a problem hiding this comment.
I agree; the proposed solution was to avoid side effects based on context.
1315e31 to
1f22062
Compare
1f22062 to
1b4e0d3
Compare
|
Your PR has finished running tests. There were no failures. |
|
Merged. I copied some of the context from the PR into the commit message. I hope you don't mind. Thank you! |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
EdX Release Notice: This PR may have caused e2e tests to fail on Stage. If you're a member of the edX org, please visit #e2e-troubleshooting on Slack to help diagnose the cause of these failures. Otherwise, it is the reviewer's responsibility. E2E tests have failed. https://gocd.tools.edx.org/go/tab/pipeline/history/deploy_to_stage |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
@spokerman12, @bradenmacdonald: This was reverted (see #27113) because it broke ORA display in Studio. I do not know the root cause. |
* Revert "Revert "fix: Stop rendering Visibility and Move buttons on libraries (openedx#26885)" (openedx#27113)" This reverts commit 23443c4. * fix: change method of accessing course id (cherry picked from commit 2379f1c)
* Revert "Revert "fix: Stop rendering Visibility and Move buttons on libraries (openedx#26885)" (openedx#27113)" This reverts commit 23443c4. * fix: change method of accessing course id (cherry picked from commit 2379f1c)
* Revert "Revert "fix: Stop rendering Visibility and Move buttons on libraries (openedx#26885)" (openedx#27113)" This reverts commit 23443c4. * fix: change method of accessing course id (cherry picked from commit 2379f1c)
* Revert "Revert "fix: Stop rendering Visibility and Move buttons on libraries (openedx#26885)" (openedx#27113)" This reverts commit 23443c4. * fix: change method of accessing course id (cherry picked from commit 2379f1c)
* Revert "Revert "fix: Stop rendering Visibility and Move buttons on libraries (openedx#26885)" (openedx#27113)" This reverts commit 23443c4. * fix: change method of accessing course id
* Revert "Revert "fix: Stop rendering Visibility and Move buttons on libraries (openedx#26885)" (openedx#27113)" This reverts commit 23443c4. * fix: change method of accessing course id Co-authored-by: Jansen Kantor <[email protected]>
The original PR for this bugfix is open-craft#323
Description
We're fixing an error that appears when you click the "edit access" button on an XBlock in the library page.
Supporting information
Libraries in the "Add library" page shouldn't have the accessibility config icon. Access settings for libraries are changed at the top, on Settings > User Access.
When clicking the access-button (the cog) on a Library, an error appears.
This is know to happen on koa.master and open-release/juniper.3.
More on "Other information"
Testing instructions:
(Sandbox link)
This happens due to the way XBlocks are rendered; as they get rendered initially, the previews are unaware of whether they're part of a library. We can confirm this by refreshing the page, this makes the button disappear.

This fix removes the cogwheel when the XBlock is part of a library. This doesn't affect the XBlocks imported to courses because those are rendered on a Randomized Content XBlock, which does have its access options.
Other information:
From library docs
From randomized content XBlock docs
On the error image, we see that this has to do with groups. Groups are handled by course runs, so the Edit Access button has no place in a library (which is different from the Randomized XBlock that uses the library, which does support changing its access settings)
Deadline:
None