Skip to content

Commit

Permalink
Fix name of imported dataset and title of get dataContextList request…
Browse files Browse the repository at this point in the history
…s. (#1511)
  • Loading branch information
tealefristoe authored Sep 24, 2024
1 parent 20551a7 commit 0aee631
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const diDataContextListHandler: DIHandler = {
return {
name: dataSet.name,
guid: id,
title: dataSet._title,
title: dataSet.title,
id
}
})
Expand Down
5 changes: 4 additions & 1 deletion v3/src/utilities/csv-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export function downloadCsvFile(dataUrl: string, onComplete: (results: CsvParseR
}

export function convertParsedCsvToDataSet(results: CsvParseResult, filename: string) {
const ds = DataSet.create({ name: filename })
// Remove extension
// From https://stackoverflow.com/questions/4250364/how-to-trim-a-file-extension-from-a-string-in-javascript
const name = filename.replace(/\.[^/.]+$/, "")
const ds = DataSet.create({ name })
// add attributes (extracted from first case)
for (const pName in results.data[0]) {
ds.addAttribute({name: pName})
Expand Down

0 comments on commit 0aee631

Please sign in to comment.