diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-12 10:02:00 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-27 19:41:59 +0100 |
commit | f67a5cc9b3bea0a0308e0dec7f804ebb32485618 (patch) | |
tree | 09656a3ad6f39b71d387130066bacb9a463eb085 /src/components | |
parent | ae80cf1a5a8f3d72cba1a2d65a9c2468c94619b1 (diff) |
Add ABLABEL and ITEMX.property support
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ContactDetails/ContactDetailsProperty.vue | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/ContactDetails/ContactDetailsProperty.vue b/src/components/ContactDetails/ContactDetailsProperty.vue index 048b3e20..568aa554 100644 --- a/src/components/ContactDetails/ContactDetailsProperty.vue +++ b/src/components/ContactDetails/ContactDetailsProperty.vue @@ -126,6 +126,11 @@ export default { * @returns {string} */ propName() { + // ! is this a ITEMXX.XXX property?? + if (this.propGroup[1]) { + return this.propGroup[1] + } + return this.property.name }, /** @@ -139,6 +144,7 @@ export default { if (this.propModel && this.propModel.force) { return this.propModel.force } + return this.property.getDefaultType() }, @@ -172,6 +178,16 @@ export default { }, /** + * Return the id and type of a property group + * e.g ITEMXX.tel => ['ITEMXX', 'tel'] + * + * @returns {Array} + */ + propGroup() { + return this.property.name.split('.') + }, + + /** * Returns the closest match to the selected type * or return the default selected as a new object if * none exists @@ -180,6 +196,14 @@ export default { */ selectType: { get() { + // ! if ABLABEL is present, this is a priority + const type = this.contact.vCard.getFirstPropertyValue(`${this.propGroup[0]}.x-ablabel`) + if (type) { + return { + id: type, + name: type + } + } if (this.propModel && this.propModel.options && this.type) { let selectedType = this.type |