Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: new alert should have force_screenshot be true #18182

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,11 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
}
});

const shouldEnableForceScreenshot = contentType === 'chart' && !isReport;
const data: any = {
...currentAlert,
type: isReport ? 'Report' : 'Alert',
force_screenshot: forceScreenshot ? 'true' : 'false',
force_screenshot: shouldEnableForceScreenshot || forceScreenshot,
validator_type: conditionNotNull ? 'not null' : 'operator',
validator_config_json: conditionNotNull
? {}
Expand Down Expand Up @@ -862,6 +863,8 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({

const onContentTypeChange = (event: any) => {
const { target } = event;
// When switch content type, reset force_screenshot to false
setForceScreenshot(false);
// Gives time to close the select before changing the type
setTimeout(() => setContentType(target.value), 200);
};
Expand Down