diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx index ab78895a17792..dff549cf56f1c 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx @@ -59,6 +59,7 @@ import { AlertsReportsConfig, } from 'src/features/alerts/types'; import { useSelector } from 'react-redux'; +import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes'; import { AlertReportCronScheduler } from './components/AlertReportCronScheduler'; import { NotificationMethod } from './components/NotificationMethod'; @@ -449,6 +450,9 @@ const AlertReportModal: FunctionComponent = ({ isReport = false, addSuccessToast, }) => { + const currentUser = useSelector( + state => state.user, + ); const conf = useCommonConf(); const allowedNotificationMethods: NotificationMethodOption[] = conf?.ALERT_REPORTS_NOTIFICATION_METHODS || DEFAULT_NOTIFICATION_METHODS; @@ -1011,7 +1015,17 @@ const AlertReportModal: FunctionComponent = ({ !isEditMode && (!currentAlert || currentAlert.id || (isHidden && show)) ) { - setCurrentAlert({ ...defaultAlert }); + setCurrentAlert({ + ...defaultAlert, + owners: currentUser + ? [ + { + value: currentUser.userId, + label: `${currentUser.firstName} ${currentUser.lastName}`, + }, + ] + : [], + }); setNotificationSettings([]); setNotificationAddState('active'); }