mirror of https://github.com/nextcloud/contacts
Merge pull request #2844 from nextcloud/fix/noid/fix-copy-to-full-name
Fix copy to full name and omit year actions
This commit is contained in:
commit
84b1bfe866
|
@ -21,7 +21,7 @@
|
|||
-->
|
||||
|
||||
<template>
|
||||
<ActionButton icon="icon-up" @click="copyNtoFN">
|
||||
<ActionButton icon="icon-up" @click="copyNToFN">
|
||||
{{ t('contacts', 'Copy to full name') }}
|
||||
</ActionButton>
|
||||
</template>
|
||||
|
@ -37,13 +37,12 @@ export default {
|
|||
mixins: [ActionsMixin],
|
||||
methods: {
|
||||
copyNToFN() {
|
||||
console.info(this.component)
|
||||
if (this.component.contact.vCard.hasProperty('n')) {
|
||||
if (this.component.localContact.vCard.hasProperty('n')) {
|
||||
// Stevenson;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P.
|
||||
// -> John Stevenson
|
||||
const n = this.component.contact.vCard.getFirstPropertyValue('n')
|
||||
this.component.contact.fullName = n.slice(0, 2).reverse().join(' ')
|
||||
this.component.updateContact()
|
||||
const n = this.component.localContact.vCard.getFirstPropertyValue('n')
|
||||
this.component.localContact.fullName = n.slice(0, 2).reverse().join(' ')
|
||||
this.component.$emit('update')
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
</template>
|
||||
{{ t('contacts', 'Delete') }}
|
||||
</ActionButton>
|
||||
<Actions :is="action"
|
||||
v-for="(action, index) in actions"
|
||||
:key="index" />
|
||||
<component v-for="action in actions"
|
||||
:is="action"
|
||||
:key="action.name"
|
||||
:component="propertyComponent" />
|
||||
</Actions>
|
||||
</template>
|
||||
|
||||
|
@ -53,6 +54,10 @@ export default {
|
|||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
propertyComponent: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
<PropertyActions
|
||||
v-if="!isReadOnly"
|
||||
:actions="actions"
|
||||
:property-component="this"
|
||||
@delete="deleteProperty" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue