Skip to content

Issue #5244 Fix drag & drop to group for contacts without prior click#5291

Open
kaibrockelt wants to merge 2 commits intonextcloud:mainfrom
kaibrockelt:fix/issue-5244
Open

Issue #5244 Fix drag & drop to group for contacts without prior click#5291
kaibrockelt wants to merge 2 commits intonextcloud:mainfrom
kaibrockelt:fix/issue-5244

Conversation

@kaibrockelt
Copy link
Copy Markdown

Fixes #5244

What was broken

Dragging a contact into a group only worked if the contact had been clicked before. Without a prior click, no PUT request was sent and the group assignment was silently dropped.

Root cause

Without a prior click (which triggers a full PROPFIND), the contact object is not set in a satisfactionary way — the contact is only hydrated from the initial listing. By loading the contact before adding the groups, the updateContact action now accepts the object, and no longer skipps silently.

Fix

Call fetchFullContact in the drop handler before proceeding with the group assignment.

Testing:

The onDrop handler is hard to unit test in isolation (async DAV calls, Vuex store, DOM events). I added unit tests for the Contact.groups setter which is at the core of the fix. Manual testing was done for the following scenarios — see video below:

  • dragging without clicking from "All contacts" list
  • dragging without clicking from "Ungrouped contacts" list
  • dragging without clicking from any named list to another

https://drive.google.com/file/d/1jZ0OnXgLvYKriTLuYLomdrjkNBSkK17N/view?usp=sharing

Signed-off-by: Kai Brockelt <kaibrockelt@gmail.com>
Signed-off-by: Kai Brockelt <kaibrockelt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drag & Drop assignment of Contacts only works reliably when marking the contact first.

1 participant