From ee378122de8a97721c5b715238755ade01b4b7cb Mon Sep 17 00:00:00 2001 From: yougyoung94 Date: Thu, 14 Oct 2021 17:50:55 +0900 Subject: [PATCH 1/2] fix: auto refresh interval won't be updated --- .../src/dashboard/components/Header/index.jsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index c7c9d1aaa5f8..866bbcde96f6 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -182,6 +182,25 @@ class Header extends React.PureComponent { } } + componentDidUpdate(prevProps) { + if (this.props.refreshFrequency !== prevProps.refreshFrequency) { + const { refreshFrequency } = this.props; + this.startPeriodicRender(refreshFrequency * 1000); + } + if (this.props.dashboardInfo.id !== prevProps.dashboardInfo.id) { + const { dashboardInfo, user } = this.props; + if (user && isFeatureEnabled(FeatureFlag.ALERT_REPORTS)) { + // this is in case there is an anonymous user. + this.props.fetchUISpecificReport( + user.userId, + 'dashboard_id', + 'dashboards', + dashboardInfo.id, + ); + } + } + } + UNSAFE_componentWillReceiveProps(nextProps) { const { user } = this.props; if ( From 64dc493f04a04b2be8d3fef7ae47428f4e03ffa9 Mon Sep 17 00:00:00 2001 From: yougyoung94 Date: Thu, 21 Oct 2021 21:51:23 +0900 Subject: [PATCH 2/2] leave only cirtical changes --- .../src/dashboard/components/Header/index.jsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index 866bbcde96f6..b08072e6192d 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -187,18 +187,6 @@ class Header extends React.PureComponent { const { refreshFrequency } = this.props; this.startPeriodicRender(refreshFrequency * 1000); } - if (this.props.dashboardInfo.id !== prevProps.dashboardInfo.id) { - const { dashboardInfo, user } = this.props; - if (user && isFeatureEnabled(FeatureFlag.ALERT_REPORTS)) { - // this is in case there is an anonymous user. - this.props.fetchUISpecificReport( - user.userId, - 'dashboard_id', - 'dashboards', - dashboardInfo.id, - ); - } - } } UNSAFE_componentWillReceiveProps(nextProps) {