From 484bea9b8026158fda616d97e55a466210014b9e Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Mon, 30 Aug 2021 09:54:26 -0700 Subject: [PATCH 1/3] initial fix --- superset-frontend/src/chart/Chart.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/chart/Chart.jsx b/superset-frontend/src/chart/Chart.jsx index d66dd86b15e05..ec917167e11c0 100644 --- a/superset-frontend/src/chart/Chart.jsx +++ b/superset-frontend/src/chart/Chart.jsx @@ -178,7 +178,12 @@ class Chart extends React.PureComponent { const message = chartAlert || queryResponse?.message; // if datasource is still loading, don't render JS errors - if (chartAlert && datasource === PLACEHOLDER_DATASOURCE) { + if ( + chartAlert !== undefined && + chartAlert !== + 'The dataset associated with this chart no longer exists' && + datasource === PLACEHOLDER_DATASOURCE + ) { return ( Date: Mon, 30 Aug 2021 14:01:53 -0700 Subject: [PATCH 2/3] add const --- superset-frontend/src/chart/Chart.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/chart/Chart.jsx b/superset-frontend/src/chart/Chart.jsx index ec917167e11c0..e5a1021e6bfb5 100644 --- a/superset-frontend/src/chart/Chart.jsx +++ b/superset-frontend/src/chart/Chart.jsx @@ -68,6 +68,8 @@ const propTypes = { }; const BLANK = {}; +const NONEXISTENT_DATASET = + 'The dataset associated with this chart no longer exists'; const defaultProps = { addFilter: () => BLANK, @@ -180,8 +182,7 @@ class Chart extends React.PureComponent { // if datasource is still loading, don't render JS errors if ( chartAlert !== undefined && - chartAlert !== - 'The dataset associated with this chart no longer exists' && + chartAlert !== NONEXISTENT_DATASET && datasource === PLACEHOLDER_DATASOURCE ) { return ( From 05f6565dd485f3f7ca399dc3fc4b3403f206d6e5 Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Mon, 30 Aug 2021 15:36:56 -0700 Subject: [PATCH 3/3] add translate --- superset-frontend/src/chart/Chart.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/chart/Chart.jsx b/superset-frontend/src/chart/Chart.jsx index e5a1021e6bfb5..e5cfd72585ed2 100644 --- a/superset-frontend/src/chart/Chart.jsx +++ b/superset-frontend/src/chart/Chart.jsx @@ -68,8 +68,9 @@ const propTypes = { }; const BLANK = {}; -const NONEXISTENT_DATASET = - 'The dataset associated with this chart no longer exists'; +const NONEXISTENT_DATASET = t( + 'The dataset associated with this chart no longer exists', +); const defaultProps = { addFilter: () => BLANK,