From 2155217a604f90cf528d8cf7884d7a719f70c5a6 Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 22 Mar 2018 21:38:44 -0700 Subject: [PATCH] Replace errorThrown with notify for csv download fail notification Also moving to copy --- ui/src/shared/components/LayoutCell.js | 5 +++-- ui/src/shared/copy/notifications.js | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/shared/components/LayoutCell.js b/ui/src/shared/components/LayoutCell.js index 0949390fa3..125aa3f280 100644 --- a/ui/src/shared/components/LayoutCell.js +++ b/ui/src/shared/components/LayoutCell.js @@ -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) } } diff --git a/ui/src/shared/copy/notifications.js b/ui/src/shared/copy/notifications.js index 2fa7ddb5ac..bb3409555c 100644 --- a/ui/src/shared/copy/notifications.js +++ b/ui/src/shared/copy/notifications.js @@ -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 = () => ({