DEV: Add unique filename for table exports (#19)
This commit is contained in:
parent
52b69453ba
commit
f68a599e87
|
@ -173,12 +173,18 @@ export default class SpreadsheetEditor extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
buildSpreadsheet(data, columns, opts = {}) {
|
buildSpreadsheet(data, columns, opts = {}) {
|
||||||
|
const postNumber = this.args.model?.post_number;
|
||||||
|
const exportFileName = postNumber
|
||||||
|
? `post-${postNumber}-table-export`
|
||||||
|
: `post-table-export`;
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
this.spreadsheet = jspreadsheet(this.spreadsheet, {
|
this.spreadsheet = jspreadsheet(this.spreadsheet, {
|
||||||
data,
|
data,
|
||||||
columns,
|
columns,
|
||||||
defaultColAlign: "left",
|
defaultColAlign: "left",
|
||||||
wordWrap: true,
|
wordWrap: true,
|
||||||
|
csvFileName: exportFileName,
|
||||||
...opts,
|
...opts,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue