From 44e3103fc9029edd4c7fd1c8402607eecebeb1b3 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 6323edf3a0ca3..7a68b2663fe0e 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); }