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

prevent feature_id at feature-type creation instead of import for performance...

prevent feature_id at feature-type creation instead of import for performance & fix undefined feature-type
parent 2679cdc3
No related branches found
No related tags found
No related merge requests found
......@@ -666,16 +666,6 @@ export default {
.filter(Boolean);
if (sampleLine.length > 1 && headersCoord.length === 2) {
this.csvError = null;
//* remove feature_id if found in headers
const featureIdIndex = headers.indexOf('feature_id');
if (featureIdIndex > -1) {
content = content.split('\n')
.reduce((csvString, rowStr) => {
let rowArray = rowStr.split(delimiter);
rowArray.splice(featureIdIndex, 1); // remove feature_id in header and features
return csvString += rowArray.join(delimiter) + '\n';
}, '');
}
this.csvImport = csvToJson(content, delimiter);
this.featureTypeImporting = false;
//* stock filename to import features afterward
......
......@@ -250,12 +250,14 @@ export default {
]),
...mapState('feature-type', [
'feature_types',
'feature_type',
]),
...mapState('feature', [
'currentFeature',
'form',
]),
...mapGetters('feature-type', [
'feature_type',
]),
...mapGetters([
'permissions',
]),
......
......@@ -247,6 +247,7 @@ export default {
'archived_on',
'deletion_on',
'feature_type',
'feature_id',
'display_creator',
'display_last_editor',
'project',
......
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