refactor: Removes the deprecated GENERIC_CHART_AXES feature flag (#26372)

This commit is contained in:
Michael S. Molina
2024-01-31 09:45:57 -05:00
committed by GitHub
parent d8f7e2ce5e
commit 8a2f7d378a
99 changed files with 363 additions and 1115 deletions

View File

@@ -22,7 +22,6 @@ import {
ChartDataResponseResult,
ensureIsArray,
GenericDataType,
hasGenericChartAxes,
isAdhocColumn,
isPhysicalColumn,
QueryFormColumn,
@@ -38,7 +37,6 @@ import {
ControlStateMapping,
D3_TIME_FORMAT_OPTIONS,
QueryModeLabel,
sections,
sharedControls,
ControlPanelState,
ControlState,
@@ -147,7 +145,6 @@ const percentMetricsControl: typeof sharedControls.metrics = {
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
{
label: t('Query'),
expanded: true,
@@ -189,35 +186,33 @@ const config: ControlPanelConfig = {
},
],
[
hasGenericChartAxes
? {
name: 'time_grain_sqla',
config: {
...sharedControls.time_grain_sqla,
visibility: ({ controls }) => {
const dttmLookup = Object.fromEntries(
ensureIsArray(controls?.groupby?.options).map(option => [
option.column_name,
option.is_dttm,
]),
);
{
name: 'time_grain_sqla',
config: {
...sharedControls.time_grain_sqla,
visibility: ({ controls }) => {
const dttmLookup = Object.fromEntries(
ensureIsArray(controls?.groupby?.options).map(option => [
option.column_name,
option.is_dttm,
]),
);
return ensureIsArray(controls?.groupby.value)
.map(selection => {
if (isAdhocColumn(selection)) {
return true;
}
if (isPhysicalColumn(selection)) {
return !!dttmLookup[selection];
}
return false;
})
.some(Boolean);
},
},
}
: null,
hasGenericChartAxes ? 'temporal_columns_lookup' : null,
return ensureIsArray(controls?.groupby.value)
.map(selection => {
if (isAdhocColumn(selection)) {
return true;
}
if (isPhysicalColumn(selection)) {
return !!dttmLookup[selection];
}
return false;
})
.some(Boolean);
},
},
},
'temporal_columns_lookup',
],
[
{
@@ -324,23 +319,6 @@ const config: ControlPanelConfig = {
},
},
],
!hasGenericChartAxes
? [
{
name: 'include_time',
config: {
type: 'CheckboxControl',
label: t('Include time'),
description: t(
'Whether to include the time granularity as defined in the time section',
),
default: false,
visibility: isAggMode,
resetOnHide: false,
},
},
]
: [null],
[
{
name: 'order_desc',