Skip to content
Snippets Groups Projects
Commit 97c0d93d authored by Timothee P's avatar Timothee P :sunflower:
Browse files

fix value of undefined properties & extra field name instead of label

parent 5c62aab3
No related branches found
No related tags found
1 merge request!564REDMINE_ISSUE-16828|REDMINE_ISSUE-17022|REDMINE_ISSUE-17031|REDMINE_ISSUE-17033| Page utilisateur - lien non valide vers signalement
This commit is part of merge request !564. Comments created here will be created in the context of that merge request.
......@@ -170,7 +170,7 @@
@blur="updateDescription"
/>
</span>
<span v-else>
<span v-else-if="currentFeature && currentFeature.properties">
{{ currentFeature.properties.description }}
</span>
</div>
......
......@@ -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]
};
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment