mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
refactor: Removes the deprecated GENERIC_CHART_AXES feature flag (#26372)
This commit is contained in:
committed by
GitHub
parent
d8f7e2ce5e
commit
8a2f7d378a
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user