Problem/Motivation

Drag and drop is a nice feature, but not be suitable in all cases.

Proposed resolution

Provide a setting, which will globally enable the dnd feature of jsTree, defaulting to enabled.

Comments

ytsurk created an issue. See original summary.

ytsurk’s picture

Issue summary: View changes
ytsurk’s picture

Status: Active » Needs review
StatusFileSize
new3.95 KB

Removing the dnd plugin, will only disable the drag&drop functionality of folders (not media, which is less critical IMO).

Needs to be tested with #3176332: Drag and Drop Parent Folder into Subfolder

ytsurk’s picture

Status: Needs review » Needs work

I want to flavor this with additional permissions.

dom.’s picture

Status: Needs work » Needs review
StatusFileSize
new4.57 KB
new7.67 KB

Updating patch #3 to also disable media d&d with the option.

dom.’s picture

StatusFileSize
new2.53 KB
new8.52 KB

Update patch #5 to also include a new permission for this as well.

dom.’s picture

What about rephrasing this to "Enable drag&drop" being TRUE by default ?
It feels odd to disable some functionnality. We shoudl keep positive and on the contrary allow to enable more (like dnd).
Later on, that would allow to support more extra pluging from jsTree. Some of them could be interesting in the context of this module. "Enable" rather than "disable" would make more sense in this direction.
Would you agree and want me to update this ?

Also we could have a fieldset after "combined media" for these "extra features".

ytsurk’s picture

I was unsure about dnd of media, but let's be inclusive :D
I would prefer having two setting/permission sets, one for directory dnd and one for media dnd.

I definitely vote for enabling, and have it enabled by default.
This means we need an update hook given the permission to existing roles, having "another" permission, probably access media directories ui browser.

The settings (jsTree feature block) should live imo under media_directories_ui, it can be below combined upload, yeah.

ytsurk’s picture

Title: Expose setting to disable drag and drop functionality » Expose setting to enable drag and drop functionality
Issue summary: View changes
ytsurk’s picture

Version: 2.x-dev » 2.1.x-dev
Assigned: Unassigned » ytsurk
mmenavas’s picture

StatusFileSize
new8.77 KB

Rerolled patch #6 to be compatible with latest 2.1.x.

ytsurk’s picture

Assigned: ytsurk » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new11.12 KB

Sorry for having this so long silently assigned to me, doing nothing, but here we go.

I added the update hook for the config schema change.
Also renamed stuff a bit and added the config options to a separate fieldset.

ytsurk’s picture

Status: Reviewed & tested by the community » Needs review

Sorry - review welcome, especially the update hook (meaning running it on another -dev instance then mine).

rang501’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new11.1 KB

I looked at it and found out that the configuration form is not saving the checkbox value. I did find the problem and fixed it.
Another thing - the bold text about the manual cache rebuild - it was not necessary and I did remove it. I think that any manual cache rebuild is only for cache debugging. This is something that the users shouldn't do at all. We should add correct cache tags or call specific cache rebuild functions during the settings save. At the moment I do not see there is any need for it.

Overall, it seems to work just fine. I do agree that the option should turn off the dnd functionality completely (both folders and media).

rang501’s picture

Status: Reviewed & tested by the community » Closed (outdated)

Closing as outdated.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.