@gooddata/sdk-ui-dashboard 11.70.0 → 11.71.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +49 -49
- package/esm/__version.d.ts +1 -1
- package/esm/__version.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.d.ts +0 -7
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.d.ts.map +1 -1
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.js +0 -17
- package/esm/_staging/sharedHooks/useDateFiltersTitles.d.ts +2 -2
- package/esm/_staging/sharedHooks/useDateFiltersTitles.d.ts.map +1 -1
- package/esm/_staging/sharedHooks/useDateFiltersTitles.js +7 -5
- package/esm/_staging/sharedHooks/useFiltersNamings.d.ts.map +1 -1
- package/esm/_staging/sharedHooks/useFiltersNamings.js +7 -7
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -2
- package/esm/kdaDialog/composition/KeyDriversPanel.d.ts.map +1 -1
- package/esm/kdaDialog/composition/KeyDriversPanel.js +1 -1
- package/esm/kdaDialog/dialog/KdaDialog.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialog.js +4 -3
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.d.ts +5 -1
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.js +33 -5
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.d.ts +5 -1
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.js +2 -2
- package/esm/kdaDialog/dialog/KdaReplaceConfirmationDialog.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaReplaceConfirmationDialog.js +9 -1
- package/esm/model/commandHandlers/dashboard/changeDashboardDefinitionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDashboardDefinitionHandler.js +5 -5
- package/esm/model/commandHandlers/dashboard/changeDateFilterTitleHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDateFilterTitleHandler.js +8 -6
- package/esm/model/commandHandlers/dashboard/changeDateFilterWithDimensionModeHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDateFilterWithDimensionModeHandler.js +10 -6
- package/esm/model/commandHandlers/dashboard/common/filterViews.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/filterViews.js +22 -12
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.js +6 -6
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +0 -3
- package/esm/model/commandHandlers/drill/crossFilteringHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/crossFilteringHandler.js +1 -0
- package/esm/model/commandHandlers/drill/drillToDashboardHandler.js +1 -0
- package/esm/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.js +28 -54
- package/esm/model/commandHandlers/filterContext/dateFilter/addDateFilterHandler.js +2 -2
- package/esm/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.js +2 -6
- package/esm/model/commandHandlers/filterContext/dateFilter/moveDateFilterHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/moveDateFilterHandler.js +8 -4
- package/esm/model/commandHandlers/filterContext/dateFilter/removeDateFiltersHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/removeDateFiltersHandler.js +21 -17
- package/esm/model/commandHandlers/filterContext/dateFilter/validation/uniqueFiltersValidation.d.ts +2 -2
- package/esm/model/commandHandlers/filterContext/dateFilter/validation/uniqueFiltersValidation.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/validation/uniqueFiltersValidation.js +2 -2
- package/esm/model/commandHandlers/filterContext/filterViewHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/filterViewHandler.js +1 -6
- package/esm/model/commandHandlers/filterContext/removeRestrictedFiltersHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/removeRestrictedFiltersHandler.js +3 -3
- package/esm/model/commandHandlers/filterContext/tabSync/tabSyncRules.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/tabSync/tabSyncRules.js +5 -3
- package/esm/model/commandHandlers/widgets/changeInsightWidgetFilterSettingsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/changeInsightWidgetFilterSettingsHandler.js +2 -2
- package/esm/model/commandHandlers/widgets/changeRichTextWidgetFilterSettingsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/changeRichTextWidgetFilterSettingsHandler.js +2 -2
- package/esm/model/commandHandlers/widgets/common/filterOperations.d.ts +3 -3
- package/esm/model/commandHandlers/widgets/common/filterOperations.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/common/filterOperations.js +14 -14
- package/esm/model/commandHandlers/widgets/common/filterReferences.d.ts +2 -2
- package/esm/model/commandHandlers/widgets/common/filterReferences.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/common/filterReferences.js +1 -1
- package/esm/model/commandHandlers/widgets/validation/filterValidation.d.ts +2 -2
- package/esm/model/commandHandlers/widgets/validation/filterValidation.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/validation/filterValidation.js +4 -4
- package/esm/model/commands/filters.d.ts +1 -2
- package/esm/model/commands/filters.d.ts.map +1 -1
- package/esm/model/events/base.d.ts +1 -1
- package/esm/model/events/base.d.ts.map +1 -1
- package/esm/model/events/filters.d.ts +107 -0
- package/esm/model/events/filters.d.ts.map +1 -1
- package/esm/model/events/filters.js +54 -0
- package/esm/model/events/index.d.ts +2 -2
- package/esm/model/events/index.d.ts.map +1 -1
- package/esm/model/events/insight.d.ts +12 -2
- package/esm/model/events/insight.d.ts.map +1 -1
- package/esm/model/events/insight.js +2 -1
- package/esm/model/events/richText.d.ts +12 -2
- package/esm/model/events/richText.d.ts.map +1 -1
- package/esm/model/events/richText.js +2 -1
- package/esm/model/react/useWidgetFilters.d.ts.map +1 -1
- package/esm/model/react/useWidgetFilters.js +6 -5
- package/esm/model/store/filtering/dashboardFilterSelectors.d.ts.map +1 -1
- package/esm/model/store/filtering/dashboardFilterSelectors.js +20 -39
- package/esm/model/store/insights/insightsSelectors.d.ts.map +1 -1
- package/esm/model/store/insights/insightsSelectors.js +9 -3
- package/esm/model/store/meta/metaSelectors.js +3 -3
- package/esm/model/store/tabs/filterContext/filterContextReducers.d.ts +5 -1
- package/esm/model/store/tabs/filterContext/filterContextReducers.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterContextReducers.js +26 -18
- package/esm/model/store/tabs/filterContext/filterContextSelectors.d.ts +43 -3
- package/esm/model/store/tabs/filterContext/filterContextSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterContextSelectors.js +53 -9
- package/esm/model/store/tabs/filterContext/filterContextUtils.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterContextUtils.js +21 -19
- package/esm/model/store/tabs/filterContext/filterSync.d.ts +7 -0
- package/esm/model/store/tabs/filterContext/filterSync.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterSync.js +30 -42
- package/esm/model/utils/widgetFilters.d.ts.map +1 -1
- package/esm/model/utils/widgetFilters.js +4 -3
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.js +6 -4
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts +2 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.js +43 -7
- package/esm/presentation/automations/shared/hooks/useFiltersNamings.d.ts.map +1 -1
- package/esm/presentation/automations/shared/hooks/useFiltersNamings.js +1 -0
- package/esm/presentation/dragAndDrop/draggableDateFilter/DefaultDateFilterDraggingComponent.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/draggableDateFilter/DefaultDateFilterDraggingComponent.js +3 -2
- package/esm/presentation/dragAndDrop/draggableDateFilter/DraggableDateFilter.d.ts +3 -3
- package/esm/presentation/dragAndDrop/draggableDateFilter/DraggableDateFilter.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/draggableDateFilter/DraggableDateFilter.js +1 -1
- package/esm/presentation/dragAndDrop/draggableFilterDropZone/DraggableFilterDropZoneHint.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/draggableFilterDropZone/DraggableFilterDropZoneHint.js +2 -2
- package/esm/presentation/dragAndDrop/types.d.ts +2 -2
- package/esm/presentation/dragAndDrop/types.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/useFilterDeleteDrop.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/useFilterDeleteDrop.js +2 -2
- package/esm/presentation/filterBar/attributeFilter/AttributeFilterParentFilteringContext.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/AttributeFilterParentFilteringContext.js +3 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFilterConfigurationState.d.ts +15 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFilterConfigurationState.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFilterConfigurationState.js +27 -31
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFiltersConfiguration.d.ts +3 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFiltersConfiguration.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFiltersConfiguration.js +3 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/LimitValuesConfiguration.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/LimitValuesConfiguration.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/AddLimitingItemDialog.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/AddLimitingItemDialog.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/DateFiltersPage.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/DateFiltersPage.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/DateFiltersPage.js +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/ParentFiltersPage.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/ParentFiltersPage.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/shared/limitingItemsHook.d.ts +3 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/shared/limitingItemsHook.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/shared/limitingItemsHook.js +2 -4
- package/esm/presentation/filterBar/attributeFilter/useDependentDateFilters.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/useDependentDateFilters.js +42 -20
- package/esm/presentation/filterBar/filterBar/DefaultFilterBar.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBar.js +3 -3
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js +13 -4
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarItem.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarItem.js +9 -8
- package/esm/presentation/filterBar/filterBar/filterGroupUtils.js +3 -3
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js +13 -2
- package/esm/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.d.ts +3 -3
- package/esm/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.js +9 -9
- package/esm/presentation/filterBar/utils.d.ts.map +1 -1
- package/esm/presentation/filterBar/utils.js +2 -2
- package/esm/presentation/topBar/menuButton/DefaultMenuButton.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/DefaultMenuButton.js +33 -6
- package/esm/presentation/widget/common/configuration/DateDatasetFilter.js +2 -2
- package/esm/presentation/widget/common/configuration/FilterConfiguration.d.ts.map +1 -1
- package/esm/presentation/widget/common/configuration/FilterConfiguration.js +5 -4
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.js +9 -2
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.js +3 -21
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/getDrillDialogInsightDescription.d.ts +6 -0
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/getDrillDialogInsightDescription.d.ts.map +1 -0
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/getDrillDialogInsightDescription.js +24 -0
- package/esm/sdk-ui-dashboard.d.ts +192 -12
- package/package.json +23 -23
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
2
|
import { call, put, select } from "redux-saga/effects";
|
|
3
3
|
import { invariant } from "ts-invariant";
|
|
4
|
-
import { isDashboardDateFilter } from "@gooddata/sdk-model";
|
|
4
|
+
import { areObjRefsEqual, isDashboardDateFilter } from "@gooddata/sdk-model";
|
|
5
5
|
import { dateFilterOfAnyTypeTitleChanged, dateFilterTitleChanged } from "../../events/filters.js";
|
|
6
6
|
import { invalidArgumentsProvided } from "../../events/general.js";
|
|
7
7
|
import { dispatchDashboardEvent } from "../../store/_infra/eventDispatcher.js";
|
|
8
8
|
import { selectDateFilterConfigOverrides } from "../../store/tabs/dateFilterConfig/dateFilterConfigSelectors.js";
|
|
9
9
|
import { selectDateFilterConfigsOverrides } from "../../store/tabs/dateFilterConfigs/dateFilterConfigsSelectors.js";
|
|
10
|
-
import {
|
|
10
|
+
import { selectFilterContextDateFilterOfAnyType, selectFilterContextDateFilterOfAnyTypeByDataSet, } from "../../store/tabs/filterContext/filterContextSelectors.js";
|
|
11
11
|
import { tabsActions } from "../../store/tabs/index.js";
|
|
12
12
|
import { dispatchFilterContextChanged } from "../filterContext/common.js";
|
|
13
13
|
export function* changeDateFilterTitleHandler(ctx, cmd) {
|
|
14
14
|
const { dataSet } = cmd.payload;
|
|
15
15
|
if (dataSet) {
|
|
16
16
|
// validate dataSet
|
|
17
|
-
const affectedFilter = yield select(
|
|
17
|
+
const affectedFilter = yield select(selectFilterContextDateFilterOfAnyTypeByDataSet(dataSet));
|
|
18
18
|
if (!affectedFilter) {
|
|
19
19
|
throw invalidArgumentsProvided(ctx, cmd, `Filter with data set ${dataSet} not found.`);
|
|
20
20
|
}
|
|
21
21
|
yield put(tabsActions.changeDateFilterConfigsTitle(cmd.payload));
|
|
22
|
-
const changedFilter = yield select(
|
|
22
|
+
const changedFilter = yield select(selectFilterContextDateFilterOfAnyTypeByDataSet(dataSet));
|
|
23
23
|
const filterConfigs = yield select(selectDateFilterConfigsOverrides);
|
|
24
|
-
const changedFilterConfig = filterConfigs.find((item) => item.dateDataSet
|
|
24
|
+
const changedFilterConfig = filterConfigs.find((item) => areObjRefsEqual(item.dateDataSet, dataSet));
|
|
25
25
|
invariant(changedFilter, "Inconsistent state in changeDateFilterTitleHandler, cannot update date filter for given data set.");
|
|
26
26
|
invariant(changedFilterConfig, "Inconsistent state in changeDateFilterTitleHandler, cannot update date filter config for given data set.");
|
|
27
|
-
|
|
27
|
+
if (isDashboardDateFilter(changedFilter)) {
|
|
28
|
+
yield dispatchDashboardEvent(dateFilterTitleChanged(ctx, changedFilter, changedFilterConfig.config));
|
|
29
|
+
}
|
|
28
30
|
yield dispatchDashboardEvent(dateFilterOfAnyTypeTitleChanged(ctx, changedFilter, changedFilterConfig.config));
|
|
29
31
|
}
|
|
30
32
|
else {
|
package/esm/model/commandHandlers/dashboard/changeDateFilterWithDimensionModeHandler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeDateFilterWithDimensionModeHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/dashboard/changeDateFilterWithDimensionModeHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"changeDateFilterWithDimensionModeHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/dashboard/changeDateFilterWithDimensionModeHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,KAAK,8CAA8C,EAAE,MAAM,6BAA6B,CAAC;AAOlG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,wBAAiB,wCAAwC,CACrD,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,8CAA8C,GACpD,YAAY,CAAC,IAAI,CAAC,CAsCpB"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
// (C) 2023-2026 GoodData Corporation
|
|
2
2
|
import { call, put, select } from "redux-saga/effects";
|
|
3
3
|
import { invariant } from "ts-invariant";
|
|
4
|
-
import {
|
|
4
|
+
import { areObjRefsEqual, isDashboardDateFilter } from "@gooddata/sdk-model";
|
|
5
|
+
import { dateFilterModeChanged, dateFilterOfAnyTypeModeChanged } from "../../events/filters.js";
|
|
5
6
|
import { invalidArgumentsProvided } from "../../events/general.js";
|
|
6
7
|
import { dispatchDashboardEvent } from "../../store/_infra/eventDispatcher.js";
|
|
7
8
|
import { selectDateFilterConfigsOverrides } from "../../store/tabs/dateFilterConfigs/dateFilterConfigsSelectors.js";
|
|
8
|
-
import {
|
|
9
|
+
import { selectFilterContextDateFilterOfAnyTypeByDataSet } from "../../store/tabs/filterContext/filterContextSelectors.js";
|
|
9
10
|
import { tabsActions } from "../../store/tabs/index.js";
|
|
10
11
|
import { dispatchFilterContextChanged } from "../filterContext/common.js";
|
|
11
12
|
export function* changeDateFilterWithDimensionModeHandler(ctx, cmd) {
|
|
12
13
|
const { dataSet } = cmd.payload;
|
|
13
14
|
// validate dataSet
|
|
14
|
-
const affectedFilter = yield select(
|
|
15
|
+
const affectedFilter = yield select(selectFilterContextDateFilterOfAnyTypeByDataSet(dataSet));
|
|
15
16
|
if (!affectedFilter) {
|
|
16
17
|
throw invalidArgumentsProvided(ctx, cmd, `Filter with data set ${dataSet} not found.`);
|
|
17
18
|
}
|
|
18
19
|
yield put(tabsActions.changeDateFilterConfigsMode(cmd.payload));
|
|
19
|
-
const changedFilter = yield select(
|
|
20
|
+
const changedFilter = yield select(selectFilterContextDateFilterOfAnyTypeByDataSet(dataSet));
|
|
20
21
|
const filterConfigs = yield select(selectDateFilterConfigsOverrides);
|
|
21
|
-
const changedFilterConfig = filterConfigs.find((item) => item.dateDataSet
|
|
22
|
+
const changedFilterConfig = filterConfigs.find((item) => areObjRefsEqual(item.dateDataSet, dataSet));
|
|
22
23
|
invariant(changedFilter, "Inconsistent state in changeDateModeHandler, cannot update date filter for given data set.");
|
|
23
24
|
invariant(changedFilterConfig, "Inconsistent state in changeDateModeHandler, cannot update date filter config for given data set.");
|
|
24
|
-
|
|
25
|
+
if (isDashboardDateFilter(changedFilter)) {
|
|
26
|
+
yield dispatchDashboardEvent(dateFilterModeChanged(ctx, changedFilter, changedFilterConfig.config));
|
|
27
|
+
}
|
|
28
|
+
yield dispatchDashboardEvent(dateFilterOfAnyTypeModeChanged(ctx, changedFilter, changedFilterConfig.config));
|
|
25
29
|
yield call(dispatchFilterContextChanged, ctx, cmd);
|
|
26
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterViews.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/common/filterViews.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACtC,MAAM,2BAA2B,CAAC;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"filterViews.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/common/filterViews.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACtC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAIH,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAGf,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EAGzB,KAAK,cAAc,EACnB,KAAK,MAAM,EA0Bd,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAmQvD,KAAK,oBAAoB,GAAG;IAAE,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAkBnE,UAAU,6BAA6B;IACnC,aAAa,EAAE,cAAc,CAAC;IAC9B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,4BAA4B,kBACtB,cAAc,qBACV,iBAAiB,EAAE,8BACV,WAAW,CAAC,MAAM,CAAC,2BACtB,+BAA+B,EAAE,KAC3D,6BAmLF,CAAC;AAIF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C;;;OAGG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAClE;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAC/C,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,oBAAoB,EAAE,EACnC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,8BAA8B,GACxC,OAAO,CAUT;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,oBAAoB,EAAE,EACnC,kBAAkB,EAAE,MAAM,EAC1B,UAAU,EAAE,OAAO,GACpB,oBAAoB,GAAG,SAAS,CAQlC;AAiBD;;;;GAIG;AACH,wBAAgB,mCAAmC,CAC/C,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,oBAAoB,EAAE,EACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,kBAAkB,EAAE,aAAa,CAAC,8BAA8B,CAAC,EACjE,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,8BAA8B,GACzC,UAAU,CAIZ;AAED,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,oBAAoB,EAAE,EACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,kBAAkB,EAAE,aAAa,CAAC,8BAA8B,CAAC,EACjE,OAAO,GAAE,8BAAmC,GAC7C,UAAU,CAuDZ"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
|
-
import { areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemFilterElementsBy, dashboardAttributeFilterItemFilterElementsByDate, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemTitle, dashboardAttributeFilterItemValidateElementsBy, dashboardFilterLocalIdentifier, dashboardMeasureValueFilterLocalIdentifier, isDashboardAbsoluteGranularityDateFilter, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilterOfAnyType, isDashboardDateFilter, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, isDashboardTextAttributeFilter, isExportOverrideFilterContext, isFilterContext, isSingleSelectionFilter, } from "@gooddata/sdk-model";
|
|
2
|
+
import { areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemFilterElementsBy, dashboardAttributeFilterItemFilterElementsByDate, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemTitle, dashboardAttributeFilterItemValidateElementsBy, dashboardFilterLocalIdentifier, dashboardFilterObjRef, dashboardMeasureValueFilterLocalIdentifier, isDashboardAbsoluteGranularityDateFilter, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilterOfAnyType, isDashboardDateFilter, isDashboardDateFilterOfAnyType, isDashboardDateFilterWithDimensionOfAnyType, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, isDashboardTextAttributeFilter, isExportOverrideFilterContext, isFilterContext, isSingleSelectionFilter, newAllTimeDashboardDateFilter, } from "@gooddata/sdk-model";
|
|
3
3
|
import { _isEqual, _omit } from "@gooddata/util";
|
|
4
|
-
import { ABSOLUTE_GRANULARITY_DATE_FILTER_WITH_DATA_SET_NOT_SUPPORTED, containsAbsoluteGranularityDateFilterWithDataSet, } from "../../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
5
4
|
import { PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED, containsDashboardParameterizedDateFilter, } from "../../../../_staging/dashboard/parameterizedDateFilters.js";
|
|
6
5
|
import { filterLocalIdentifiers } from "../../../store/filtering/dashboardFilterSelectors.js";
|
|
7
6
|
import { getRestrictedDashboardFilters } from "../../../store/filtering/restrictedFilterUtils.js";
|
|
8
|
-
import { applyMirroredFilterValue, findCounterpartFilter, targetAcceptsAttributeFilterValue, withCommonDateFilterLocalIdentifier, } from "../../../store/tabs/filterContext/filterSync.js";
|
|
7
|
+
import { applyMirroredFilterValue, findCounterpartFilter, targetAcceptsAttributeFilterValue, withCommonDateFilterLocalIdentifier, withDateFilterIdentity, } from "../../../store/tabs/filterContext/filterSync.js";
|
|
9
8
|
import { isFilterTypeCompatibleWithSelectionType } from "../../../utils/attributeFilterSelectionTypeCompatibility.js";
|
|
10
9
|
const findMatchingAttributeFilterByLocalIdentifier = (filter, viewFilters) => viewFilters.find((item) => isDashboardAttributeFilter(item) &&
|
|
11
10
|
item.attributeFilter.localIdentifier === filter.attributeFilter.localIdentifier);
|
|
@@ -20,9 +19,12 @@ const findMatchingTextFilterByLocalIdentifier = (filter, viewFilters) => {
|
|
|
20
19
|
const findMatchingAttributeFilterItemByLocalIdentifier = (localId, viewFilters) => viewFilters.find((item) => isDashboardAttributeFilterItem(item) &&
|
|
21
20
|
dashboardAttributeFilterItemLocalIdentifier(item) === localId);
|
|
22
21
|
// date filters do not have localIdentifier set, compare them by dataSet instead
|
|
23
|
-
const findMatchingDateFilterByDataSet = (filter, viewFilters) =>
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const findMatchingDateFilterByDataSet = (filter, viewFilters) => {
|
|
23
|
+
const dataSet = dashboardFilterObjRef(filter);
|
|
24
|
+
return viewFilters.find((item) => isDashboardDateFilterOfAnyType(item) &&
|
|
25
|
+
((dashboardFilterObjRef(item) === undefined && dataSet === undefined) ||
|
|
26
|
+
areObjRefsEqual(dashboardFilterObjRef(item), dataSet)));
|
|
27
|
+
};
|
|
26
28
|
// MVF: match only when both localIdentifier and the referenced metric agree.
|
|
27
29
|
// The metric ref is set in edit mode and not changeable in view mode, so a localId
|
|
28
30
|
// collision with a different metric must not import stale conditions.
|
|
@@ -183,6 +185,18 @@ export const changeFilterContextSelection = (filterContext, filterViewFilters, r
|
|
|
183
185
|
? withCommonDateFilterLocalIdentifier(viewCommonDateFilter, dashboardFilterLocalIdentifier(filter))
|
|
184
186
|
: filter;
|
|
185
187
|
}
|
|
188
|
+
// whole periods of a date filter with a dimension replace the filter as a whole too
|
|
189
|
+
if (isDashboardDateFilterWithDimensionOfAnyType(filter)) {
|
|
190
|
+
const viewFilter = findMatchingDateFilterByDataSet(filter, filterViewFilters);
|
|
191
|
+
if (isDashboardAbsoluteGranularityDateFilter(filter) ||
|
|
192
|
+
isDashboardAbsoluteGranularityDateFilter(viewFilter)) {
|
|
193
|
+
const dataSet = dashboardFilterObjRef(filter);
|
|
194
|
+
const localIdentifier = dashboardFilterLocalIdentifier(filter);
|
|
195
|
+
return viewFilter
|
|
196
|
+
? withDateFilterIdentity(viewFilter, localIdentifier, dataSet)
|
|
197
|
+
: newAllTimeDashboardDateFilter(dataSet, localIdentifier);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
186
200
|
if (isDashboardAttributeFilter(filter)) {
|
|
187
201
|
const filterLocalId = filter.attributeFilter.localIdentifier;
|
|
188
202
|
const filterConfig = filterLocalId ? configsMap.get(filterLocalId) : undefined;
|
|
@@ -228,7 +242,7 @@ export const changeFilterContextSelection = (filterContext, filterViewFilters, r
|
|
|
228
242
|
}
|
|
229
243
|
else if (isDashboardDateFilter(filter)) {
|
|
230
244
|
const viewFilter = findMatchingDateFilterByDataSet(filter, filterViewFilters);
|
|
231
|
-
if (viewFilter) {
|
|
245
|
+
if (isDashboardDateFilter(viewFilter)) {
|
|
232
246
|
return {
|
|
233
247
|
dateFilter: {
|
|
234
248
|
...filter.dateFilter,
|
|
@@ -339,10 +353,6 @@ export function findTabDefaultFilterView(filterViews, tabLocalIdentifier, isFirs
|
|
|
339
353
|
* A default view the dashboard cannot apply in full is skipped, so the dashboard opens with its own filters.
|
|
340
354
|
*/
|
|
341
355
|
function supportedDefaultFilterView(view) {
|
|
342
|
-
if (view && containsAbsoluteGranularityDateFilterWithDataSet(view.filterContext.filters)) {
|
|
343
|
-
console.warn(`The default filter view "${view.name}" was not applied. ${ABSOLUTE_GRANULARITY_DATE_FILTER_WITH_DATA_SET_NOT_SUPPORTED}`);
|
|
344
|
-
return undefined;
|
|
345
|
-
}
|
|
346
356
|
if (view && containsDashboardParameterizedDateFilter(view.filterContext.filters)) {
|
|
347
357
|
console.warn(`The default filter view "${view.name}" was not applied. ${PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED}`);
|
|
348
358
|
return undefined;
|
|
@@ -480,7 +490,7 @@ function mirrorTabSelection(sourceBefore, sourceAfter, target, filterView, unava
|
|
|
480
490
|
* The filter of the same tab that `filter` was before a filter view changed its value.
|
|
481
491
|
*/
|
|
482
492
|
function findSameTabFilter(filters, filter) {
|
|
483
|
-
if (
|
|
493
|
+
if (isDashboardDateFilterOfAnyType(filter)) {
|
|
484
494
|
return findMatchingDateFilterByDataSet(filter, filters);
|
|
485
495
|
}
|
|
486
496
|
const localIdentifier = dashboardFilterLocalIdentifier(filter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateInitializers.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/common/stateInitializers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EAEtC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEH,KAAK,mCAAmC,EACxC,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EAKpC,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,SAAS,EAGd,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"stateInitializers.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/common/stateInitializers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EAEtC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEH,KAAK,mCAAmC,EACxC,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EAKpC,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,SAAS,EAGd,KAAK,MAAM,EAQd,MAAM,qBAAqB,CAAC;AAY7B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAoB5E,OAAO,EACH,KAAK,gBAAgB,EAGxB,MAAM,+BAA+B,CAAC;AAoKvC,wBAAiB,+BAA+B,CAC5C,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,SAAS,EACnB,gBAAgB,EAAE,iBAAiB,EACnC,YAAY,CAAC,EAAE,SAAS,CAAC,mCAAmC,CAAC,EAC7D,YAAY,CAAC,EAAE,MAAM,EACrB,mBAAmB,GAAE,8BAA8B,EAAO,GAC3D,YAAY,CAAC;IACZ,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,SAAS,EAAE,UAAU,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC,CA6GD;AAsJD,wBAAgB,YAAY,CACxB,GAAG,EAAE,gBAAgB,EACrB,WAAW,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAInC;AAgGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAiB,oCAAoC,CACjD,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,QAAQ,EAAE,EACpB,QAAQ,EAAE,SAAS,EACnB,0CAA0C,EAAE,OAAO,EACnD,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,SAAS,CAAC,GAAG,SAAS,EAEjG,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,EACjF,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,+BAA+B,EAAE,CAAC,EACjF,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC/D,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC,EACrE,YAAY,CAAC,EAAE,SAAS,CAAC,mCAAmC,CAAC,EAC7D,kBAAkB,CAAC,EAAE,UAAU,EAC/B,wBAAwB,CAAC,EAAE,MAAM,EACjC,mBAAmB,GAAE,8BAA8B,EAAO,EAC1D,0BAA0B,CAAC,EAAE,aAAa,CAAC,8BAA8B,CAAC,EAC1E,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,GACtD,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CA6NzC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { update } from "lodash-es";
|
|
3
3
|
import { call, select } from "redux-saga/effects";
|
|
4
4
|
import { walkLayout, } from "@gooddata/sdk-backend-spi";
|
|
5
|
-
import { areObjRefsEqual, isDashboardAttributeFilter,
|
|
5
|
+
import { areObjRefsEqual, dashboardFilterObjRef, isDashboardAttributeFilter, isDashboardDateFilterWithDimensionOfAnyType, isIdentifierRef, isInsightWidget, isObjRef, } from "@gooddata/sdk-model";
|
|
6
6
|
import { _cloneDeep, _compact, _isEmpty } from "@gooddata/util";
|
|
7
7
|
import { dashboardFilterContextDefinition, dashboardFilterContextIdentity, } from "../../../../_staging/dashboard/dashboardFilterContext.js";
|
|
8
8
|
import { dashboardLayoutSanitize } from "../../../../_staging/dashboard/dashboardLayout.js";
|
|
@@ -291,9 +291,9 @@ const keepOnlyFiltersWithValidRef = (filter, availableDfRefs, validDataSetIds, u
|
|
|
291
291
|
return true;
|
|
292
292
|
}
|
|
293
293
|
if (!isDashboardAttributeFilter(filter)) {
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
294
|
+
if (isDashboardDateFilterWithDimensionOfAnyType(filter)) {
|
|
295
|
+
const dataSet = dashboardFilterObjRef(filter);
|
|
296
|
+
return isIdentifierRef(dataSet) && validDataSetIds.includes(dataSet.identifier);
|
|
297
297
|
}
|
|
298
298
|
return true; // common date filter is kept always
|
|
299
299
|
}
|
|
@@ -342,8 +342,8 @@ function* sanitizeFilterContext(ctx, filterContext, dataSets = [], displayForms,
|
|
|
342
342
|
// additional date filters, let them validate
|
|
343
343
|
const additionalDateFilters = filterContext.filters
|
|
344
344
|
.filter((filter) => !isDashboardAttributeFilter(filter))
|
|
345
|
-
.filter(
|
|
346
|
-
.map((filter) => filter
|
|
345
|
+
.filter(isDashboardDateFilterWithDimensionOfAnyType)
|
|
346
|
+
.map((filter) => dashboardFilterObjRef(filter));
|
|
347
347
|
// check which are missing and load them
|
|
348
348
|
const missingDataSets = additionalDateFilters
|
|
349
349
|
.filter(isIdentifierRef)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/initializeDashboardHandler/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACH,KAAK,wBAAwB,EAIhC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAAK,UAAU,EAKf,KAAK,sBAAsB,EAG3B,KAAK,MAAM,EAOd,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/initializeDashboardHandler/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACH,KAAK,wBAAwB,EAIhC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAAK,UAAU,EAKf,KAAK,sBAAsB,EAG3B,KAAK,MAAM,EAOd,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AA0B1E,OAAO,EACH,KAAK,gBAAgB,EAGxB,MAAM,+BAA+B,CAAC;AA+JvC,KAAK,0BAA0B,GAAG;IAC9B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,wBAAwB,EAAE,wBAAwB,EAAE,CAAC;CACxD,CAAC;AA4YF,wBAAiB,cAAc,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,mBAAmB;;;uIAyB9E;AAuCD;;;;GAIG;AACH,wBAAiB,2BAA2B,CACxC,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,0BAA0B;;;0IAiBzC;AAED,wBAAiB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,sNAW3D;AAqCD,wBAAiB,0BAA0B,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,mBAAmB,GAAG,YAAY,CA0CzG"}
|
|
@@ -5,7 +5,6 @@ import { walkLayout, } from "@gooddata/sdk-backend-spi";
|
|
|
5
5
|
import { areObjRefsEqual, isDrillToInsight, isInsightWidget, isVisualizationSwitcherWidget, objRefToString, serializeObjRef, } from "@gooddata/sdk-model";
|
|
6
6
|
import { _uniqBy } from "@gooddata/util";
|
|
7
7
|
import { createDisplayFormMap, createDisplayFormMapFromCatalog, } from "../../../../_staging/catalog/displayFormMap.js";
|
|
8
|
-
import { assertNoAbsoluteGranularityDateFilterWithDataSetInDashboards } from "../../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
9
8
|
import { assertNoParameterizedDateFilterInDashboards } from "../../../../_staging/dashboard/parameterizedDateFilters.js";
|
|
10
9
|
import { deriveAbsoluteFormGranularitiesFromRelativeForm } from "../../../../_staging/dateFilterConfig/merge.js";
|
|
11
10
|
import { changeDashboardTimezoneOverride } from "../../../commands/timezone.js";
|
|
@@ -189,7 +188,6 @@ function* loadExistingDashboard(ctx, cmd, dashboardRef) {
|
|
|
189
188
|
];
|
|
190
189
|
const [dashboardWithReferences, { resolvedConfig: config, additionalData: { workspaceAutomationsCount, notificationChannelsCount }, }, permissions, entitlements, user, dashboardPermissions, dateHierarchyTemplates, filterViews, exportTimezone, automationTimezone,] = yield all(calls);
|
|
191
190
|
const { dashboard: loadedDashboard, references: { insights, unavailable }, } = dashboardWithReferences;
|
|
192
|
-
assertNoAbsoluteGranularityDateFilterWithDataSetInDashboards([loadedDashboard, cmd.payload.persistedDashboard], ctx.config?.overrideDefaultFilters);
|
|
193
191
|
assertNoParameterizedDateFilterInDashboards([loadedDashboard, cmd.payload.persistedDashboard], ctx.config?.overrideDefaultFilters);
|
|
194
192
|
// must be in the store before filter sanitization/resolution so they can keep forbidden refs;
|
|
195
193
|
// FF off => nothing is ever marked unavailable and behavior is unchanged
|
|
@@ -267,7 +265,6 @@ function* loadExistingDashboard(ctx, cmd, dashboardRef) {
|
|
|
267
265
|
}
|
|
268
266
|
function* initializeNewDashboard(ctx, cmd) {
|
|
269
267
|
const { backend } = ctx;
|
|
270
|
-
assertNoAbsoluteGranularityDateFilterWithDataSetInDashboards([], ctx.config?.overrideDefaultFilters);
|
|
271
268
|
assertNoParameterizedDateFilterInDashboards([], ctx.config?.overrideDefaultFilters);
|
|
272
269
|
const [{ resolvedConfig: config, additionalData: { notificationChannelsCount, workspaceAutomationsCount }, loadedCatalog, }, permissions, entitlements, user, listedDashboards, dateHierarchyTemplates, , exportTimezone,] = yield all([
|
|
273
270
|
// the catalog load rides along with the config resolution because its computed-attributes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossFilteringHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/drill/crossFilteringHandler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAmB/D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAgGnE,wBAAiB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"crossFilteringHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/drill/crossFilteringHandler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAmB/D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAgGnE,wBAAiB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe;;;;;;;;;yHAoJjF"}
|
|
@@ -68,6 +68,7 @@ function createVirtualFilter(drillFilterData, existingLocalIdentifier, filtersCo
|
|
|
68
68
|
export function* crossFilteringHandler(ctx, cmd) {
|
|
69
69
|
yield put(crossFilteringRequested(ctx, cmd.payload.drillDefinition, cmd.payload.drillEvent, cmd.correlationId));
|
|
70
70
|
const widgetRef = cmd.payload.drillEvent.widgetRef;
|
|
71
|
+
// TODO INE: MC-5779 - date filters with dimension of the whole-period type are not counted here yet.
|
|
71
72
|
const currentFilters = yield select(selectFilterContextDraggableFilterItems);
|
|
72
73
|
const dateAttributes = yield select(selectCatalogDateAttributes);
|
|
73
74
|
const dateDataSetsAttributesRefs = dateAttributes.map((dateAttribute) => dateAttribute.attribute.ref);
|
|
@@ -141,6 +141,7 @@ function selectAllAttributeFilters(state) {
|
|
|
141
141
|
function selectAllMeasureValueFilters(state) {
|
|
142
142
|
return selectFilterContextMeasureValueFilters(state);
|
|
143
143
|
}
|
|
144
|
+
// TODO INE: MC-5779 - date filters with dimension of the whole-period type are not passed through yet.
|
|
144
145
|
function selectAllDraggableFilters(state) {
|
|
145
146
|
return selectFilterContextDraggableFilterItems(state);
|
|
146
147
|
}
|
package/esm/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeFilterContextSelectionHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"changeFilterContextSelectionHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AA6C/C,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAoC9E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAkOnE,wBAAiB,mCAAmC,CAChD,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,4BAA4B,GAClC,YAAY,CAAC,IAAI,CAAC,CAoQpB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { all, call, put, select } from "redux-saga/effects";
|
|
3
3
|
import { NotSupported } from "@gooddata/sdk-backend-spi";
|
|
4
|
-
import { areObjRefsEqual, attributeElementsIsEmpty, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemFilterElementsBy, dashboardAttributeFilterItemFilterElementsByDate, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemValidateElementsBy, dashboardFilterLocalIdentifier, dashboardFilterObjRef, dashboardMeasureValueFilterLocalIdentifier, getAttributeElementsItems,
|
|
4
|
+
import { areObjRefsEqual, attributeElementsIsEmpty, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemFilterElementsBy, dashboardAttributeFilterItemFilterElementsByDate, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemValidateElementsBy, dashboardFilterLocalIdentifier, dashboardFilterObjRef, dashboardMeasureValueFilterLocalIdentifier, getAttributeElementsItems, isDashboardAbsoluteGranularityDateFilter, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilterOfAnyType, isDashboardDateFilterOfAnyType, isDashboardMeasureValueFilter, isDashboardParameterizedDateFilter, isDashboardTextAttributeFilter, isParameterizedDateFilter, isSingleSelectionFilter, isUriRef, objRefToString, serializeObjRef, updateAttributeElementsItems, } from "@gooddata/sdk-model";
|
|
5
5
|
import { _compact, _partition, _uniqBy } from "@gooddata/util";
|
|
6
|
-
import { ABSOLUTE_GRANULARITY_DATE_FILTER_WITH_DATA_SET_NOT_SUPPORTED, containsAbsoluteGranularityDateFilterWithDataSet, } from "../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
7
6
|
import { dashboardFilterToFilterContextItem } from "../../../_staging/dashboard/dashboardFilterContext.js";
|
|
8
7
|
import { PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED } from "../../../_staging/dashboard/parameterizedDateFilters.js";
|
|
9
8
|
import { invalidArgumentsProvided } from "../../events/general.js";
|
|
@@ -11,7 +10,7 @@ import { dispatchDashboardEvent } from "../../store/_infra/eventDispatcher.js";
|
|
|
11
10
|
import { selectRestrictedDashboardFilterLocalIdentifiers, selectRestrictedDashboardFilterLocalIdentifiersForTab, } from "../../store/filtering/dashboardFilterSelectors.js";
|
|
12
11
|
import { isDashboardFilterUsingRestrictedObject } from "../../store/filtering/restrictedFilterUtils.js";
|
|
13
12
|
import { selectAttributeFilterConfigsOverrides, selectAttributeFilterConfigsOverridesByTab, selectAttributeFilterConfigsSelectionTypeMap, selectAttributeFilterConfigsSelectionTypeMapByTab, } from "../../store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
|
|
14
|
-
import { isDisplayFormRefOf, selectAttributeFilterDisplayFormsMap, selectFilterContextAttributeFilterItems, selectFilterContextAttributeFilterItemsForTab,
|
|
13
|
+
import { isDisplayFormRefOf, selectAttributeFilterDisplayFormsMap, selectFilterContextAttributeFilterItems, selectFilterContextAttributeFilterItemsForTab, selectFilterContextDateFilterByDataSetForTab, selectFilterContextDateFilterOfAnyTypeByDataSet, selectFilterContextDateFiltersWithDimensionForTab, selectFilterContextDateFiltersWithDimensionOfAnyType, selectFilterContextFilters, selectFilterContextMeasureValueFilters, selectFiltersForTab, } from "../../store/tabs/filterContext/filterContextSelectors.js";
|
|
15
14
|
import { tabsActions } from "../../store/tabs/index.js";
|
|
16
15
|
import { selectTabs } from "../../store/tabs/tabsSelectors.js";
|
|
17
16
|
import { selectUnavailableObjects } from "../../store/unavailableObjects/unavailableObjectsSelectors.js";
|
|
@@ -103,12 +102,12 @@ function* selectFilterContextAttributeFilterByDisplayFormTabAware(displayForm, t
|
|
|
103
102
|
function* selectFilterContextDateFilterByDataSetTabAware(dataSet, tabLocalIdentifier) {
|
|
104
103
|
return tabLocalIdentifier
|
|
105
104
|
? yield select(selectFilterContextDateFilterByDataSetForTab(dataSet, tabLocalIdentifier))
|
|
106
|
-
: yield select(
|
|
105
|
+
: yield select(selectFilterContextDateFilterOfAnyTypeByDataSet(dataSet));
|
|
107
106
|
}
|
|
108
107
|
function* selectFilterContextDateFiltersWithDimensionTabAware(tabLocalIdentifier) {
|
|
109
108
|
return tabLocalIdentifier
|
|
110
109
|
? yield select(selectFilterContextDateFiltersWithDimensionForTab(tabLocalIdentifier))
|
|
111
|
-
: yield select(
|
|
110
|
+
: yield select(selectFilterContextDateFiltersWithDimensionOfAnyType);
|
|
112
111
|
}
|
|
113
112
|
function* selectFilterContextMeasureValueFiltersTabAware(tabLocalIdentifier) {
|
|
114
113
|
if (tabLocalIdentifier) {
|
|
@@ -177,10 +176,6 @@ export function* changeFilterContextSelectionHandler(ctx, cmd) {
|
|
|
177
176
|
return dashboardFilterToFilterContextItem(filter, !!ctx.backend.capabilities.supportsMultipleDateFilters);
|
|
178
177
|
})).filter((filter) => !((isDashboardAttributeFilterItem(filter) || isDashboardMeasureValueFilter(filter)) &&
|
|
179
178
|
isDashboardFilterUsingRestrictedObject(filter, unavailableObjects)) && !(matchByLocalIdentifier && addressesRestrictedFilter(filter)));
|
|
180
|
-
if (containsAbsoluteGranularityDateFilterWithDataSet(normalizedFilters)) {
|
|
181
|
-
yield dispatchDashboardEvent(invalidArgumentsProvided(ctx, cmd, ABSOLUTE_GRANULARITY_DATE_FILTER_WITH_DATA_SET_NOT_SUPPORTED));
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
179
|
const disabledComputedAttributeRef = yield call(findDisabledComputedAttributeRef, [
|
|
185
180
|
...normalizedFilters
|
|
186
181
|
.filter(isDashboardAttributeFilterItem)
|
|
@@ -230,7 +225,7 @@ export function* changeFilterContextSelectionHandler(ctx, cmd) {
|
|
|
230
225
|
const [attributeFilterResult, commonDateFilterUpdateActions, dateFiltersUpdateActions, measureValueFilterUpdateActions,] = yield all([
|
|
231
226
|
call(getAttributeFiltersUpdateActions, [...attributeFilters].reverse(), textAttributeFilters, attributeFilterConfigs, resetOthers, ctx, tabLocalIdentifier, selectionTypeMap, matchByLocalIdentifier),
|
|
232
227
|
call(getDateFilterUpdateActions, commonDateFilter, resetOthers, restorePerTabOriginals, tabLocalIdentifier),
|
|
233
|
-
call(getDateFiltersUpdateActions, dateFiltersWithDimension, resetOthers, tabLocalIdentifier),
|
|
228
|
+
call(getDateFiltersUpdateActions, dateFiltersWithDimension, resetOthers, restorePerTabOriginals, tabLocalIdentifier),
|
|
234
229
|
call(getMeasureValueFiltersUpdateActions, measureValueFilters, resetOthers, tabLocalIdentifier),
|
|
235
230
|
]);
|
|
236
231
|
const session = yield call(beginTabSync, { tabLocalIdentifier, enabled: !skipSync });
|
|
@@ -723,60 +718,39 @@ function* getMeasureValueFiltersUpdateActions(measureValueFilters, resetOthers,
|
|
|
723
718
|
}
|
|
724
719
|
return updateActions;
|
|
725
720
|
}
|
|
726
|
-
function* getDateFiltersUpdateActions(dateFilters, resetOthers, tabLocalIdentifier) {
|
|
721
|
+
function* getDateFiltersUpdateActions(dateFilters, resetOthers, restorePerTabOriginals, tabLocalIdentifier) {
|
|
727
722
|
const updateActions = [];
|
|
728
723
|
const handledDataSets = new Set();
|
|
729
724
|
for (const dateFilter of dateFilters) {
|
|
730
|
-
const filterRef = dateFilter
|
|
725
|
+
const filterRef = dashboardFilterObjRef(dateFilter);
|
|
731
726
|
const dashboardFilter = yield call(selectFilterContextDateFilterByDataSetTabAware, filterRef, tabLocalIdentifier);
|
|
732
727
|
if (dashboardFilter) {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
...emptyValueHandlingObj,
|
|
746
|
-
tabLocalIdentifier,
|
|
747
|
-
}
|
|
748
|
-
: {
|
|
749
|
-
type: dateFilter.dateFilter.type,
|
|
750
|
-
granularity: dateFilter.dateFilter.granularity,
|
|
751
|
-
from: dateFilter.dateFilter.from,
|
|
752
|
-
to: dateFilter.dateFilter.to,
|
|
753
|
-
dataSet: dateFilter.dateFilter.dataSet,
|
|
754
|
-
...localIdentifierObj,
|
|
755
|
-
...(dateFilter.dateFilter.boundedFilter
|
|
756
|
-
? { boundedFilter: dateFilter.dateFilter.boundedFilter }
|
|
757
|
-
: {}),
|
|
758
|
-
...emptyValueHandlingObj,
|
|
759
|
-
tabLocalIdentifier,
|
|
760
|
-
};
|
|
761
|
-
updateActions.push(tabsActions.upsertDateFilter(upsertPayload));
|
|
728
|
+
handledDataSets.add(serializeObjRef(dashboardFilterObjRef(dashboardFilter)));
|
|
729
|
+
// the same check as for the common date filter, a filter that cannot be applied keeps its selection
|
|
730
|
+
const canApply = isDashboardAbsoluteGranularityDateFilter(dateFilter) && !restorePerTabOriginals
|
|
731
|
+
? yield call(canApplyDateFilter, dateFilter)
|
|
732
|
+
: true;
|
|
733
|
+
if (!canApply) {
|
|
734
|
+
continue;
|
|
735
|
+
}
|
|
736
|
+
updateActions.push(tabsActions.upsertDateFilter({
|
|
737
|
+
...toUpsertDateFilterPayload(dateFilter),
|
|
738
|
+
tabLocalIdentifier,
|
|
739
|
+
}));
|
|
762
740
|
}
|
|
763
741
|
}
|
|
764
742
|
if (resetOthers) {
|
|
765
743
|
const currentDateFilters = yield call(selectFilterContextDateFiltersWithDimensionTabAware, tabLocalIdentifier);
|
|
766
744
|
// for filters that have not been handled by the loop above, create a clear selection actions
|
|
767
|
-
const unhandledFilters = currentDateFilters.filter((filter) => !handledDataSets.has(serializeObjRef(filter
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
...localIdentifierObj,
|
|
777
|
-
tabLocalIdentifier,
|
|
778
|
-
}));
|
|
779
|
-
}
|
|
745
|
+
const unhandledFilters = currentDateFilters.filter((filter) => !handledDataSets.has(serializeObjRef(dashboardFilterObjRef(filter))));
|
|
746
|
+
for (const dateFilter of unhandledFilters) {
|
|
747
|
+
const localIdentifier = dashboardFilterLocalIdentifier(dateFilter);
|
|
748
|
+
updateActions.push(tabsActions.upsertDateFilter({
|
|
749
|
+
type: "allTime",
|
|
750
|
+
dataSet: dashboardFilterObjRef(dateFilter),
|
|
751
|
+
...(localIdentifier ? { localIdentifier } : {}),
|
|
752
|
+
tabLocalIdentifier,
|
|
753
|
+
}));
|
|
780
754
|
}
|
|
781
755
|
}
|
|
782
756
|
return updateActions;
|
|
@@ -6,7 +6,7 @@ import { selectAllCatalogDateDatasetsMap } from "../../../../model/store/catalog
|
|
|
6
6
|
import { dateFilterAdded } from "../../../events/filters.js";
|
|
7
7
|
import { invalidArgumentsProvided } from "../../../events/general.js";
|
|
8
8
|
import { dispatchDashboardEvent } from "../../../store/_infra/eventDispatcher.js";
|
|
9
|
-
import { selectCanAddMoreFilters, selectFilterContextDateFilterByDataSet,
|
|
9
|
+
import { selectCanAddMoreFilters, selectFilterContextDateFilterByDataSet, selectFilterContextDateFiltersWithDimensionOfAnyType, } from "../../../store/tabs/filterContext/filterContextSelectors.js";
|
|
10
10
|
import { tabsActions } from "../../../store/tabs/index.js";
|
|
11
11
|
import { dispatchFilterContextChanged } from "../common.js";
|
|
12
12
|
// import { dispatchDashboardEvent } from "../../../store/_infra/eventDispatcher.js";
|
|
@@ -23,7 +23,7 @@ export function* addDateFilterHandler(ctx, cmd) {
|
|
|
23
23
|
throw invalidArgumentsProvided(ctx, cmd, `Attempting to add filter for a non-existing date data set ${objRefToString(dateDataset)}.`);
|
|
24
24
|
}
|
|
25
25
|
invariant(usedDateDataSet);
|
|
26
|
-
const allFilters = yield select(
|
|
26
|
+
const allFilters = yield select(selectFilterContextDateFiltersWithDimensionOfAnyType);
|
|
27
27
|
const canBeAdded = yield call(canFilterBeAdded, dateDataset, allFilters);
|
|
28
28
|
if (!canBeAdded) {
|
|
29
29
|
throw invalidArgumentsProvided(ctx, cmd, `Filter for date data set ${objRefToString(dateDataset)} already exists in the filter context.`);
|
package/esm/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeDateFilterSelectionHandler.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"changeDateFilterSelectionHandler.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAe/C,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EAE1C,MAAM,8BAA8B,CAAC;AAYtC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE,wBAAiB,gCAAgC,CAC7C,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,yBAAyB,GAC/B,YAAY,CAAC,IAAI,CAAC,CAgDpB;AAED,wBAAiB,yCAAyC,CACtD,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,kCAAkC,GACxC,YAAY,CAAC,IAAI,CAAC,CAwBpB"}
|
package/esm/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.js
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
import { toNumber } from "lodash-es";
|
|
3
3
|
import { call, select } from "redux-saga/effects";
|
|
4
4
|
import { dashboardFilterObjRef, isDashboardDateFilter, isDashboardParameterizedDateFilter, newAbsoluteDashboardDateFilter, newAllTimeDashboardDateFilter, newRelativeDashboardDateFilter, } from "@gooddata/sdk-model";
|
|
5
|
-
import { ABSOLUTE_GRANULARITY_DATE_FILTER_WITH_DATA_SET_NOT_SUPPORTED, containsAbsoluteGranularityDateFilterWithDataSet, } from "../../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
6
5
|
import { PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED } from "../../../../_staging/dashboard/parameterizedDateFilters.js";
|
|
7
6
|
import { dateFilterChanged, dateFilterOfAnyTypeChanged } from "../../../events/filters.js";
|
|
8
7
|
import { invalidArgumentsProvided } from "../../../events/general.js";
|
|
9
8
|
import { dispatchDashboardEvent } from "../../../store/_infra/eventDispatcher.js";
|
|
10
9
|
import { selectIsApplyFiltersAllAtOnceEnabledAndSet } from "../../../store/config/configSelectors.js";
|
|
11
10
|
import { selectIsCrossFiltering } from "../../../store/drill/drillSelectors.js";
|
|
12
|
-
import {
|
|
11
|
+
import { selectFilterContextDateFilterOfAnyType, selectFilterContextDateFilterOfAnyTypeByDataSet, } from "../../../store/tabs/filterContext/filterContextSelectors.js";
|
|
13
12
|
import { tabsActions } from "../../../store/tabs/index.js";
|
|
14
13
|
import { canApplyDateFilter, resetCrossFiltering } from "../common.js";
|
|
15
14
|
import { toUpsertDateFilterPayload } from "../tabSync/tabSyncRules.js";
|
|
@@ -50,9 +49,6 @@ export function* changeDateFilterSelectionHandler(ctx, cmd) {
|
|
|
50
49
|
}
|
|
51
50
|
export function* changeDateFilterSelectionOfAnyTypeHandler(ctx, cmd) {
|
|
52
51
|
const { filter, dateFilterOptionLocalId, isWorkingSelectionChange } = cmd.payload;
|
|
53
|
-
if (containsAbsoluteGranularityDateFilterWithDataSet(filter ? [filter] : [])) {
|
|
54
|
-
throw invalidArgumentsProvided(ctx, cmd, ABSOLUTE_GRANULARITY_DATE_FILTER_WITH_DATA_SET_NOT_SUPPORTED);
|
|
55
|
-
}
|
|
56
52
|
if (isDashboardParameterizedDateFilter(filter)) {
|
|
57
53
|
throw invalidArgumentsProvided(ctx, cmd, PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED);
|
|
58
54
|
}
|
|
@@ -77,7 +73,7 @@ function* upsertDateFilterSelection(ctx, cmd, upsertPayload, dataSet, dateFilter
|
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
75
|
const affectedFilter = dataSet
|
|
80
|
-
? yield select(
|
|
76
|
+
? yield select(selectFilterContextDateFilterOfAnyTypeByDataSet(dataSet))
|
|
81
77
|
: yield select(selectFilterContextDateFilterOfAnyType);
|
|
82
78
|
if (!affectedFilter || isDashboardDateFilter(affectedFilter)) {
|
|
83
79
|
yield dispatchDashboardEvent(dateFilterChanged(ctx, affectedFilter, dateFilterOptionLocalId, cmd.correlationId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveDateFilterHandler.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/dateFilter/moveDateFilterHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"moveDateFilterHandler.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/dateFilter/moveDateFilterHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAUpE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,wBAAiB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,CA+CtG"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { call, put, select } from "redux-saga/effects";
|
|
3
|
-
import {
|
|
3
|
+
import { isDashboardDateFilter } from "@gooddata/sdk-model";
|
|
4
|
+
import { dateFilterMoved, dateFilterOfAnyTypeMoved } from "../../../events/filters.js";
|
|
4
5
|
import { invalidArgumentsProvided } from "../../../events/general.js";
|
|
5
6
|
import { dispatchDashboardEvent } from "../../../store/_infra/eventDispatcher.js";
|
|
6
|
-
import {
|
|
7
|
+
import { selectFilterContextDateFilterOfAnyTypeByDataSet, selectFilterContextDraggableFilterIndexByRef, selectFilterContextFilters, } from "../../../store/tabs/filterContext/filterContextSelectors.js";
|
|
7
8
|
import { tabsActions } from "../../../store/tabs/index.js";
|
|
8
9
|
import { dispatchFilterContextChanged } from "../common.js";
|
|
9
10
|
export function* moveDateFilterHandler(ctx, cmd) {
|
|
10
11
|
const { dataSet, index } = cmd.payload;
|
|
11
12
|
// validate dataSet
|
|
12
|
-
const affectedFilter = yield select(
|
|
13
|
+
const affectedFilter = yield select(selectFilterContextDateFilterOfAnyTypeByDataSet(dataSet));
|
|
13
14
|
if (!affectedFilter) {
|
|
14
15
|
throw invalidArgumentsProvided(ctx, cmd, `Filter with dataSet ${dataSet} not found.`);
|
|
15
16
|
}
|
|
@@ -25,6 +26,9 @@ export function* moveDateFilterHandler(ctx, cmd) {
|
|
|
25
26
|
index,
|
|
26
27
|
}));
|
|
27
28
|
const finalIndex = yield select(selectFilterContextDraggableFilterIndexByRef(dataSet));
|
|
28
|
-
|
|
29
|
+
if (isDashboardDateFilter(affectedFilter)) {
|
|
30
|
+
yield dispatchDashboardEvent(dateFilterMoved(ctx, affectedFilter, originalIndex, finalIndex, cmd.correlationId));
|
|
31
|
+
}
|
|
32
|
+
yield dispatchDashboardEvent(dateFilterOfAnyTypeMoved(ctx, affectedFilter, originalIndex, finalIndex, cmd.correlationId));
|
|
29
33
|
yield call(dispatchFilterContextChanged, ctx, cmd);
|
|
30
34
|
}
|
package/esm/model/commandHandlers/filterContext/dateFilter/removeDateFiltersHandler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeDateFiltersHandler.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/dateFilter/removeDateFiltersHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"removeDateFiltersHandler.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/dateFilter/removeDateFiltersHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAc/C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AASvE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,wBAAiB,wBAAwB,CACrC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,kBAAkB,GACxB,YAAY,CAAC,IAAI,CAAC,CA0FpB"}
|