diff --git a/src/components/ContactDetails/ContactDetailsProperty.vue b/src/components/ContactDetails/ContactDetailsProperty.vue index 048b3e204b..57896f6baf 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,7 +144,16 @@ export default { if (this.propModel && this.propModel.force) { return this.propModel.force } - return this.property.getDefaultType() + + // ! is this a ITEMXX.XXX property?? + const defaultType = this.property.getDefaultType() + if (defaultType === 'unknown' + && this.properties[this.propName] + && this.property._designSet.property[this.propName]) { + return this.property._designSet.property[this.propName].defaultType + } + + return defaultType }, /** @@ -171,6 +185,24 @@ export default { return [] }, + /** + * Return the id and type of a property group + * e.g ITEMXX.tel => ['ITEMXX', 'tel'] + * + * @returns {Array} + */ + propGroup() { + const defaultType = this.property.getDefaultType() + if (defaultType === 'unknown') { + // splitting and checking validity of last part + const type = this.property.name.split('.') + if (type.length === 2) { + return type + } + } + return [] + }, + /** * Returns the closest match to the selected type * or return the default selected as a new object if @@ -180,6 +212,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