summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2022-07-16 09:21:55 +0200
committerGitHub <noreply@github.com>2022-07-16 09:21:55 +0200
commit3c9fea91bd5d7c7ba0816e738149e84bfa9cb654 (patch)
treeb0db074a88cb3b09205808af9f6daff42566bf2d
parent2df77071f8f7afd58830ed19a96144825612ad7d (diff)
parent68980834720e28b7c57b974601f85d812199e575 (diff)
Merge pull request #2846 from nextcloud/backport/2844/stable4.2
[stable4.2] Fix copy to full name and omit year actions
-rw-r--r--src/components/Actions/ActionCopyNtoFN.vue11
-rw-r--r--src/components/Properties/PropertyActions.vue11
-rw-r--r--src/components/Properties/PropertyDateTime.vue1
3 files changed, 14 insertions, 9 deletions
diff --git a/src/components/Actions/ActionCopyNtoFN.vue b/src/components/Actions/ActionCopyNtoFN.vue
index 4f4335b8..771880b6 100644
--- a/src/components/Actions/ActionCopyNtoFN.vue
+++ b/src/components/Actions/ActionCopyNtoFN.vue
@@ -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')
}
},
},
diff --git a/src/components/Properties/PropertyActions.vue b/src/components/Properties/PropertyActions.vue
index c604de86..2d1388a3 100644
--- a/src/components/Properties/PropertyActions.vue
+++ b/src/components/Properties/PropertyActions.vue
@@ -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: {
diff --git a/src/components/Properties/PropertyDateTime.vue b/src/components/Properties/PropertyDateTime.vue
index 1d8b1b6a..3bf5392e 100644
--- a/src/components/Properties/PropertyDateTime.vue
+++ b/src/components/Properties/PropertyDateTime.vue
@@ -73,6 +73,7 @@
<PropertyActions
v-if="!isReadOnly"
:actions="actions"
+ :property-component="this"
@delete="deleteProperty" />
</div>
</div>