mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat(ag-grid-table): Enable Time Shift feature for AG Grid Table (#37072)
This commit is contained in:
@@ -25,12 +25,10 @@ import {
|
||||
DataRecord,
|
||||
ensureIsArray,
|
||||
extractTimegrain,
|
||||
FeatureFlag,
|
||||
getMetricLabel,
|
||||
getNumberFormatter,
|
||||
getTimeFormatter,
|
||||
getTimeFormatterForGranularity,
|
||||
isFeatureEnabled,
|
||||
NumberFormats,
|
||||
QueryMode,
|
||||
SMART_DATE_ID,
|
||||
@@ -38,7 +36,7 @@ import {
|
||||
TimeFormatter,
|
||||
} from '@superset-ui/core';
|
||||
import { GenericDataType } from '@apache-superset/core/api/core';
|
||||
import { isEmpty, isEqual } from 'lodash';
|
||||
import { isEmpty, isEqual, merge } from 'lodash';
|
||||
import {
|
||||
ConditionalFormattingConfig,
|
||||
getColorFormatters,
|
||||
@@ -465,7 +463,7 @@ const transformProps = (
|
||||
const {
|
||||
height,
|
||||
width,
|
||||
rawFormData: formData,
|
||||
rawFormData: originalFormData,
|
||||
queriesData = [],
|
||||
ownState: serverPaginationData,
|
||||
filterState,
|
||||
@@ -474,6 +472,15 @@ const transformProps = (
|
||||
theme,
|
||||
} = chartProps;
|
||||
|
||||
// Merge extra_form_data (dashboard filter overrides) into formData
|
||||
// This ensures dashboard-level settings (like time_compare) override chart-level settings
|
||||
// From PRs #33947 and #34014
|
||||
const formData = merge(
|
||||
{},
|
||||
originalFormData,
|
||||
originalFormData.extra_form_data,
|
||||
);
|
||||
|
||||
const {
|
||||
include_search: includeSearch = false,
|
||||
page_length: pageLength,
|
||||
@@ -499,8 +506,7 @@ const transformProps = (
|
||||
const isUsingTimeComparison =
|
||||
!isEmpty(time_compare) &&
|
||||
queryMode === QueryMode.Aggregate &&
|
||||
comparison_type === ComparisonType.Values &&
|
||||
isFeatureEnabled(FeatureFlag.TableV2TimeComparisonEnabled);
|
||||
comparison_type === ComparisonType.Values;
|
||||
|
||||
const nonCustomNorInheritShifts = ensureIsArray(formData.time_compare).filter(
|
||||
(shift: string) => shift !== 'custom' && shift !== 'inherit',
|
||||
|
||||
Reference in New Issue
Block a user