revolution icon indicating copy to clipboard operation
revolution copied to clipboard

Ask for confirmation when moving directories/files

Open benniledl opened this issue 3 years ago • 10 comments

Feature request

Hello, this would be a very good feature I think

Summary

Asking for confirmation when drag and dropping stuff in the filesystem

Why is it needed?

I was just clicking through my windows and accidentally drag and dropped the core folder into the manager folder. I didn't notice it because this is done via ajax and the site doesn't reload ( i guess this is how it works idk, point is I didn't notice because it doesn't reload ) only when coming back to editing some time later the site didn't work anymore. I did figure it out when I noticed the core folder was gone and I began to search how it dissappeared.

Suggested solution(s)

I would want there to be a popup message where users must confirm actions that can easily be done on accident & break the site.

benniledl avatar Sep 23 '22 12:09 benniledl

I'd like to second this feature request 😊

Users / managers frequently accidentally move their Images folder into Documents or similar - bringing the site to its knees!

I believe a confirmation dialogue would take care of this in almost all cases.

deJaya avatar Jun 04 '24 10:06 deJaya

I don't use modx frequently anymore so I am not sure if this is already done: Logging a message in a file somewhere where you typically look when debugging when moving a folder is absolutely necessary

benniledl avatar Jun 04 '24 12:06 benniledl

This should be easy to implement, tagging you because of your regular commits cc: @christianseel @opengeek

benniledl avatar Jun 04 '24 12:06 benniledl

I'm thinking a confirmation dialog may be too disruptive; arguably, I'd bet most would click a "Don't show this warning again" checkbox if we provided it, thus negating the usefulness of creating the dialog. My first thought would be to:

  1. Prevent the moving of the connectors, manager, and core folders; these are the folders that can make it impossible for anything to function should they be moved or renamed.
  2. Log file/folder moves otherwise in the Manager Actions log (in the db). Currently "renaming" a folder/file gets logged there.

Now, # 1 would be a little more involved than it seems because some users will want the option to or will have changed the names of some of these folders. Even though doing so isn't a particularly effective security measure, as of now it's allowed. Point is, knowledge of what these folders' current names are would need to be persisted somewhere.

smg6511 avatar Jun 04 '24 14:06 smg6511

I really meant a custom confirmation dialog at MODX level - not at browser level - so there'd be no Don't show this warning again option.

For people who do a lot of dragging & dropping in the Media Browser or Files list - perhaps the dialog could be switched on / off in a System Setting.

deJaya avatar Jun 05 '24 08:06 deJaya

@at-benni : It's not helpful to simply thumbs down my suggestion; let me know what is or isn't lining up with what you're wanting. @deJaya : What you're saying is effectively the same thing UX-wise—a dialog that interrupts the flow. Because of that, at the very least I'd make the confirmation an optional (set in settings) rather than a default behavior.

smg6511 avatar Jun 05 '24 14:06 smg6511

Prevent the moving of the connectors, manager, and core folders; these are the folders that can make it impossible for anything to function should they be moved or renamed.

I'd probably add assets/ and index.php to that, too. Perhaps the setting could be a comma-separated list of files and folders that cannot be dragged (accidentally) via the file tree?

rthrash avatar Jun 05 '24 15:06 rthrash

I'd probably add assets/ and index.php to that, too. Perhaps the setting could be a comma-separated list of files and folders that cannot be dragged (accidentally) via the file tree?

A managed list should work well too, yeah - although it would need to accept deep paths to user-managed / user-created areas too, e.g.,

assets/uploads/images etc

deJaya avatar Jun 05 '24 15:06 deJaya

a comma-separated list of files and folders

To further refine, what about starting off with a hard-coded, immutable list specifying the items that 100% should not be moved (core, connectors, index.php, [others?]) and adding to that the proposed CS list in a new settings option? Another consideration: How might MODX installs within a subdirectory affect the strategy here?

smg6511 avatar Jun 05 '24 16:06 smg6511

How might MODX installs within a subdirectory affect the strategy here?

Append the [[++base_path]] system placeholder (or whichever one is relevant), maybe?

rthrash avatar Jun 06 '24 14:06 rthrash