mirror of
https://github.com/apache/superset.git
synced 2024-09-18 11:39:49 -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
|
validator_config_json: conditionNotNull
|
||||||
? {}
|
? {}
|
||||||
: currentAlert?.validator_config_json,
|
: currentAlert?.validator_config_json,
|
||||||
chart: contentType === 'chart' ? currentAlert?.chart?.value : undefined,
|
chart: contentType === 'chart' ? currentAlert?.chart?.value : null,
|
||||||
dashboard:
|
dashboard:
|
||||||
contentType === 'dashboard'
|
contentType === 'dashboard' ? currentAlert?.dashboard?.value : null,
|
||||||
? currentAlert?.dashboard?.value
|
|
||||||
: undefined,
|
|
||||||
database: currentAlert?.database?.value,
|
database: currentAlert?.database?.value,
|
||||||
owners: (currentAlert?.owners || []).map(
|
owners: (currentAlert?.owners || []).map(
|
||||||
owner => (owner as MetaObject).value,
|
owner => (owner as MetaObject).value,
|
||||||
@ -869,10 +867,12 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
|
|||||||
|
|
||||||
const onDashboardChange = (dashboard: SelectValue) => {
|
const onDashboardChange = (dashboard: SelectValue) => {
|
||||||
updateAlertState('dashboard', dashboard || undefined);
|
updateAlertState('dashboard', dashboard || undefined);
|
||||||
|
updateAlertState('chart', null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChartChange = (chart: SelectValue) => {
|
const onChartChange = (chart: SelectValue) => {
|
||||||
updateAlertState('chart', chart || undefined);
|
updateAlertState('chart', chart || undefined);
|
||||||
|
updateAlertState('dashboard', null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onActiveSwitch = (checked: boolean) => {
|
const onActiveSwitch = (checked: boolean) => {
|
||||||
|
@ -220,8 +220,8 @@ class ReportSchedulePutSchema(Schema):
|
|||||||
required=False,
|
required=False,
|
||||||
allow_none=True,
|
allow_none=True,
|
||||||
)
|
)
|
||||||
chart = fields.Integer(required=False)
|
chart = fields.Integer(required=False, allow_none=True)
|
||||||
dashboard = fields.Integer(required=False)
|
dashboard = fields.Integer(required=False, allow_none=True)
|
||||||
database = fields.Integer(required=False)
|
database = fields.Integer(required=False)
|
||||||
owners = fields.List(fields.Integer(description=owners_description), required=False)
|
owners = fields.List(fields.Integer(description=owners_description), required=False)
|
||||||
validator_type = fields.String(
|
validator_type = fields.String(
|
||||||
|
Loading…
Reference in New Issue
Block a user