-
Notifications
You must be signed in to change notification settings - Fork 228
Fix clipboard moveModal incorrect resource count #4631
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
Fix clipboard moveModal incorrect resource count #4631
Conversation
- Stops propagation in Checkbox#handleChange w/ second `$event` paramter, putting `.stop` and/or `.prevent` on the `@input` event complained and failed - Fixes checkboxes just not working in the Clipboard
…selectedNodeIds to the correct content node id
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.
Changes make senses to me. Also, manual QA checks out. Thanks @LianaHarris360!
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.
While the move modal title is correct, this seems to break the move behavior. As you can see in your video, when you select one of the items for moving, and open the modal, the move button is disabled. Testing it myself, I can't seem to get it enabled.
I believe this is because the actual source content node ID is being passed to the move modal. The clipboard holds copies that are 'virtual' in that they don't hold the data of the source node, rather the frontend loads the data from the source for display in the clipboard. While not robustly clear, you can see this in the computed prop, that it loads the content node for "render"-- meaning it should not be used for move/copy/delete operations.
studio/contentcuration/contentcuration/frontend/channelEdit/components/Clipboard/mixins.js
Lines 24 to 26 in c621782
contentNode() { | |
return this.nodeId ? this.getContentNodeForRender(this.nodeId) : null; | |
}, |
Lastly, I'm noticing some regressions with the indeterminate selection of folders as well.
The move button is disabled until I select a new location for the resource. It appears that the moveModal opens in the current location of the resource, disabling the button since there's no destination. In the bottom video, creating a new folder allows the button to be selected. Because the moveModal uses getTopicAndResourceCounts() for the header count, we needed to pass the source content node ID from the We were going to create a function to search the MovingResources.mov |
@LianaHarris360 right, it opens in the current location of the resource which shouldn't exist in the channel because the node is on the clipboard, so this means the wrong ID is being passed and the button should not be disabled. You can compare this behavior with production and see that it's a regression. |
The Looking at it again, perhaps since there is a |
@nucleogenesis Right the move modal does not need to disambiguate between the two because the move modal is not responsible for handling the move operations. The move modal really only determines the target location for the operation. Here's a visual to explain where this goes wrong. I have two channels: 'Test' and 'B'. The 'Test' channel has a folder 'F' that has 3 PDFs. I copied the 'F' folder to the clipboard, and deleted one of the nodes from it on the clipboard-- now it shows 2 on the clipboard (note the clipboard also incorrectly counts this but it seems production is doing this correctly so it must be a regression). I then select the 'F' folder from the clipboard and click move. The move modal says it's moving 1 folder and 5 resources. Although, that should be 1 folder and 2 resources. The way clipboard tracks the deletion will not be correctly counted for with the logic the move modal uses. Furthermore, the move modal location is incorrect-- as you can see it's showing the 'F' folder which is in channel 'Test' but the move modal should show channel 'B' instead. Screencast.from.08-12-2024.01.54.48.PM.mp4 |
The I also fixed the icon that displays the resource count in the clipboard, to make sure that if an item within a folder is deleted within the clipboard, the count is updated accordingly. clipboard.mov |
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 work!
Summary
Description of the change(s) you made
This pull request fixes the incorrect folder and resource count displayed when opening the
moveModal
from theClipboard
component. This pull request also fixes a selection issue in theClipboard
.Manual verification steps performed
moveModal
opensScreenshots (if applicable)
Before:

After:
MovemodalResourceFolderCount.mov
References
Fixes #3744
Comments
Contributor's Checklist
PR process:
CHANGELOG
label been added to this PR. Note: items with this label will be added to the CHANGELOG at a later timedocs
label has been added if this introduces a change that needs to be updated in the user docs?requirements.txt
files also included in this PRStudio-specifc:
notranslate
class been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)pages
,components
, andlayouts
directories as described in the docsTesting:
Reviewer's Checklist
This section is for reviewers to fill out.
yarn
andpip
)