Skip to content

Commit

Permalink
feat: add success toast to alerts and reports (apache#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 and philipher29 committed Jun 9, 2022
1 parent a74e87c commit 3fc4270
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 3fc4270

Please sign in to comment.