Issue #5244 Fix drag & drop to group for contacts without prior click#5291
Open
kaibrockelt wants to merge 2 commits intonextcloud:mainfrom
Open
Issue #5244 Fix drag & drop to group for contacts without prior click#5291kaibrockelt wants to merge 2 commits intonextcloud:mainfrom
kaibrockelt wants to merge 2 commits intonextcloud:mainfrom
Conversation
Signed-off-by: Kai Brockelt <kaibrockelt@gmail.com>
Signed-off-by: Kai Brockelt <kaibrockelt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
updateContactaction now accepts the object, and no longer skipps silently.Fix
Call
fetchFullContactin the drop handler before proceeding with the group assignment.Testing:
The
onDrophandler is hard to unit test in isolation (async DAV calls, Vuex store, DOM events). I added unit tests for theContact.groupssetter which is at the core of the fix. Manual testing was done for the following scenarios — see video below:https://drive.google.com/file/d/1jZ0OnXgLvYKriTLuYLomdrjkNBSkK17N/view?usp=sharing