diff options
author | Johannes Merkel <mail@johannesgge.de> | 2023-04-26 13:37:27 +0200 |
---|---|---|
committer | Johannes Merkel <mail@johannesgge.de> | 2023-04-26 15:19:06 +0200 |
commit | 6421bd4499a90bf35ce777641a411f3ee64e43af (patch) | |
tree | 7232bd6e849158bbb443d84c9ba96e25b88c6bfb /src | |
parent | 713fe88e87d711f055cb7c25341074e373e28eb5 (diff) |
fix(contacts): display name not uri for recent-contacted address book
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/ContactDetails.vue | 18 | ||||
-rw-r--r-- | src/components/Properties/PropertySelect.vue | 19 |
2 files changed, 30 insertions, 7 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue index f374a53f..eb41ed43 100644 --- a/src/components/ContactDetails.vue +++ b/src/components/ContactDetails.vue @@ -42,7 +42,9 @@ <!-- fullname --> <template #title> - <div v-if="isReadOnly">{{ contact.fullName }}</div> + <div v-if="isReadOnly"> + {{ contact.fullName }} + </div> <input v-else id="contact-fullname" ref="fullname" @@ -59,7 +61,9 @@ <!-- org, title --> <template #subtitle> - <template v-if="isReadOnly">{{ formattedSubtitle }}</template> + <template v-if="isReadOnly"> + {{ formattedSubtitle }} + </template> <template v-else> <input id="contact-title" v-model="contact.title" @@ -226,6 +230,7 @@ :is-last-property="true" :property="{}" :hide-actions="true" + :is-read-only="isReadOnly" class="property--addressbooks property--last" /> <!-- Groups always visible --> @@ -485,17 +490,18 @@ export default { /** * Store getters filtered and mapped to usable object - * This is the list of addressbooks that are available to write + * This is the list of addressbooks that are available * - * @return {{id: string, name: string}[]} + * @return {{id: string, name: string, readOnly: boolean}[]} */ addressbooksOptions() { return this.addressbooks - .filter(addressbook => !addressbook.readOnly && addressbook.enabled) + .filter(addressbook => addressbook.enabled) .map(addressbook => { return { id: addressbook.id, name: addressbook.displayName, + readOnly: addressbook.readOnly, } }) }, @@ -539,7 +545,7 @@ export default { } return '' - } + }, }, watch: { diff --git a/src/components/Properties/PropertySelect.vue b/src/components/Properties/PropertySelect.vue index afcea622..e3c70f56 100644 --- a/src/components/Properties/PropertySelect.vue +++ b/src/components/Properties/PropertySelect.vue @@ -44,7 +44,7 @@ </div> <Multiselect v-model="matchedOptions" - :options="options" + :options="selectableOptions" :placeholder="t('contacts', 'Select option')" :disabled="isSingleOption || isReadOnly" class="property__value" @@ -91,6 +91,23 @@ export default { }, computed: { + /** + * Store getters filtered and mapped to usable object + * This is the list of addressbooks that are available to write + * + * @return {{id: string, name: string}[]} + */ + selectableOptions() { + return this.options + .filter(option => !option.readOnly) + .map(addressbook => { + return { + id: addressbook.id, + name: addressbook.name, + } + }) + }, + // is there only one option available isSingleOption() { return this.propModel.options.length <= 1 && this.options.length <= 1 |