-
Notifications
You must be signed in to change notification settings - Fork 16
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 to prevent from moving folders in sub-folders #1277
Conversation
Your Render PR Server URL is https://gaming-ui-stage-pr-1277.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c3o2ej2p7h3lv6b3lhbg. |
Your Render PR Server URL is https://storage-ui-stage-pr-1277.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c3o2ejip7h3lv6b3lhl0. |
Your Render PR Server URL is https://files-ui-stage-pr-1277.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c3o2ek2p7h3lv6b3li0g. |
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 there is something going wrong with the logic here:
See the screenshot above where I am trying to move /another parent
into /parent
but not being allowed to even though there is nothing that should be preventing the move. i.e. after the move the path should be
|-parent
|--Another parent
|--child of parent
Ah right, nice catch, I don't allow to move the folder into any subfolder of the current path. I'll adapt. |
…nSafe/files-ui into fix/tbaut-fix-folder-in-folder-1267
Ok this is turning into some dark magic.. I will probably not understand half of it any more in 2 weeks, hence the comments. |
I just tested out the fix on Render (for Storage). It looks good for subfolders now, it's not possible to move a parent into a subfolder. However, on a related note I just noticed you can move the parent into itself, "Folder1" to "Folder1", and loose access in the UI. Do you want to address in this PR or should I create a separate issue? Video: move-folder-issue.mov |
packages/storage-ui/src/Components/Modules/MoveFileModal/MoveFileModal.tsx
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.
Amazing,
A few comments to resolve some of the problems.
packages/files-ui/src/Components/Modules/FileBrowsers/MoveFileModal.tsx
Outdated
Show resolved
Hide resolved
packages/storage-ui/src/Components/Modules/MoveFileModal/MoveFileModal.tsx
Outdated
Show resolved
Hide resolved
Top level seems good now, I cannot move a parent into a child folder or itself. I know this is expanding the scope of the original ticket but I've found a couple of additional issues that are related to this, regarding child folders. You can cause a child folder to become unreachable in two scenarios
Can we show the same error when trying to move child folders in this way too? |
I can't reproduce this, it's not allowed for me. Can you do another round of check @tanmoyAtb and @FSM1 when you have the chance? I'd love to get to the bottom of it today :) Here's what I'm testing, at the root, and in a sub-folder, and it looks good. move.mp4 |
For me both of these cases are working as expected,
|
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 out all the cases I could think of,
working for me 💯
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.
Also tested all the scenarios I could think of and seem unable to break it 🎉
closes #1276
My helper function involves some JS tricks that I commented, let me know if it's not clear.