diff --git a/src/views/feature/Feature_edit.vue b/src/views/feature/Feature_edit.vue index 8ea11a374d2b479e2b5f15cd5ff689a56618ae1c..07fbc1f44a6953389702f16763a3795c8d7ecc95 100644 --- a/src/views/feature/Feature_edit.vue +++ b/src/views/feature/Feature_edit.vue @@ -173,7 +173,7 @@ <!-- Extra Fields --> <div class="ui horizontal divider">DONNÉES MÉTIER</div> <div - v-for="(field, index) in extra_form" + v-for="(field, index) in orderedCustomFields" :key="field.field_type + index" class="field" > @@ -367,6 +367,12 @@ export default { ); }, + orderedCustomFields() { + return [...this.extra_form].sort( + (a, b) => a.position - b.position + ); + }, + geoRefFileLabel() { if (this.file) { return this.file.name; diff --git a/src/views/feature_type/Feature_type_detail.vue b/src/views/feature_type/Feature_type_detail.vue index 37a732a06ff1fba6c92e8eeb21af894c752b39a8..d849be912ce1997e1b227a8da6e6c9a04929f4bd 100644 --- a/src/views/feature_type/Feature_type_detail.vue +++ b/src/views/feature_type/Feature_type_detail.vue @@ -35,7 +35,7 @@ <h3 class="ui header">Champs</h3> <div class="ui divided list"> <div - v-for="(field, index) in structure.customfield_set" + v-for="(field, index) in orderedCustomFields" :key="field.name + index" class="item" > @@ -226,6 +226,12 @@ export default { lastFeatures: function () { return this.feature_type_features.slice(0, 5); }, + + orderedCustomFields() { + return [...this.structure.customfield_set].sort( + (a, b) => a.position - b.position + ); + }, }, methods: {