Skip to content

Commit

Permalink
feat: add success toast to alerts and reports (#19482)
Browse files Browse the repository at this point in the history
* feat: add success toast to alerts and reports

* remove console

* add suggestions
  • Loading branch information
pkdotson authored Apr 8, 2022
1 parent d511e4f commit 44e3103
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ type SelectValue = {
};

interface AlertReportModalProps {
addSuccessToast: (msg: string) => void;
addDangerToast: (msg: string) => void;
alert?: AlertObject | null;
isReport?: boolean;
Expand Down Expand Up @@ -402,6 +403,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
show,
alert = null,
isReport = false,
addSuccessToast,
}) => {
const conf = useCommonConf();
const allowedNotificationMethods: NotificationMethodOption[] =
Expand Down Expand Up @@ -555,6 +557,8 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
return;
}

addSuccessToast(t(`${data.type} updated`));

if (onAdd) {
onAdd();
}
Expand All @@ -569,6 +573,8 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
return;
}

addSuccessToast(t(`${data.type} updated`));

if (onAdd) {
onAdd(response);
}
Expand Down

0 comments on commit 44e3103

Please sign in to comment.