mirror of
https://github.com/apache/superset.git
synced 2024-09-16 02:29:39 -04:00
switch message content between chart and dashboard AlertReportModal (#13537)
This commit is contained in:
parent
d1e93078f4
commit
cd2f53ed7b
@ -611,11 +611,9 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
|
||||
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<AlertReportModalProps> = ({
|
||||
|
||||
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) => {
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user