From 960d1e4d5deb7a050e7f579e4224575880643c2c Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Mon, 30 Aug 2021 16:42:02 -0700 Subject: [PATCH] fix: stop endless loading when dataset no longer exist (#16511) * initial fix * add const * add translate --- superset-frontend/src/chart/Chart.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/chart/Chart.jsx b/superset-frontend/src/chart/Chart.jsx index d66dd86b15..e5cfd72585 100644 --- a/superset-frontend/src/chart/Chart.jsx +++ b/superset-frontend/src/chart/Chart.jsx @@ -68,6 +68,9 @@ const propTypes = { }; const BLANK = {}; +const NONEXISTENT_DATASET = t( + 'The dataset associated with this chart no longer exists', +); const defaultProps = { addFilter: () => BLANK, @@ -178,7 +181,11 @@ 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 !== NONEXISTENT_DATASET && + datasource === PLACEHOLDER_DATASOURCE + ) { return (