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

add error message at wrong file import

parent 8b85f8ee
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,11 @@
id="json_file"
/>
</div>
<ul v-if="importError" class="errorlist">
<li>
{{ importError }}
</li>
</ul>
<button
:disabled="fileToImport.size === 0"
@click="importGeoJson"
......@@ -197,6 +202,7 @@ export default {
data() {
return {
importError: "",
fileToImport: {
name: "Sélectionner un fichier GeoJSON ...",
size: 0,
......@@ -271,6 +277,7 @@ export default {
},
checkJsonValidity(json) {
this.importError = "";
const fields = this.structure.customfield_set.map((el) => {
return {
name: el.name,
......@@ -302,6 +309,7 @@ export default {
} else if (customType !== field_type) {
//* check if custom field value match
console.log("NOT matched");
this.importError = `Le fichier est invalide: Un champ de type ${field_type} ne peut pas avoir la valeur [ ${fieldInFeature} ]`;
return false;
}
}
......
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