diff --git a/src/components/Feature/Detail/FeatureHeader.vue b/src/components/Feature/Detail/FeatureHeader.vue index 33ee77d8f963eb168a7daaa0e761ff3f7ebe4150..1d45d3c4c951d6931881920903fc59dfebb5d369 100644 --- a/src/components/Feature/Detail/FeatureHeader.vue +++ b/src/components/Feature/Detail/FeatureHeader.vue @@ -170,7 +170,7 @@ @blur="updateDescription" /> </span> - <span v-else> + <span v-else-if="currentFeature && currentFeature.properties"> {{ currentFeature.properties.description }} </span> </div> diff --git a/src/components/Feature/Detail/FeatureTable.vue b/src/components/Feature/Detail/FeatureTable.vue index 66d12960dd68cc72df1f09d60b6c4a03edda0369..17a57ba0a3fee887f9b39b36aca3f5a6ab46ef3e 100644 --- a/src/components/Feature/Detail/FeatureTable.vue +++ b/src/components/Feature/Detail/FeatureTable.vue @@ -54,7 +54,9 @@ <td> Auteur </td> - <td>{{ currentFeature.properties.display_creator }}</td> + <td v-if="currentFeature.properties"> + {{ currentFeature.properties.display_creator }} + </td> </tr> <tr> <td> @@ -62,7 +64,7 @@ </td> <td> <i - v-if="currentFeature.properties.status" + v-if="currentFeature.properties && currentFeature.properties.status" :class="['icon', statusIcon]" aria-hidden="true" /> @@ -80,7 +82,7 @@ <td> Date de création </td> - <td v-if="currentFeature.properties.created_on"> + <td v-if="currentFeature.properties && currentFeature.properties.created_on"> {{ currentFeature.properties.created_on | formatDate }} </td> </tr> @@ -88,7 +90,7 @@ <td> Date de dernière modification </td> - <td v-if="currentFeature.properties.updated_on"> + <td v-if="currentFeature.properties && currentFeature.properties.updated_on"> {{ currentFeature.properties.updated_on | formatDate }} </td> </tr> @@ -197,13 +199,16 @@ export default { }, statusLabel() { - if (this.currentFeature.properties.status.label) { - return this.currentFeature.properties.status.label; + if (this.currentFeature.properties) { + if (this.currentFeature.properties && this.currentFeature.properties.status.label) { + return this.currentFeature.properties.status.label; + } + const status = statusChoices.find( + (el) => el.value === this.currentFeature.properties.status + ); + return status ? status.name : ''; } - const status = statusChoices.find( - (el) => el.value === this.currentFeature.properties.status - ); - return status ? status.name : ''; + return ''; }, featureData() { @@ -211,7 +216,7 @@ export default { return this.featureType.customfield_set.map((xtraForm) => { return { ...xtraForm, - value: this.currentFeature.properties[xtraForm.label] + value: this.currentFeature.properties[xtraForm.name] }; }); }