mirror of
https://github.com/apache/superset.git
synced 2026-05-30 04:39:20 +00:00
fix(plugin-chart-table): Include time control (#23533)
This commit is contained in:
committed by
GitHub
parent
bd0609df58
commit
13ffb4b7c2
@@ -29,8 +29,11 @@ import { Dispatch } from 'redux';
|
||||
import {
|
||||
ensureIsArray,
|
||||
getCategoricalSchemeRegistry,
|
||||
getColumnLabel,
|
||||
getSequentialSchemeRegistry,
|
||||
hasGenericChartAxes,
|
||||
NO_TIME_RANGE,
|
||||
QueryFormColumn,
|
||||
} from '@superset-ui/core';
|
||||
import {
|
||||
getFormDataFromControls,
|
||||
@@ -73,6 +76,23 @@ export const hydrateExplore =
|
||||
initialFormData.time_range =
|
||||
common?.conf?.DEFAULT_TIME_FILTER || NO_TIME_RANGE;
|
||||
}
|
||||
if (
|
||||
hasGenericChartAxes &&
|
||||
initialFormData.include_time &&
|
||||
initialFormData.granularity_sqla &&
|
||||
!initialFormData.groupby?.some(
|
||||
(col: QueryFormColumn) =>
|
||||
getColumnLabel(col) ===
|
||||
getColumnLabel(initialFormData.granularity_sqla!),
|
||||
)
|
||||
) {
|
||||
initialFormData.groupby = [
|
||||
initialFormData.granularity_sqla,
|
||||
...ensureIsArray(initialFormData.groupby),
|
||||
];
|
||||
initialFormData.granularity_sqla = undefined;
|
||||
}
|
||||
|
||||
if (dashboardId) {
|
||||
initialFormData.dashboardId = dashboardId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user