mirror of https://github.com/apache/superset.git
fix(generic-x-axis): skip initial time filter for legacy charts (#23506)
This commit is contained in:
parent
0cebe8bf18
commit
8db5cb18c0
|
@ -73,9 +73,11 @@ export const datePickerInAdhocFilterMixin: Pick<
|
|||
initialValue: (control: ControlState, state: ControlPanelState | null) => {
|
||||
// skip initialValue if
|
||||
// 1) GENERIC_CHART_AXES is disabled
|
||||
// 2) there was a time filter in adhoc filters
|
||||
// 2) the time_range control is present (this is the case for legacy charts)
|
||||
// 3) there was a time filter in adhoc filters
|
||||
if (
|
||||
!hasGenericChartAxes ||
|
||||
state?.controls?.time_range?.value ||
|
||||
ensureIsArray(control.value).findIndex(
|
||||
(flt: any) => flt?.operator === 'TEMPORAL_RANGE',
|
||||
) > -1
|
||||
|
|
|
@ -495,7 +495,7 @@ export const ControlPanelsContainer = (props: ControlPanelsContainerProps) => {
|
|||
) => {
|
||||
const isTemporalRange = (filter: Record<string, any>) =>
|
||||
filter.operator === Operators.TEMPORAL_RANGE;
|
||||
if (isTemporalRange(valueToBeDeleted)) {
|
||||
if (!controls?.time_range?.value && isTemporalRange(valueToBeDeleted)) {
|
||||
const count = values.filter(isTemporalRange).length;
|
||||
if (count === 1) {
|
||||
return t(
|
||||
|
|
Loading…
Reference in New Issue