Skip to content
Snippets Groups Projects

REDMINE_ISSUE-18160 | Duplication des champs dans le formulaire de visualisation

Merged REDMINE_ISSUE-18160 | Duplication des champs dans le formulaire de visualisation
Merged Timothee P requested to merge redmine-issues/18160 into develop
1 file
+ 40
35
Compare changes
  • Side-by-side
  • Inline
@@ -17,38 +17,40 @@
@@ -17,38 +17,40 @@
v-for="field in featureFields"
v-for="field in featureFields"
:key="field.name"
:key="field.name"
>
>
<td v-if="!field.isDeactivated">
<template v-if="!field.isDeactivated">
<strong :class="{ required: field.is_mandatory }">
<td>
{{ field.label }}
<strong :class="{ required: field.is_mandatory }">
</strong>
{{ field.label }}
</td>
</strong>
<td v-if="!field.isDeactivated">
</td>
<strong class="ui form">
<td>
<span
<strong class="ui form">
v-if="fastEditionMode && canEditFeature && extra_forms.length > 0"
<span
:id="field.label"
v-if="fastEditionMode && canEditFeature && extra_forms.length > 0"
>
:id="field.label"
<FeatureExtraForm
>
ref="extraForm"
<FeatureExtraForm
:field="field"
ref="extraForm"
 
:field="field"
 
/>
 
</span>
 
<i
 
v-else-if="field.field_type === 'boolean'"
 
:class="[
 
'icon',
 
field.value ? 'olive check' : 'grey times',
 
]"
 
aria-hidden="true"
/>
/>
</span>
<span v-else-if="field.value && field.field_type === 'multi_choices_list'">
<i
{{ field.value.join(', ') }}
v-else-if="field.field_type === 'boolean'"
</span>
:class="[
<span v-else>
'icon',
{{ field.value && field.value.label ? field.value.label : field.value }}
field.value ? 'olive check' : 'grey times',
</span>
]"
</strong>
aria-hidden="true"
</td>
/>
</template>
<span v-else-if="field.value && field.field_type === 'multi_choices_list'">
{{ field.value.join(', ') }}
</span>
<span v-else>
{{ field.value && field.value.label ? field.value.label : field.value }}
</span>
</strong>
</td>
</tr>
</tr>
<tr>
<tr>
<td>
<td>
@@ -142,7 +144,7 @@ import { mapState } from 'vuex';
@@ -142,7 +144,7 @@ import { mapState } from 'vuex';
import FeatureTypeLink from '@/components/FeatureType/FeatureTypeLink';
import FeatureTypeLink from '@/components/FeatureType/FeatureTypeLink';
import FeatureEditStatusField from '@/components/Feature/FeatureEditStatusField';
import FeatureEditStatusField from '@/components/Feature/FeatureEditStatusField';
import FeatureExtraForm from '@/components/Feature/Edit/FeatureExtraForm';
import FeatureExtraForm from '@/components/Feature/Edit/FeatureExtraForm';
import { statusChoices, formatStringDate } from '@/utils';
import { statusChoices, formatStringDate, checkDeactivatedValues } from '@/utils';
export default {
export default {
@@ -213,12 +215,15 @@ export default {
@@ -213,12 +215,15 @@ export default {
featureData() {
featureData() {
if (this.currentFeature.properties && this.featureType) {
if (this.currentFeature.properties && this.featureType) {
return this.featureType.customfield_set.map((xtraForm) => {
// retrieve value for each feature type custom field within feature data
 
const extraFieldsWithValue = this.featureType.customfield_set.map((xtraField) => {
return {
return {
...xtraForm,
...xtraField,
value: this.currentFeature.properties[xtraForm.name]
value: this.currentFeature.properties[xtraField.name]
};
};
});
});
 
// filter out fields not meeting condition to be activated
 
return checkDeactivatedValues(extraFieldsWithValue);
}
}
return [];
return [];
},
},
Loading