parent
51472e9035
commit
7c80cf58eb
|
|
@ -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', () => {
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -177,11 +177,13 @@ class HeaderActionsDropdown extends React.PureComponent {
|
|||
<MenuItem onClick={forceRefreshAllCharts} disabled={isLoading}>
|
||||
{t('Force refresh dashboard')}
|
||||
</MenuItem>
|
||||
<RefreshIntervalModal
|
||||
refreshFrequency={refreshFrequency}
|
||||
onChange={this.changeRefreshInterval}
|
||||
triggerNode={<span>{t('Set auto-refresh interval')}</span>}
|
||||
/>
|
||||
{editMode && (
|
||||
<RefreshIntervalModal
|
||||
refreshFrequency={refreshFrequency}
|
||||
onChange={this.changeRefreshInterval}
|
||||
triggerNode={<span>{t('Set auto-refresh interval')}</span>}
|
||||
/>
|
||||
)}
|
||||
{editMode && (
|
||||
<MenuItem target="_blank" href={`/dashboard/edit/${dashboardId}`}>
|
||||
{t('Edit dashboard metadata')}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue