Skip to content
Snippets Groups Projects
Commit 7f8f76d2 authored by stevereis's avatar stevereis
Browse files

fix(csv): Root variables not added

parent 1a51e02f
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ export default class CSVService implements IEngineService { ...@@ -79,7 +79,7 @@ export default class CSVService implements IEngineService {
const rows = data const rows = data
.split('\r\n') .split('\r\n')
.map((row) => row.split('\t').filter((i) => i)) .map((row) => row.split('\t').filter((i) => i))
.filter((row) => row.length >= 2); .filter((row) => row.length >= 1);
rows.shift(); // remove headers rows.shift(); // remove headers
...@@ -88,6 +88,7 @@ export default class CSVService implements IEngineService { ...@@ -88,6 +88,7 @@ export default class CSVService implements IEngineService {
const rootGroup: Group = { const rootGroup: Group = {
id: 'Global group', id: 'Global group',
groups: [], groups: [],
variables: [],
}; };
rows.forEach((row) => { rows.forEach((row) => {
...@@ -100,6 +101,11 @@ export default class CSVService implements IEngineService { ...@@ -100,6 +101,11 @@ export default class CSVService implements IEngineService {
if (!vars.find((v) => v.id === variable.id)) vars.push(variable); // avoid duplicate if (!vars.find((v) => v.id === variable.id)) vars.push(variable); // avoid duplicate
if (row.length < 1) {
rootGroup.variables.push(variable.id);
return;
}
let pathId = ''; let pathId = '';
row.forEach((group, i) => { row.forEach((group, i) => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment