diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2023-05-31 20:44:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 20:44:05 +0200 |
commit | 7c19ff199747415f5e37b5619585e0b90bdd6a7d (patch) | |
tree | b2aaf80e777e11e3940483e8666f9867055c9249 | |
parent | 6f79fbc0f324925c8f1f5a048e4f98eb2ccf3898 (diff) | |
parent | 2d7f13f9363bff45b182370ac54597a5ccb8f9b6 (diff) |
Merge pull request #3423 from nextcloud/enhanc/hide-empty-groups
Hide contact groups if its empty
-rw-r--r-- | src/components/Properties/PropertyGroups.vue | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/components/Properties/PropertyGroups.vue b/src/components/Properties/PropertyGroups.vue index 895a8547..b1b08b25 100644 --- a/src/components/Properties/PropertyGroups.vue +++ b/src/components/Properties/PropertyGroups.vue @@ -22,7 +22,7 @@ --> <template> - <div v-if="propModel" class="property"> + <div v-if="propModel && showProperty" class="property"> <PropertyTitle icon="icon-contacts-dark" :readable-name="t('contacts', 'Contact groups')" :is-read-only="isReadOnly" /> @@ -37,7 +37,7 @@ <NcSelect v-model="localValue" :options="groups" :no-wrap="true" - :placeholder="placeholder" + :placeholder="t('contacts', 'Add contact in group')" :multiple="true" :taggable="true" :close-on-select="false" @@ -109,6 +109,9 @@ export default { }, computed: { + showProperty() { + return (this.isReadOnly && this.localValue.length > 0) || !this.isReadOnly + }, groups() { return this.$store.getters.getGroups.slice(0).map(group => group.name) .sort((a, b) => naturalCompare(a, b, { caseInsensitive: true })) @@ -124,16 +127,6 @@ export default { return this.localValue.slice(3).join(', ') }, - /** - * @return {string} - */ - placeholder() { - if (this.isReadOnly) { - return t('contacts', 'None') - } - - return t('contacts', 'Add contact in group') - }, }, watch: { |