Skip to content

Commit

Permalink
fixup! feat: add recipient info on the right side of the composer
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Aug 21, 2024
1 parent 48ff58c commit 8673d84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 58 deletions.
7 changes: 5 additions & 2 deletions src/components/RecipientInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</div> -->
<div class="recipient-multiple">
<div class="recipient-list">
<div v-for="(vcard, index) in recipientsVCards"
<div v-for="(vCard, index) in recipientsVCards"
:key="index"
class="recipient-item">
<RecipientDetails :contacts="vcard.data" :reload-bus="reloadBus" />
<RecipientDetails :contact-key="selectedContacts" :contacts="vCard.data" :reload-bus="reloadBus" />
<!-- <Avatar :user="recipient.uid"

Check failure on line 23 in src/components/RecipientInfo.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected tab character
:display-name="recipient.displayName"
:email="recipient.email"
Expand Down Expand Up @@ -85,6 +85,9 @@ export default {
recipientsVCardsList() {
return Object.values(this.recipientsVCards).filter(Boolean)
},
selectedContact() {
return this.$route.params.selectedContact
},
},
watch: {
async recipients() {
Expand Down
59 changes: 3 additions & 56 deletions src/nextcloud-contacts/RecipientDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,18 @@
<template v-else>
<!-- contact header -->
<DetailsHeader>
<!-- avatar and upload photo -->
<template #avatar>
<ContactAvatar :contact="contact"
:is-read-only="isReadOnly"
:reload-bus="reloadBus"
@update-local-contact="updateLocalContact" />
</template>

<!-- fullname -->
<template #title>
<div v-if="isReadOnly" class="contact-title">
<div class="contact-title">
{{ contact.fullName }}
</div>
<input v-else
id="contact-fullname"
ref="fullname"
v-model="contact.fullName"
:placeholder="t('contacts', 'Name')"
type="text"
autocomplete="off"
autocorrect="off"
spellcheck="false"
name="fullname"
@click="selectInput">
</template>

<!-- org, title -->
<template #subtitle>
<template v-if="isReadOnly">
<template>
<span v-html="formattedSubtitle" />
</template>
<template v-else>
<input id="contact-title"
v-model="contact.title"
:placeholder="t('contacts', 'Title')"
type="text"
autocomplete="off"
autocorrect="off"
spellcheck="false"
name="title">
<input id="contact-org"
v-model="contact.org"
:placeholder="t('contacts', 'Company')"
type="text"
autocomplete="off"
autocorrect="off"
spellcheck="false"
name="org">
</template>
</template>

<div v-if="!loadingData" class="contact-details-wrapper">
Expand All @@ -81,8 +44,7 @@
:contact="contact"
:local-contact="localContact"
:contacts="contacts"
:bus="bus"
:is-read-only="isReadOnly" />
:bus="bus" />
</div>
<!-- addressbook change select - no last property because class is not applied here,
empty property because this is a required prop on regular property-select. But since
Expand All @@ -95,14 +57,12 @@
:is-last-property="true"
:property="{}"
:hide-actions="true"
:is-read-only="isReadOnly"
class="property--addressbooks property--last" />

<!-- Groups always visible -->
<PropertyGroups :prop-model="groupsModel"
:value.sync="localContact.groups"
:contact="contact"
:is-read-only="isReadOnly"
class="property--groups property--last"
@update:value="updateGroups" />
</div>
Expand Down Expand Up @@ -181,19 +141,6 @@ export default {
contact() {
return this.$store.getters.getContact(this.contactKey)
},
/**
* Conflict message
*
* @return {string|boolean}
*/
conflict() {
if (this.contact.conflict) {
return t('contacts', 'The contact you were trying to edit has changed. Please manually refresh the contact. Any further edits will be discarded.')
}
return false
},
/**
* Contact properties copied and sorted by rfcProps.fieldOrder
*
Expand Down

0 comments on commit 8673d84

Please sign in to comment.