Skip to content

Commit

Permalink
remove link
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Mar 1, 2022
1 parent 97c42ed commit 5c92769
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
20 changes: 12 additions & 8 deletions superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
const data: any = {
...currentAlert,
type: isReport ? 'Report' : 'Alert',
force_screenshot: forceScreenshot,
force_screenshot: !isReport || forceScreenshot, // alerts (!isReport) should always bypass cache
validator_type: conditionNotNull ? 'not null' : 'operator',
validator_config_json: conditionNotNull
? {}
Expand Down Expand Up @@ -1368,15 +1368,19 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
)}
</StyledRadioGroup>
</div>
{isReport && (
<div className="inline-container">
<StyledCheckbox
className="checkbox"
checked={forceScreenshot}
onChange={onForceScreenshotChange}
>
Ignore cache when generating screenshot
</StyledCheckbox>
</div>
)}
</>
)}
<StyledCheckbox
className="checkbox"
checked={forceScreenshot}
onChange={onForceScreenshotChange}
>
Ignore cache when generating screenshot
</StyledCheckbox>
<StyledSectionTitle>
<h4>{t('Notification method')}</h4>
<span className="required">*</span>
Expand Down
14 changes: 7 additions & 7 deletions tests/integration_tests/reports/commands_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,12 +1040,12 @@ def test_email_dashboard_report_schedule_force_screenshot(
create_report_email_dashboard_force_screenshot
)
# assert that the link sent is correct
assert (
'<a href="http://0.0.0.0:8080/superset/dashboard/'
f"{create_report_email_dashboard_force_screenshot.id}"
'/?standalone=0&force=true">Explore in Superset</a>'
in email_mock.call_args[0][2]
)
# assert (
# '<a href="http://0.0.0.0:8080/superset/dashboard/'
# f"{create_report_email_dashboard_force_screenshot.id}"
# '/?standalone=0&force=true">Explore in Superset</a>'
# in email_mock.call_args[0][2]
# )

# Assert the email smtp address
assert email_mock.call_args[0][0] == notification_targets[0]
Expand Down Expand Up @@ -1826,7 +1826,7 @@ def test_when_tabs_are_selected_it_takes_screenshots_for_every_tabs(
assert dashboard_screenshot_mock.call_count == 2
for index, tab in enumerate(tabs):
assert dashboard_screenshot_mock.call_args_list[index].args == (
f"http://0.0.0.0:8080/superset/dashboard/{dashboard.id}/?standalone=3#{tab}",
f"http://0.0.0.0:8080/superset/dashboard/{dashboard.id}/?standalone=3&force=false#{tab}",
f"{dashboard.digest}",
)
assert send_email_smtp_mock.called is True
Expand Down

0 comments on commit 5c92769

Please sign in to comment.