diff options
author | greta <gretadoci@gmail.com> | 2023-05-31 16:43:05 +0200 |
---|---|---|
committer | greta <gretadoci@gmail.com> | 2023-05-31 16:43:05 +0200 |
commit | 2d7f13f9363bff45b182370ac54597a5ccb8f9b6 (patch) | |
tree | b2aaf80e777e11e3940483e8666f9867055c9249 /src | |
parent | 6f79fbc0f324925c8f1f5a048e4f98eb2ccf3898 (diff) |
Hide contact groups if its empty
Signed-off-by: greta <gretadoci@gmail.com>
Diffstat (limited to 'src')
-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: { |