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 @@ ...@@ -170,7 +170,7 @@
@blur="updateDescription" @blur="updateDescription"
/> />
</span> </span>
<span v-else> <span v-else-if="currentFeature && currentFeature.properties">
{{ currentFeature.properties.description }} {{ currentFeature.properties.description }}
</span> </span>
</div> </div>
......
...@@ -54,7 +54,9 @@ ...@@ -54,7 +54,9 @@
<td> <td>
Auteur Auteur
</td> </td>
<td>{{ currentFeature.properties.display_creator }}</td> <td v-if="currentFeature.properties">
{{ currentFeature.properties.display_creator }}
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
...@@ -62,7 +64,7 @@ ...@@ -62,7 +64,7 @@
</td> </td>
<td> <td>
<i <i
v-if="currentFeature.properties.status" v-if="currentFeature.properties && currentFeature.properties.status"
:class="['icon', statusIcon]" :class="['icon', statusIcon]"
aria-hidden="true" aria-hidden="true"
/> />
...@@ -80,7 +82,7 @@ ...@@ -80,7 +82,7 @@
<td> <td>
Date de création Date de création
</td> </td>
<td v-if="currentFeature.properties.created_on"> <td v-if="currentFeature.properties && currentFeature.properties.created_on">
{{ currentFeature.properties.created_on | formatDate }} {{ currentFeature.properties.created_on | formatDate }}
</td> </td>
</tr> </tr>
...@@ -88,7 +90,7 @@ ...@@ -88,7 +90,7 @@
<td> <td>
Date de dernière modification Date de dernière modification
</td> </td>
<td v-if="currentFeature.properties.updated_on"> <td v-if="currentFeature.properties && currentFeature.properties.updated_on">
{{ currentFeature.properties.updated_on | formatDate }} {{ currentFeature.properties.updated_on | formatDate }}
</td> </td>
</tr> </tr>
...@@ -197,13 +199,16 @@ export default { ...@@ -197,13 +199,16 @@ export default {
}, },
statusLabel() { statusLabel() {
if (this.currentFeature.properties.status.label) { if (this.currentFeature.properties) {
return this.currentFeature.properties.status.label; 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( return '';
(el) => el.value === this.currentFeature.properties.status
);
return status ? status.name : '';
}, },
featureData() { featureData() {
...@@ -211,7 +216,7 @@ export default { ...@@ -211,7 +216,7 @@ export default {
return this.featureType.customfield_set.map((xtraForm) => { return this.featureType.customfield_set.map((xtraForm) => {
return { return {
...xtraForm, ...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