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

fix import features from geojson with feature_type creation undefined name

parent 060a76bb
No related branches found
No related tags found
2 merge requests!295Version 3.0.0,!288REDMINE_ISSUE-12996
......@@ -171,7 +171,8 @@ const feature_type = {
if(!geojson && !state.fileToImport && state.fileToImport.size === 0 ) return;
let formData = new FormData();
let fileToImport;
const { name, type } = geojson || state.fileToImport;
let { name, type } = geojson || state.fileToImport;
if (!name && state.fileToImport) name = state.fileToImport.name;
if (rootState.projects.project.moderation) {
if (state.fileToImport && state.fileToImport.size > 0) { //* if data in a binary file, read it as text
......
......@@ -399,7 +399,7 @@ export default {
this.importGeoJsonFeatureType();
if (this.fileToImport && this.fileToImport.name) {
this.form.title.value = // * use the filename as title by default
this.fileToImport.name.split('.')[0];
this.fileToImport.name.split('.')[0];
} else { //* case when the geojson comes from datasud catalog
this.form.title.value = this.geojson.name;// * use the typename as title by default
}
......
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