FIX [rendering] adjust vue components to correctly render profession string

This commit is contained in:
Julie Lenaerts 2023-02-22 17:56:28 +01:00 committed by Julien Fastré
parent bea839663f
commit e50b02a8c7
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="container tpartycontainer">
<div class="tparty-identification">
<span v-if="item.result.profession" class="profession">{{ item.result.profession.name.fr }}</span>
<span v-if="item.result.profession" class="profession">{{ item.result.profession }}</span>
<span class="name">
{{ item.result.text }}&nbsp;
</span>

View File

@ -36,7 +36,7 @@
<ul class="list-content fa-ul">
<li v-if="getProfession.length > 0">
<i class="fa fa-li fa-id-card"></i>
<p><span v-for="p in getProfession" :key="p" class="list-item list-professions">{{ p[0].toUpperCase() + p.slice(1).toLowerCase() }}</span></p>
<p><span>{{ getProfession[0] }}</span></p>
</li>
<li v-if="hasParent">
<i class="fa fa-li fa-hand-o-right"></i>
@ -136,13 +136,14 @@ export default {
getProfession() {
let profession = []
if (this.hasParent && this.thirdparty.profession) {
profession.push(this.thirdparty.profession.name.fr)
profession.push(this.thirdparty.profession)
return profession;
}
if (!this.hasParent && this.thirdparty.category) {
profession = this.thirdparty.category.map((category) => category.text);
}
return profession;
}
/* TODO need backend normalizer to serve children without circular reference