-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: adds Library Content button to Studio Unit page [FC-0062] #35670
feat: adds Library Content button to Studio Unit page [FC-0062] #35670
Conversation
Thanks for the pull request, @navinkarkera! What's next?Please work through the following steps to get your changes 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. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where 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. |
b6a8793
to
643bce7
Compare
placeholderElement.remove(); | ||
}); | ||
}, | ||
|
||
duplicateComponent: function(xblockElement) { | ||
// A placeholder element is created in the correct location for the duplicate xblock | ||
// and then onNewXBlock will replace it with a rendering of the xblock. Note that |
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.
This file has many duplicate functions like deleteXBlock
, duplicateXBlock
, showMoveXBlockModal
etc.
:library_content_key: the key of the library content to add. (Incompatible with | ||
all other fields except parent_locator) |
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.
Having this POST arg will be nice, so that we don't have to follow up the request with a PUT 👍🏻
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.
@kdmccormick Yes, called upstream sync after creating the block in a single call, simplified the js part. bc27ba3
iframes the Authoring MFE's Library Content Picker
Removes need to call a follow up PUT request
ddd1307
to
bc27ba3
Compare
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.
It seems like upstream sync will only support blocks that were published. Currently the component picker shows all components including drafts that were never published.
@@ -224,7 +225,7 @@ function($, _, Backbone, gettext, BasePage, | |||
}, | |||
|
|||
initializePasteButton() { | |||
if (this.options.canEdit && !self.options.isIframeEmbed) { | |||
if (this.options.canEdit && !this.options.isIframeEmbed) { |
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.
Fixes a typo/bug introduced in #35587
@@ -241,7 +242,7 @@ function($, _, Backbone, gettext, BasePage, | |||
refreshPasteButton(data) { | |||
// Do not perform any changes on paste button since they are not | |||
// rendered on Library or LibraryContent pages | |||
if (!this.isLibraryPage && !this.isLibraryContentPage && !self.options.isIframeEmbed) { | |||
if (!this.isLibraryPage && !this.isLibraryContentPage && !this.options.isIframeEmbed) { |
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.
Fixes a typo/bug introduced in #35587
We have a separate story for that which @ChrisChV is working on: openedx/frontend-app-authoring#1354 / https://tasks.opencraft.com/browse/FAL-3881 |
I also have a draft "published" filter but it turns out to need some backend changes to implement and I haven't had time. CC @ChrisChV . openedx/frontend-app-authoring#1406 |
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.
Nice! It's working well. Here are some minor things I've noted that we should clean up:
cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py
Outdated
Show resolved
Hide resolved
* Adds the action buttons to the modal. | ||
*/ | ||
addActionButtons: function() { | ||
this.addActionButton('cancel', gettext('Cancel')); |
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.
This can be fixed in a fast-follow PR (because I'm eager to get this into testing ASAP), but it's not a great UX that the "Next" button is sometimes hidden until you scroll, and the Next + Cancel buttons are in totally different places. I think they need to either be both inside the modal or both in the legy UI actions bar.
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.
Actually, do we even need a Next
button? Selecting a course should directly take to next page since we only have one item to select in the first slide.
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.
Removed next button and updated it to go to component selection on library selection.
vokoscreenNG-2024-10-21_11-16-03.mp4
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 to me!
@navinkarkera Oh, actually one more important thing: can you make sure this new button is only |
@bradenmacdonald Thanks for the suggestions, updated and addressed all your comments. |
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.
Great work @navinkarkera ! I tested this with the latest course-authoring PR and it's working well. Ready to merge.
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. |
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. |
…5670) Requires that v2 libraries are enabled.
Built on top of: open-craft#699 and #35636
Depends on
First iteration
vokoscreenNG-2024-10-18_17-57-00.mp4
Second iteration
vokoscreenNG-2024-10-21_11-16-03.mp4
Test instructions:
tutor dev exec lms openedx-assets build --env=dev
to rebuild JS files