This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new f6155b9e9ea fix(dashboard): show the configured refresh warning
alongside the limit error (#44836)
f6155b9e9ea is described below
commit f6155b9e9ea438986914366807cb7ef8cffa9d60
Author: Joe Li <[email protected]>
AuthorDate: Fri Oct 2 10:28:43 2026 -0700
fix(dashboard): show the configured refresh warning alongside the limit
error (#44836)
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
---
.../components/RefreshIntervalModal.test.tsx | 37 ++++++++++++++++++++++
.../dashboard/components/RefreshIntervalModal.tsx | 2 +-
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git
a/superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx
b/superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx
index 54423d55777..4ddb72f6eee 100644
--- a/superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx
+++ b/superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx
@@ -86,6 +86,43 @@ test('an interval below the configured limit blocks save
with an error', async (
expect(defaultProps.onChange).not.toHaveBeenCalled();
});
+test('an interval below the limit shows the configured warning alongside the
error', async () => {
+ setup(
+ {},
+ {
+ SUPERSET_DASHBOARD_PERIODICAL_REFRESH_LIMIT: 60,
+ SUPERSET_DASHBOARD_PERIODICAL_REFRESH_WARNING_MESSAGE:
+ 'Frequent refreshes put load on the database',
+ },
+ );
+
+ await userEvent.click(screen.getByRole('radio', { name: '10 seconds' }));
+
+ expect(
+ screen.getByText('Refresh frequency must be at least 60 seconds'),
+ ).toBeInTheDocument();
+ expect(
+ screen.getByText('Frequent refreshes put load on the database'),
+ ).toBeInTheDocument();
+});
+
+test('the configured warning is hidden when the interval meets the limit',
async () => {
+ setup(
+ {},
+ {
+ SUPERSET_DASHBOARD_PERIODICAL_REFRESH_LIMIT: 60,
+ SUPERSET_DASHBOARD_PERIODICAL_REFRESH_WARNING_MESSAGE:
+ 'Frequent refreshes put load on the database',
+ },
+ );
+
+ await userEvent.click(screen.getByRole('radio', { name: '5 minutes' }));
+
+ expect(
+ screen.queryByText('Frequent refreshes put load on the database'),
+ ).not.toBeInTheDocument();
+});
+
test('an interval at or above the configured limit does not block save', async
() => {
setup({}, { SUPERSET_DASHBOARD_PERIODICAL_REFRESH_LIMIT: 60 });
diff --git
a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
index a4ec52d7313..47f926946f8 100644
--- a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
+++ b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
@@ -130,7 +130,7 @@ const RefreshIntervalModal = ({
? t('Set the automatic refresh frequency for this dashboard.')
: t('Set refresh frequency for current session only.'))
}
- extra={refreshErrors[0] ? null : refreshWarningMessage}
+ extra={refreshWarningMessage}
validateStatus={refreshErrors.length ? 'error' : undefined}
>
<RefreshFrequencySelect