diff --git a/src/utils/index.js b/src/utils/index.js index a89354b8305aaae4b1d12e04003990b7e25cda55..f4ab34f311a5641e3204cc6259b73f75027b2b3c 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -66,7 +66,7 @@ export function transformProperties(prop) { const regInteger = /^-*?\d+$/; const regFloat = /^-*?\d*?\.\d+$/; const regText = /[\r\n]/; - if (type === 'boolean' || prop.toLowerCase() === 'true' || prop.toLowerCase() === 'False') { + if (type === 'boolean' || (type === 'string' && (prop.toLowerCase() === 'true' || prop.toLowerCase() === 'False'))) { return 'boolean'; } else if (regInteger.test(prop) || Number.isSafeInteger(prop)) { return 'integer'; diff --git a/src/views/FeatureType/FeatureTypeEdit.vue b/src/views/FeatureType/FeatureTypeEdit.vue index 47bad6dceb3668063f9c76a1b9de51d7c13fdc7c..0ae06f5b14f07fa8335abcbb4ef05943dd4142d8 100644 --- a/src/views/FeatureType/FeatureTypeEdit.vue +++ b/src/views/FeatureType/FeatureTypeEdit.vue @@ -1,22 +1,5 @@ <template> <div id="feature-type-edit"> - <div - id="message" - class="fullwidth" - > - <div - v-if="error" - class="ui negative message" - > - <p> - <i - class="cross icon" - aria-hidden="true" - /> - {{ error }} - </p> - </div> - </div> <div class="fourteen wide column"> <div :class="{ active: loading }" @@ -185,12 +168,14 @@ export default { loading: false, action: 'create', dataKey: 0, - error: null, csvFields: null, geomTypeChoices: [ { value: 'linestring', name: 'Ligne' }, { value: 'point', name: 'Point' }, { value: 'polygon', name: 'Polygone' }, + { value: 'multilinestring', name: 'Multiligne' }, + { value: 'multipoint', name: 'Multipoint' }, + { value: 'multipolygon', name: 'Multipolygone' }, ], form: { colors_style: { @@ -395,6 +380,9 @@ export default { }, methods: { + ...mapMutations([ + 'DISPLAY_MESSAGES', + ]), ...mapMutations('feature-type', [ 'ADD_CUSTOM_FORM', 'EMPTY_FORM', @@ -540,9 +528,10 @@ export default { } else if (status === 201) { this.goBackToProject('Le nouveau type de signalement a été créé'); } else { - this.displayMessage( - "Une erreur est survenue lors de l'import du type de signalement" - ); + this.DISPLAY_MESSAGES({ + comment: "Une erreur est survenue lors de l'import du type de signalement", + level: 'negative' + }); } }); } @@ -558,10 +547,10 @@ export default { if (response && response.status === 200) { this.goBackToProject(); } else { - this.displayMessage( - "Une erreur est survenue lors de l'import de signalements.\n " + - response.data.detail - ); + this.DISPLAY_MESSAGES({ + comment: `Une erreur est survenue lors de l'import de signalements.\n ${ response.data.detail }`, + level: 'negative' + }); } this.loading = false; }) @@ -616,13 +605,6 @@ export default { } }, - displayMessage(message) { - this.error = message; - document - .getElementById('message') - .scrollIntoView({ block: 'end', inline: 'nearest' }); - }, - // ****** Methodes for geojson import ****** // toNewFeatureType() { this.$router.push({