mirror of
https://github.com/apache/superset.git
synced 2026-06-08 17:19:20 +00:00
feat(explore): Don't discard controls with custom sql when changing datasource (#20934)
This commit is contained in:
committed by
GitHub
parent
ec20c0104e
commit
cddc361adc
@@ -21,9 +21,9 @@ import { ControlState, Dataset, Metric } from '@superset-ui/chart-controls';
|
||||
import {
|
||||
Column,
|
||||
isAdhocMetricSimple,
|
||||
isAdhocMetricSQL,
|
||||
isSavedMetric,
|
||||
isSimpleAdhocFilter,
|
||||
isFreeFormAdhocFilter,
|
||||
JsonValue,
|
||||
SimpleAdhocFilter,
|
||||
} from '@superset-ui/core';
|
||||
@@ -72,7 +72,10 @@ const isControlValueCompatibleWithDatasource = (
|
||||
column.column_name === (value as SimpleAdhocFilter).subject,
|
||||
);
|
||||
}
|
||||
if (isFreeFormAdhocFilter(value)) return true;
|
||||
if (isAdhocMetricSQL(value)) {
|
||||
Object.assign(value, { datasourceWarning: true });
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user