-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the selected contacts to a group #2763
base: main
Are you sure you want to change the base?
Add the selected contacts to a group #2763
Conversation
Codecov ReportBase: 67.96% // Head: 67.96% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #2763 +/- ##
=========================================
Coverage 67.96% 67.96%
Complexity 253 253
=========================================
Files 23 23
Lines 721 721
=========================================
Hits 490 490
Misses 231 231 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
82fb27f
to
f7a792c
Compare
I just rebased this. Hopefully I didn't break anything while doing so. |
01631a5
to
e2559bd
Compare
Add checkbox on hover and add a button to delete the selected contacts Signed-off-by: Bastien PROMPSY <[email protected]>
Add a button to merge the selected contacts Signed-off-by: Bastien PROMPSY <[email protected]>
When the button 'add to group' is clicked, a multiselect appears who allow to select the group or type it Signed-off-by: Bastien PROMPSY <[email protected]>
Signed-off-by: szaimen <[email protected]>
e2559bd
to
15e64b5
Compare
@ChristophWurst I fixed the imports :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First look
menu-align="right"> | ||
<template v-if="selected.length >= 1"> | ||
<ActionButton v-if="showAddToGroup" | ||
icon="icon-clone" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icon classes have been deprecated. please use a material icon.
</template> | ||
<ActionButton v-if="selected.length >= 2" | ||
:close-after-click="true" | ||
icon="icon-clone" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
material icon required
</ActionButton> | ||
<ActionButton v-if="selected.length >= 1" | ||
:close-after-click="true" | ||
icon="icon-delete" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
material icon required
</div> | ||
<VirtualList ref="scroller" | ||
class="contacts-list" | ||
data-key="key" | ||
:data-sources="filteredList" | ||
:data-component="ContactsListItem" | ||
:estimate-size="68" /> | ||
:estimate-size="68" | ||
:extra-props={selected} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing quotes
|
||
export default { | ||
name: 'ContactsList', | ||
|
||
components: { | ||
AppContentList, | ||
VirtualList, | ||
Actions, | ||
ActionButton, | ||
Multiselect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing trailing comma
const contactjcal = this.contacts[element].jCal[1] | ||
this.addValue(firstContact, contactjcal) | ||
// delete the contact merged and the uid in the selected | ||
this.$store.dispatch('deleteContact', { contact: this.contacts[element] }) && this.selected.splice(this.selected.indexOf(element), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await the action
}) | ||
this.$store.dispatch('updateContact', firstContact) | ||
}, | ||
OpenMultiselect() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenMultiselect() { | |
openMultiselect() { |
camel case for methods
const selectedContact = this.contacts[element] | ||
const data = selectedContact.groups | ||
if (!data.includes(value)) { | ||
this.$store.dispatch('addContactToGroup', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await the action
isUnselected() { | ||
this.ischecked = false | ||
// update the selected | ||
this.$parent.$parent.$emit('update-check-selected', this.source.key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accessing the grandparent is a no go. this makes the component depend on the exact structure and is prone to break in unnoticed ways. Please find a better way to pass around the data. Could you use Vuex?
isSelected() { | ||
this.ischecked = true | ||
// update the selected | ||
this.$parent.$parent.$emit('update-check-selected', this.source.key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't access the grandparent component this way
Linked to the pull request #2756 (comment)
By using the menu of the selected contacts.
Add selected contacts in a group who already exist
When the multiselect is clicked, it will display all the group which already exists and by clicking on a group, it will add all the selected contacts to this group
Create a group and add the selected contacts
It's the same but when typing the name of the new group and press down the return key, it will create a group of this name and add the selected contacts into it