Replace errorThrown with notify for csv download fail notification

Also moving to copy
pull/10616/head
Alex P 2018-03-22 21:38:44 -07:00
parent 240e31d823
commit 2155217a60
2 changed files with 8 additions and 2 deletions

View File

@ -6,7 +6,8 @@ import Authorized, {EDITOR_ROLE} from 'src/auth/Authorized'
import LayoutCellMenu from 'shared/components/LayoutCellMenu'
import LayoutCellHeader from 'shared/components/LayoutCellHeader'
import {errorThrown} from 'shared/actions/errors'
import {notify} from 'src/shared/actions/notifications'
import {notifyCSVDownloadFailed} from 'src/shared/copy/notifications'
import {dashboardtoCSV} from 'shared/parsing/resultsToCSV'
import download from 'src/external/download.js'
@ -25,7 +26,7 @@ class LayoutCell extends Component {
try {
download(dashboardtoCSV(celldata), `${joinedName}.csv`, 'text/plain')
} catch (error) {
errorThrown(error, 'Unable to download .csv file')
notify(notifyCSVDownloadFailed())
console.error(error)
}
}

View File

@ -72,6 +72,11 @@ export const notifyCouldNotDeleteKapacitor = () => ({
message: 'Internal Server Error. Could not delete Kapacitor Connection.',
})
export const notifyCSVDownloadFailed = () => ({
...defaultErrorNotification,
message: 'Unable to download .CSV file',
})
// Hosts Page Notifications
// ----------------------------------------------------------------------------
export const notifyUnableToGetHosts = () => ({