mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
UI/ fix firefox not recognizing csv export (#15364)
* add extension to filenmae * add changelog
This commit is contained in:
3
changelog/15364.txt
Normal file
3
changelog/15364.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
ui: fix firefox inability to recognize file format of client count csv export
|
||||||
|
```
|
||||||
@@ -8,7 +8,8 @@ import Service from '@ember/service';
|
|||||||
|
|
||||||
export default class DownloadCsvService extends Service {
|
export default class DownloadCsvService extends Service {
|
||||||
download(filename, content) {
|
download(filename, content) {
|
||||||
let formattedFilename = filename?.replace(/\s+/g, '-') || 'vault-data.csv';
|
// even though Blob type 'text/csv' is specified below, some browsers (ex. Firefox) require the filename has an explicit extension
|
||||||
|
let formattedFilename = `${filename?.replace(/\s+/g, '-')}.csv` || 'vault-data.csv';
|
||||||
let { document, URL } = window;
|
let { document, URL } = window;
|
||||||
let downloadElement = document.createElement('a');
|
let downloadElement = document.createElement('a');
|
||||||
downloadElement.download = formattedFilename;
|
downloadElement.download = formattedFilename;
|
||||||
|
|||||||
Reference in New Issue
Block a user