diff --git a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx index 4e2d288021..26a2df4aba 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx @@ -611,11 +611,9 @@ const AlertReportModal: FunctionComponent = ({ validator_config_json: conditionNotNull ? {} : currentAlert?.validator_config_json, - chart: contentType === 'chart' ? currentAlert?.chart?.value : undefined, + chart: contentType === 'chart' ? currentAlert?.chart?.value : null, dashboard: - contentType === 'dashboard' - ? currentAlert?.dashboard?.value - : undefined, + contentType === 'dashboard' ? currentAlert?.dashboard?.value : null, database: currentAlert?.database?.value, owners: (currentAlert?.owners || []).map( owner => (owner as MetaObject).value, @@ -869,10 +867,12 @@ const AlertReportModal: FunctionComponent = ({ const onDashboardChange = (dashboard: SelectValue) => { updateAlertState('dashboard', dashboard || undefined); + updateAlertState('chart', null); }; const onChartChange = (chart: SelectValue) => { updateAlertState('chart', chart || undefined); + updateAlertState('dashboard', null); }; const onActiveSwitch = (checked: boolean) => { diff --git a/superset/reports/schemas.py b/superset/reports/schemas.py index fe9a2fbe7c..94c99b6180 100644 --- a/superset/reports/schemas.py +++ b/superset/reports/schemas.py @@ -220,8 +220,8 @@ class ReportSchedulePutSchema(Schema): required=False, allow_none=True, ) - chart = fields.Integer(required=False) - dashboard = fields.Integer(required=False) + chart = fields.Integer(required=False, allow_none=True) + dashboard = fields.Integer(required=False, allow_none=True) database = fields.Integer(required=False) owners = fields.List(fields.Integer(description=owners_description), required=False) validator_type = fields.String(