Skip to content
Snippets Groups Projects
Commit 17bd43cc authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

fix import

parent f7de058b
No related branches found
No related tags found
2 merge requests!22Fix/bug from uc6,!21Fix/bug from uc6
......@@ -11,7 +11,7 @@ export class Dataset {
}
export class DatasetPath {
public dcatProperty: Dataset;
public dcatProperty: Dataset | string;
public path: string
constructor(dcatProperty: Dataset, path: string) {
......
......@@ -339,10 +339,14 @@ export class MappingComponent implements OnInit {
let datasetPath: DatasetPath[] = [];
reader.onloadend = () => {
datasetPath = <DatasetPath[]>JSON.parse(reader.result as string);
datasetPath.forEach(e => {
this.selectedPaths[datasetPath.indexOf(e)] = e.path;
this.dcatVocabulary[datasetPath.indexOf(e)] = e.dcatProperty;
});
for (let i = 0; i < datasetPath.length; i++) {
this.selectedPaths[i] = datasetPath[i].path;
if (typeof datasetPath[i].dcatProperty === 'string') {
this.dcatVocabulary[i] = new Dataset('',<string> datasetPath[i].dcatProperty, '');
} else {
this.dcatVocabulary[i] = <Dataset> datasetPath[i].dcatProperty;
}
}
}
reader.readAsText(jsonFile);
}
......
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