Skip to content

Commit

Permalink
fix: stop endless loading when dataset no longer exist (apache#16511)
Browse files Browse the repository at this point in the history
* initial fix

* add const

* add translate
  • Loading branch information
pkdotson authored Aug 30, 2021
1 parent 6e83b07 commit 43dd15b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion superset-frontend/src/chart/Chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 (
<Styles
data-ui-anchor="chart"
Expand Down

0 comments on commit 43dd15b

Please sign in to comment.