-
Notifications
You must be signed in to change notification settings - Fork 27.9k
feat(editor): Combine Move and Change owner modals #15756
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(editor): Combine Move and Change owner modals #15756
Conversation
…cally, loading all folders
…er if already on parent
… rename its props. Remove flaky test.
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
packages/frontend/editor-ui/src/components/Folders/MoveToFolderModal.test.ts
Show resolved
Hide resolved
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.
cubic found 3 issues across 22 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
|
||
// The dropdown focuses after a small delay (once modal's slide in animation is done). | ||
// On the component we listen for an event, but here the wait should be very predictable. | ||
cy.wait(500); |
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.
Using a fixed wait time (500ms) can lead to flaky tests. Consider using Cypress's built-in retry and timeout mechanisms instead of arbitrary waits.
cy.wait(500); | |
getMoveFolderModal().find('input').should('be.visible').should('be.enabled'); |
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 case is tricky, and while I'm not a fan of the fixed timeout here it is way longer than the brief slide in animation that the modal does before opening the dropdown and focusing on it. If the idea is to test that the autofocus works some kind of wait has to happen here - the first couple of letteres typed were ignored before I added this.
Perhaps waiting for a focused field to appear could be the solution...
The reason the dropdown opens & focuses only once the modal stops is that otherwise the popper dropdown gets misplaced if opened mid animation.
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.
Not fully done yet, will want to test the credentials stuff in particular I imagine. But looks really good!
packages/frontend/editor-ui/src/components/Folders/MoveToFolderDropdown.vue
Show resolved
Hide resolved
packages/frontend/editor-ui/src/components/Folders/MoveToFolderModal.test.ts
Show resolved
Hide resolved
packages/frontend/editor-ui/src/components/Folders/MoveToFolderModal.vue
Outdated
Show resolved
Hide resolved
packages/frontend/editor-ui/src/components/Folders/MoveToFolderModal.vue
Show resolved
Hide resolved
let folderText = ''; | ||
let workflowText = ''; | ||
if (subFolderCount.value > 0) { | ||
folderText = i18n.baseText('folders.move.modal.folder.count', { |
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.
Looks like doing "| {count} folder | {count} folders"
works to show an empty string at 0, though I won't argue that's strictly better, just fyi since I got curious :D
Workflow Test Results 📊
|
Workflow ID | Workflow Name | Reason |
---|---|---|
237 | BasicLLMChain:AzureChat | Workflow contains new data that previously did not exist. |
35 | Slack:User:getPresence info:UserProfile:get update... | Workflow contains new data that previously did not exist. |
53 | ConvertKit:CustomField:create getAll update delete... | Workflow contains new data that previously did not exist. |
257 | Agent:auto-fix:anthropic | Workflow contains new data that previously did not exist. |
…ers with no workflows
…to-folder-modals
|
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.
Tested the credentials setup, looks amazing!
Workflow Test Results 📊
|
Workflow ID | Workflow Name | Reason |
---|---|---|
237 | BasicLLMChain:AzureChat | Workflow contains new data that previously did not exist. |
35 | Slack:User:getPresence info:UserProfile:get update... | Workflow contains new data that previously did not exist. |
53 | ConvertKit:CustomField:create getAll update delete... | Workflow contains new data that previously did not exist. |
257 | Agent:auto-fix:anthropic | Workflow contains new data that previously did not exist. |
|
Workflow Test Results 📊
|
Workflow ID | Workflow Name | Reason |
---|---|---|
237 | BasicLLMChain:AzureChat | Workflow contains new data that previously did not exist. |
35 | Slack:User:getPresence info:UserProfile:get update... | Workflow contains new data that previously did not exist. |
53 | ConvertKit:CustomField:create getAll update delete... | Workflow contains new data that previously did not exist. |
257 | Agent:auto-fix:anthropic | Workflow contains new data that previously did not exist. |
✅ All Cypress E2E specs passed |
Summary
This PR combines the existing "Move to Folder" and "Change owner" modals into one generic "Move" modal. This new modal replaces existing
MoveToFolderModal
and partially replacesProjectMoveResourceModal
, which still used for credentials after this.The new modal allows moving workflows or folders to other folders. It also supports transferring the folder / workflow ownership to another project (or user), and allows sharing credentials used at the transferred workflows if user wants to do so.
This is also the first time transferring folders to other projects is supported on the UI at all.
move-modal.mp4
The delete modal also uses the new folder dropdown, listing possible folders as the transfer target.
delete-modal.mp4
In order to accomplish this I had to do some amount of refactoring, and I also discovered some type issues / bugs (like we weren't fetching paginated available folders before on the old picker) which I fixed while working on this. The changeset is pretty big, but a large portion of that are tests.
"Move" option isn't available on "Overview" or "Shared with you" pages, for now in order for the modal to work it has to be a page with project ID on its route params.
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/ADO-3161/fe-combine-change-owner-and-move-to-folder-modals
https://linear.app/n8n/issue/ADO-3287/feature-non-flat-list-in-sharingmoving-folders-dialog
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)