diff --git a/superset/assets/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx b/superset/assets/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx index cd1c0156c..f89c9ed94 100644 --- a/superset/assets/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx +++ b/superset/assets/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx @@ -71,9 +71,9 @@ describe('HeaderActionsDropdown', () => { expect(wrapper.find(MenuItem)).toHaveLength(1); }); - it('should render the RefreshIntervalModal', () => { + it('should not render the RefreshIntervalModal', () => { const wrapper = setup(overrideProps); - expect(wrapper.find(RefreshIntervalModal)).toHaveLength(1); + expect(wrapper.find(RefreshIntervalModal)).toHaveLength(0); }); it('should render the URLShortLinkModal', () => { @@ -105,9 +105,9 @@ describe('HeaderActionsDropdown', () => { expect(wrapper.find(MenuItem)).toHaveLength(2); }); - it('should render the RefreshIntervalModal', () => { + it('should not render the RefreshIntervalModal', () => { const wrapper = setup(overrideProps); - expect(wrapper.find(RefreshIntervalModal)).toHaveLength(1); + expect(wrapper.find(RefreshIntervalModal)).toHaveLength(0); }); it('should render the URLShortLinkModal', () => { diff --git a/superset/assets/src/dashboard/components/Header.jsx b/superset/assets/src/dashboard/components/Header.jsx index 366efbe3d..92d3b1df6 100644 --- a/superset/assets/src/dashboard/components/Header.jsx +++ b/superset/assets/src/dashboard/components/Header.jsx @@ -215,6 +215,7 @@ class Header extends React.PureComponent { colorScheme, filters, dashboardInfo, + refreshFrequency, } = this.props; const scale = CategoricalColorNamespace.getScale( @@ -231,6 +232,7 @@ class Header extends React.PureComponent { label_colors: labelColors, dashboard_title: dashboardTitle, default_filters: safeStringify(filters), + refresh_frequency: refreshFrequency, }; // make sure positions data less than DB storage limitation: diff --git a/superset/assets/src/dashboard/components/HeaderActionsDropdown.jsx b/superset/assets/src/dashboard/components/HeaderActionsDropdown.jsx index 5fc9d0ede..5aa468b74 100644 --- a/superset/assets/src/dashboard/components/HeaderActionsDropdown.jsx +++ b/superset/assets/src/dashboard/components/HeaderActionsDropdown.jsx @@ -177,11 +177,13 @@ class HeaderActionsDropdown extends React.PureComponent { {t('Force refresh dashboard')} - {t('Set auto-refresh interval')}} - /> + {editMode && ( + {t('Set auto-refresh interval')}} + /> + )} {editMode && ( {t('Edit dashboard metadata')} diff --git a/superset/assets/src/dashboard/reducers/dashboardState.js b/superset/assets/src/dashboard/reducers/dashboardState.js index 007f63a28..830e2a751 100644 --- a/superset/assets/src/dashboard/reducers/dashboardState.js +++ b/superset/assets/src/dashboard/reducers/dashboardState.js @@ -162,7 +162,11 @@ export default function dashboardStateReducer(state = {}, action) { return { ...state, hasUnsavedChanges }; }, [SET_REFRESH_FREQUENCY]() { - return { ...state, refreshFrequency: action.refreshFrequency }; + return { + ...state, + refreshFrequency: action.refreshFrequency, + hasUnsavedChanges: true, + }; }, };