Skip to content

Commit

Permalink
fixup! feat: create a readonly contactdetails
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Nov 22, 2024
1 parent a096183 commit 3b96d19
Showing 1 changed file with 19 additions and 59 deletions.
78 changes: 19 additions & 59 deletions src/views/ReadOnlyContactDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@
-->

<template>
<!-- nothing selected or contact not found -->
<NcEmptyContent v-if="!contact"
class="empty-content"
:name="t('mail', 'No data for this contact')"
:description="t('mail', 'No user selected or the user has no data on their profile')">
<template #icon>
<IconContact :size="20" />
</template>
</NcEmptyContent>
<div v-else
class="recipient-details-content">
<div v-if="contact" class="recipient-details-content">
<div class="contact-title">
<h6>
{{ contact.fullName }}
</h6>
<!-- Subtitle here -->
<h6>{{ contact.fullName }}</h6>
<!-- Subtitle -->
<span v-html="formattedSubtitle" />
</div>
<div class="contact-details-wrapper">
Expand All @@ -38,6 +26,15 @@
</div>
</div>
</div>
<!-- nothing selected or contact not found -->
<NcEmptyContent v-else
class="empty-content"
:name="t('mail', 'No data for this contact')"
:description="t('mail', 'No data for this contact on their profile')">
<template #icon>
<IconContact :size="20" />
</template>
</NcEmptyContent>
</template>

<script>
Expand Down Expand Up @@ -71,13 +68,6 @@ export default {
types: String,
required: true,
},
/*
reloadBus: {
type: Object,
required: true,
},
*/
// TODO: is desc used?
desc: {
type: String,
required: false,
Expand Down Expand Up @@ -124,10 +114,6 @@ export default {
addressbooks() {
return this.$store.getters.getAddressbooks
},
/* // store getter
contact() {
return this.$store.getters.getContact(this.contactKey)
}, */
/**
* Contact properties copied and sorted by rfcProps.fieldOrder
*
Expand Down Expand Up @@ -173,36 +159,6 @@ export default {
addressbookIsReadOnly() {
return this.contact.addressbook?.readOnly
},
/* /!**
* Fake model to use the propertySelect component
*
* @return {object}
*!/
addressbookModel() {
return {
readableName: t('mail', 'Address book'),
icon: 'icon-address-book',
options: this.addressbooksOptions,
}
},
/!**
* Store getters filtered and mapped to usable object
* This is the list of addressbooks that are available
*
* @return {{id: string, name: string, readOnly: boolean}[]}
*!/
addressbooksOptions() {
return this.addressbooks
.filter(addressbook => addressbook.enabled)
.map(addressbook => {
return {
id: addressbook.id,
name: addressbook.displayName,
readOnly: addressbook.readOnly,
}
})
},
*/
/**
* Usable addressbook object linked to the local contact
*
Expand Down Expand Up @@ -246,7 +202,6 @@ export default {
async fetchContact() {
const email = this.contactEmailAddress

console.log('abooks', this.addressbooks)
const result = await Promise.all(
this.addressbooks.map(async (addressBook) => [
addressBook.dav,
Expand All @@ -258,7 +213,7 @@ export default {
value: email,
}],
}]),
])
]),
)
const contacts = result.flatMap(([addressBook, vcards]) =>
vcards.map((vcard) => new Contact(vcard.data, addressBook)),
Expand Down Expand Up @@ -424,6 +379,11 @@ section.contact-details {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-top: -10px;
margin-top: -36px;
font-size: large;
margin-left: 216px;
}
:deep(.property__value) {
font-size: medium !important;
}
</style>

0 comments on commit 3b96d19

Please sign in to comment.