Uh oh!
There was an error while loading. Please reload this page.
fix(files): Close sidebar and update fileid when current node is deleted - #44897
Conversation
susnux
commented
Apr 17, 2024
/backport to stable29 |
susnux
commented
Apr 17, 2024
/backport to stable28 |
Uh oh!
There was an error while loading. Please reload this page.
emoral435
left a comment
There was a problem hiding this comment.
I think this makes sense to me to put this here, as other features would most likely want to follow the same functionality. But if others decide to move this elsewhere, it is fine by me!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
skjnldsv
left a comment
There was a problem hiding this comment.
Wait 🙈
Actually, I think we're mixing two different approaches here.
I would agree with Louis, whichever service handle the routing should monitor itself.
I think having the same type of handling as you did on the sidebar would be cleaner.
The action is not really responsible for the routing, it doesn't care. It deletes the file and send the event.
The routing is managed by the FileList, if a file disappear, it should be the one adjusting the fileid param.
If we put this into the navigation (still not sure it fits there) and we would then want to move to trashbin here later, then we have two router calls conflicting.
I fail to understand why we would have conflicting rule? If a file is removed from the list (moved or deleted), and the fileid is still in the URL, we should fallback to the folder fileid. What we're doing here on the deleteAction does also apply to the moveOrCopyAction :)
e0dd5e5 to
4e9facdComparesusnux
commented
May 31, 2024
@skjnldsv I refactored the deleted node handling of the current view. |
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
We do not change the view to the trash bin but stay in the current view, so we need to update the current fileid on the route if that was deleted. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
4e9facd to
21b96c0CompareSigned-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Summary
In case we remove a node for which the sidebar is currently open, we need to do two things:
This is needed because we do not change the route to the trashbin, but stay on the current route.
So we need to change the current fileid to the parent folder.
Checklist