From 3fc4270374442625d1979bdb5b99c9d7eb4e6afc Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Thu, 7 Apr 2022 18:45:35 -0700 Subject: [PATCH] feat: add success toast to alerts and reports (#19482) * feat: add success toast to alerts and reports * remove console * add suggestions --- superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx index cad1eb72a9455..fb37f47c69b06 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx @@ -73,6 +73,7 @@ type SelectValue = { }; interface AlertReportModalProps { + addSuccessToast: (msg: string) => void; addDangerToast: (msg: string) => void; alert?: AlertObject | null; isReport?: boolean; @@ -402,6 +403,7 @@ const AlertReportModal: FunctionComponent = ({ show, alert = null, isReport = false, + addSuccessToast, }) => { const conf = useCommonConf(); const allowedNotificationMethods: NotificationMethodOption[] = @@ -555,6 +557,8 @@ const AlertReportModal: FunctionComponent = ({ return; } + addSuccessToast(t(`${data.type} updated`)); + if (onAdd) { onAdd(); } @@ -569,6 +573,8 @@ const AlertReportModal: FunctionComponent = ({ return; } + addSuccessToast(t(`${data.type} updated`)); + if (onAdd) { onAdd(response); }