-
Notifications
You must be signed in to change notification settings - Fork 92
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: Library Home - Paste Content [FC-0059] #1187
feat: Library Home - Paste Content [FC-0059] #1187
Conversation
Thanks for the pull request, @yusuf-musleh! 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. |
(edit: whoops, wrong PR...) |
26fd52b
to
b120152
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1187 +/- ##
==========================================
+ Coverage 92.99% 93.01% +0.02%
==========================================
Files 756 756
Lines 13653 13695 +42
Branches 2953 2966 +13
==========================================
+ Hits 12696 12739 +43
+ Misses 921 920 -1
Partials 36 36 ☔ View full report in Codecov by Sentry. |
8bb2696
to
3535912
Compare
3535912
to
34fe4b1
Compare
@yusuf-musleh #1138 and #1197 are Done, could you update your branch and test with copy from a library? Edit: The copy from a course works well 👍 |
This includes a fix for fetching the initial clipboard data and populating the redux state on first render.
Adds mutation to call endpoint that pastes content from clipboard into Library
34fe4b1
to
9b64557
Compare
9b64557
to
44cb93c
Compare
@ChrisChV Thanks for the review! I've updated my branch and tested with copy from library and pasting, it working fine. However, it was missing broadcasting the clipboard data to update whether the "Paste from Clipboard" button appears without refreshing, so I added it here: 44cb93c, I'm working on fixing the broken tests. |
@yusuf-musleh The "Paste From Clipboard" doesn't dissapear on paste. https://www.loom.com/share/74030a6a5aae437e9b866971c3a434af?sid=fe67f250-6363-4650-a026-6c717fbe9019 |
@ChrisChV Isn't that expected behavior? Pasting something doesn't remove it from your clipboard, and you are able to paste it multiple times (into the same library or into several different libraries/courses) if you want to. |
I don't see anything mentioned. I find it odd that I can paste the same component multiple times. But I'm also fine with copying not removing the item from the clipboard. |
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.
@yusuf-musleh Looks good 👍
- I tested this: I copy multiple components from a course and from a library
- I read through the code and considered the security, stability and performance implications of the changes.
- I tested that the UI can be used with a keyboard only (tab order, keyboard controls).
- Includes tests for bugfixes and/or features added.
- Includes documentation
It is the same behavior we have when pasting a unit inside a course, the "Paste Unit" remains there and you can continue pasting the same unit from the clipboard. |
This clipboard is supposed to work the same way as the "regular" clipboard on your computer. If you copy something, e.g. text in your browser right now or code in VS Code or anything, you can always paste it multiple times. |
You're right. Thanks 👍 |
}; | ||
|
||
fetchInitialClipboardData(); | ||
}, [dispatch]); |
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.
As a general approach, I would prefer we replace the redux code with something that uses React Query, rather than finding a way to make the redux code work better. But this is fine for now.
See recently updated frontend recommendations: https://docs.openedx.org/projects/openedx-proposals/en/latest/best-practices/oep-0067-bp-tools-and-technology.html#frontend-technology-selection
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.
Agreed, makes sense, I just wasn't sure if I wanted to do the full refactor to React Query as part of this task/PR, as opposed to a separate PR/task, since it's not specific to pasting in the library.
@yusuf-musleh 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
This PR adds the ability to paste blocks from the clipboard into a v2 Library. It adds a new button "Paste From Clipboard" that appears the user's clipboard contains a block that can be pasted into the library. In the case where the clipboard contains a unit (which cannot be pasted in a library), then the "Paste From Clipboard" button does not appear.
Supporting information
Related Ticket:
Testing instructions
Private-ref: FAL-3778