From commits-return-2528-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Tue Apr 9 18:22:36 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9B184180629 for ; Tue, 9 Apr 2019 20:22:36 +0200 (CEST) Received: (qmail 74794 invoked by uid 500); 9 Apr 2019 18:02:58 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 74785 invoked by uid 99); 9 Apr 2019 18:02:58 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2019 18:02:58 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id A3A4A80B27; Tue, 9 Apr 2019 18:22:35 +0000 (UTC) Date: Tue, 09 Apr 2019 18:22:35 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch lyftga updated: Fix refresh frequency (#7248) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155483415519.4651.1570744773524160815@gitbox.apache.org> From: beto@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/lyftga X-Git-Reftype: branch X-Git-Oldrev: 51472e9035ec293d7c7430955ac5b4a16836104c X-Git-Newrev: 7c80cf58ebed008e17cb1a9e69142c4d43f11d31 X-Git-Rev: 7c80cf58ebed008e17cb1a9e69142c4d43f11d31 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. beto pushed a commit to branch lyftga in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/lyftga by this push: new 7c80cf5 Fix refresh frequency (#7248) 7c80cf5 is described below commit 7c80cf58ebed008e17cb1a9e69142c4d43f11d31 Author: Beto Dealmeida AuthorDate: Tue Apr 9 11:22:28 2019 -0700 Fix refresh frequency (#7248) * Fix refresh frequency * Fix unit tests --- .../dashboard/components/HeaderActionsDropdown_spec.jsx | 8 ++++---- superset/assets/src/dashboard/components/Header.jsx | 2 ++ .../src/dashboard/components/HeaderActionsDropdown.jsx | 12 +++++++----- superset/assets/src/dashboard/reducers/dashboardState.js | 6 +++++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/superset/assets/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx b/superset/assets/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx index cd1c015..f89c9ed 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 366efbe..92d3b1d 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 5fc9d0e..5aa468b 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 007f63a..830e2a7 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, + }; }, };