mirror of https://github.com/apache/superset.git
fix: stop endless loading when dataset no longer exist (#16511)
* initial fix * add const * add translate
This commit is contained in:
parent
2199f65373
commit
960d1e4d5d
|
@ -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 (
|
||||
<Styles
|
||||
data-ui-anchor="chart"
|
||||
|
|
Loading…
Reference in New Issue