@gooddata/sdk-ui-dashboard 11.51.0-alpha.2 → 11.51.0-alpha.4
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/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/assets/timezone.svg +1 -0
- package/esm/index.d.ts +6 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +5 -2
- package/esm/model/react/useWidgetExecConfig.d.ts +9 -0
- package/esm/model/react/useWidgetExecConfig.d.ts.map +1 -1
- package/esm/model/react/useWidgetExecConfig.js +21 -3
- package/esm/model/store/config/configSelectors.d.ts +6 -0
- package/esm/model/store/config/configSelectors.d.ts.map +1 -1
- package/esm/model/store/config/configSelectors.js +8 -0
- package/esm/model/store/meta/metaSelectors.d.ts +12 -0
- package/esm/model/store/meta/metaSelectors.d.ts.map +1 -1
- package/esm/model/store/meta/metaSelectors.js +19 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.js +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFormState.js +1 -1
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.js +31 -33
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.test.js +91 -10
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts +8 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js +12 -3
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js +38 -8
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.d.ts +6 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.js +6 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.test.js +7 -1
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts +22 -3
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.js +3 -2
- package/esm/presentation/automations/contexts/ScheduledEmailManagementDialogContext.d.ts +9 -2
- package/esm/presentation/automations/contexts/ScheduledEmailManagementDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/ScheduledEmailManagementDialogContext.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultLoadingScheduledEmailDialog.d.ts +7 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultLoadingScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +9 -11
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +6 -12
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +5 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.js +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.js +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.d.ts +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.d.ts +1 -3
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.js +2 -2
- package/esm/presentation/automations/scheduledEmail/types.d.ts +35 -5
- package/esm/presentation/automations/scheduledEmail/types.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.js +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.js +2 -1
- package/esm/presentation/automations/shared/automationFilters/utils.d.ts +1 -32
- package/esm/presentation/automations/shared/automationFilters/utils.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/utils.js +2 -177
- package/esm/presentation/automations/shared/filters/conversions.d.ts +36 -0
- package/esm/presentation/automations/shared/filters/conversions.d.ts.map +1 -0
- package/esm/presentation/automations/shared/filters/conversions.js +242 -0
- package/esm/presentation/automations/shared/filters/index.d.ts +2 -0
- package/esm/presentation/automations/shared/filters/index.d.ts.map +1 -0
- package/esm/presentation/automations/shared/filters/index.js +3 -0
- package/esm/presentation/dashboard/components/DashboardLoading.js +1 -1
- package/esm/presentation/dashboardContexts/useSlideData.d.ts +5 -10
- package/esm/presentation/dashboardContexts/useSlideData.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/useSlideData.js +16 -10
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdownMenuItem.js +2 -2
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.js +29 -8
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderDescription.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderDescription.js +3 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableHeader/SectionHeaderEditable.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableHeader/SectionHeaderEditable.js +3 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/ExportableDashboardLayoutSectionRenderer.d.ts +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/ExportableDashboardLayoutSectionRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/ExportableDashboardLayoutSectionRenderer.js +2 -5
- package/esm/presentation/insightList/InsightList.d.ts.map +1 -1
- package/esm/presentation/insightList/InsightList.js +4 -5
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +4 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +4 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +11 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +12 -1
- package/esm/presentation/topBar/timezoneIndicator/DefaultTimezoneIndicator.d.ts +10 -0
- package/esm/presentation/topBar/timezoneIndicator/DefaultTimezoneIndicator.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/DefaultTimezoneIndicator.js +19 -0
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts +13 -0
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.js +27 -0
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts +13 -0
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.js +20 -0
- package/esm/presentation/topBar/timezoneIndicator/types.d.ts +47 -0
- package/esm/presentation/topBar/timezoneIndicator/types.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/types.js +2 -0
- package/esm/presentation/topBar/topBar/DefaultTopBar.d.ts.map +1 -1
- package/esm/presentation/topBar/topBar/DefaultTopBar.js +15 -4
- package/esm/presentation/topBar/topBar/types.d.ts +2 -0
- package/esm/presentation/topBar/topBar/types.d.ts.map +1 -1
- package/esm/presentation/widget/description/ExportModeInsightWidgetDescription.d.ts.map +1 -1
- package/esm/presentation/widget/description/ExportModeInsightWidgetDescription.js +3 -5
- package/esm/presentation/widget/description/InsightWidgetDescriptionTrigger.d.ts.map +1 -1
- package/esm/presentation/widget/description/InsightWidgetDescriptionTrigger.js +3 -6
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.js +3 -5
- package/esm/presentation/widget/insight/configuration/InsightDescriptionConfig/InsightDescription.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDescriptionConfig/InsightDescription.js +3 -6
- package/esm/presentation/widget/richText/EditModeDashboardRichText.d.ts.map +1 -1
- package/esm/presentation/widget/richText/EditModeDashboardRichText.js +3 -5
- package/esm/presentation/widget/richText/ViewModeDashboardRichText.d.ts.map +1 -1
- package/esm/presentation/widget/richText/ViewModeDashboardRichText.js +3 -5
- package/esm/sdk-ui-dashboard.d.ts +162 -10
- package/package.json +21 -21
- package/styles/css/filterBar.css +1 -0
- package/styles/css/filterBar.css.map +1 -1
- package/styles/css/main.css +29 -1
- package/styles/css/main.css.map +1 -1
- package/styles/css/timezoneIndicator.css +20 -0
- package/styles/css/timezoneIndicator.css.map +1 -0
- package/styles/css/topBar.css +9 -1
- package/styles/css/topBar.css.map +1 -1
- package/styles/scss/filterBar.scss +7 -0
- package/styles/scss/main.scss +1 -0
- package/styles/scss/timezoneIndicator.scss +23 -0
- package/styles/scss/topBar.scss +13 -2
- package/esm/presentation/automations/scheduledEmail/utils/filters.d.ts +0 -3
- package/esm/presentation/automations/scheduledEmail/utils/filters.d.ts.map +0 -1
- package/esm/presentation/automations/scheduledEmail/utils/filters.js +0 -5
- package/esm/presentation/automations/shared/utils/filterContextUtils.d.ts +0 -4
- package/esm/presentation/automations/shared/utils/filterContextUtils.d.ts.map +0 -1
- package/esm/presentation/automations/shared/utils/filterContextUtils.js +0 -67
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
3
|
-
import { absoluteDateFilterValues, areObjRefsEqual,
|
|
4
|
-
import { filterContextItemsToDashboardFiltersByWidget } from "../../../../converters/filterConverters.js";
|
|
5
|
-
import { removeIgnoredWidgetFilters } from "../../../../model/utils/widgetFilters.js";
|
|
2
|
+
import { isEqual } from "lodash-es";
|
|
3
|
+
import { absoluteDateFilterValues, areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, dashboardFilterObjRef, filterAttributeElements, filterLocalIdentifier, filterObjRef, getAttributeElementsItems, isAbsoluteDateFilter, isAllTimeDateFilter, isArbitraryAttributeFilter, isAttributeFilter, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, isDateFilter, isInsightWidget, isMatchAttributeFilter, isNegativeAttributeFilter, isPositiveAttributeFilter, isRelativeDateFilter, relativeDateFilterValues, } from "@gooddata/sdk-model";
|
|
6
4
|
export const getFilterLocalIdentifier = (filter) => {
|
|
7
5
|
return dashboardFilterLocalIdentifier(filter);
|
|
8
6
|
};
|
|
@@ -82,152 +80,6 @@ export const getFilterByCatalogItemRef = (ref, filters) => {
|
|
|
82
80
|
return false;
|
|
83
81
|
});
|
|
84
82
|
};
|
|
85
|
-
export const getVisibleFiltersByFilters = (selectedFilters, visibleFiltersMetadata, storeFilters) => {
|
|
86
|
-
if (!storeFilters) {
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
89
|
-
const filters = (selectedFilters ?? [])
|
|
90
|
-
// Strip noop "All values" attribute filters and "All" measure value filters —
|
|
91
|
-
// they have no effect on execution and should not be stored in visible filters metadata.
|
|
92
|
-
.filter((filter) => !isAllValuesDashboardAttributeFilter(filter) && !isAllDashboardMeasureValueFilter(filter))
|
|
93
|
-
.map((selectedFilter) => {
|
|
94
|
-
const selectedLocalIdentifier = getFilterLocalIdentifier(selectedFilter);
|
|
95
|
-
const targetFilter = (visibleFiltersMetadata ?? []).find((visibleFilter) => {
|
|
96
|
-
return selectedLocalIdentifier === visibleFilter.localIdentifier;
|
|
97
|
-
});
|
|
98
|
-
if (targetFilter && isDashboardDateFilter(selectedFilter)) {
|
|
99
|
-
return {
|
|
100
|
-
...targetFilter,
|
|
101
|
-
// NOTE: despite the name, this flag is used to mark *noop* "All time" filters (implicit default)
|
|
102
|
-
// that are intentionally not stored in automation execution filters.
|
|
103
|
-
isAllTimeDateFilter: isNoopAllTimeDashboardDateFilter(selectedFilter),
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return targetFilter;
|
|
107
|
-
});
|
|
108
|
-
return compact(filters);
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Get visible filters metadata structured by tab.
|
|
112
|
-
* Applies the same logic as getVisibleFiltersByFilters to each tab's filters.
|
|
113
|
-
*/
|
|
114
|
-
export const getVisibleFiltersByFiltersByTab = (filtersByTab, visibleFiltersMetadata, storeFilters) => {
|
|
115
|
-
if (!storeFilters || !filtersByTab) {
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
118
|
-
return Object.entries(filtersByTab).reduce((acc, [tabId, tabFilters]) => {
|
|
119
|
-
const visibleFilters = getVisibleFiltersByFilters(tabFilters, visibleFiltersMetadata?.[tabId], true);
|
|
120
|
-
if (visibleFilters && visibleFilters.length > 0) {
|
|
121
|
-
acc[tabId] = visibleFilters;
|
|
122
|
-
}
|
|
123
|
-
return acc;
|
|
124
|
-
}, {});
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Resolve MVF dimensionality localIdRefs to stable identifierRefs using the insight's attributes.
|
|
128
|
-
*
|
|
129
|
-
* Measure value filters may reference attributes in their dimensionality via localIdRef,
|
|
130
|
-
* which is only meaningful within the insight's own execution context. When these filters
|
|
131
|
-
* are used in an alert execution (which may not include the original attributes), the
|
|
132
|
-
* localIdRefs become dangling. This function resolves them to display form identifierRefs.
|
|
133
|
-
*/
|
|
134
|
-
export function resolveMvfDimensionalityLocalRefs(filters, insight) {
|
|
135
|
-
if (!insight) {
|
|
136
|
-
return filters;
|
|
137
|
-
}
|
|
138
|
-
const attributeLocalIdToDisplayForm = new Map();
|
|
139
|
-
insightAttributes(insight).forEach((attribute) => {
|
|
140
|
-
attributeLocalIdToDisplayForm.set(attributeLocalId(attribute), attribute.attribute.displayForm);
|
|
141
|
-
});
|
|
142
|
-
if (attributeLocalIdToDisplayForm.size === 0) {
|
|
143
|
-
return filters;
|
|
144
|
-
}
|
|
145
|
-
return filters.map((filter) => {
|
|
146
|
-
if (!isMeasureValueFilter(filter)) {
|
|
147
|
-
return filter;
|
|
148
|
-
}
|
|
149
|
-
const dimensionality = filter.measureValueFilter.dimensionality;
|
|
150
|
-
if (!dimensionality?.length) {
|
|
151
|
-
return filter;
|
|
152
|
-
}
|
|
153
|
-
const resolvedDimensionality = dimensionality.map((item) => {
|
|
154
|
-
if (!isLocalIdRef(item)) {
|
|
155
|
-
return item;
|
|
156
|
-
}
|
|
157
|
-
return attributeLocalIdToDisplayForm.get(item.localIdentifier) ?? item;
|
|
158
|
-
});
|
|
159
|
-
const changed = dimensionality.some((item, i) => item !== resolvedDimensionality[i]);
|
|
160
|
-
if (!changed) {
|
|
161
|
-
return filter;
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
...filter,
|
|
165
|
-
measureValueFilter: {
|
|
166
|
-
...filter.measureValueFilter,
|
|
167
|
-
dimensionality: resolvedDimensionality,
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Get final execution filters for the widget alert or scheduled export.
|
|
174
|
-
*/
|
|
175
|
-
export const getAppliedWidgetFilters = (selectedAutomationFilters, dashboardHiddenFilters, widget, insight, commonDateFilterId, mergeInsightFilters = false, withoutWidget = false) => {
|
|
176
|
-
// Hidden filters are never included in selectedAutomationFilters,
|
|
177
|
-
// but we need them to construct proper execution filters, so merge them.
|
|
178
|
-
const selectedFiltersWithHiddenFilters = [...selectedAutomationFilters, ...dashboardHiddenFilters];
|
|
179
|
-
// Now, remove ignored filters (some of the hidden filters might be ignored).
|
|
180
|
-
const selectedFiltersWithoutIgnoredFilters = removeIgnoredWidgetFilters(selectedFiltersWithHiddenFilters, widget);
|
|
181
|
-
// Now, convert sanitized selected filters to execution filters shape.
|
|
182
|
-
const selectedExecutionFilters = isInsightWidget(widget)
|
|
183
|
-
? filterContextItemsToDashboardFiltersByWidget(selectedFiltersWithoutIgnoredFilters, widget)
|
|
184
|
-
: withoutWidget
|
|
185
|
-
? filterContextItemsToDashboardFiltersByWidget(selectedFiltersWithoutIgnoredFilters, undefined)
|
|
186
|
-
: [];
|
|
187
|
-
const filtersToUse = mergeInsightFilters
|
|
188
|
-
? mergeFilters(insight?.insight?.filters ?? [], selectedExecutionFilters, commonDateFilterId)
|
|
189
|
-
: selectedExecutionFilters;
|
|
190
|
-
// Resolve MVF dimensionality localIdRefs to stable identifierRefs so that
|
|
191
|
-
// alert executions (which have empty attributes) don't contain dangling refs.
|
|
192
|
-
const resolvedFilters = resolveMvfDimensionalityLocalRefs(filtersToUse, insight);
|
|
193
|
-
// Strip noop filters - they have no effect on execution.
|
|
194
|
-
return resolvedFilters.filter((filter) => {
|
|
195
|
-
// Strip noop "All time" date filters (implicit default with no extra configuration).
|
|
196
|
-
if (isDateFilter(filter)) {
|
|
197
|
-
return !isNoopAllTimeDateFilterFixed(filter);
|
|
198
|
-
}
|
|
199
|
-
// Strip noop "All" measure value filters (no conditions).
|
|
200
|
-
if (isMeasureValueFilter(filter)) {
|
|
201
|
-
return hasMeasureValueFilterConditions(filter);
|
|
202
|
-
}
|
|
203
|
-
// Strip noop "All values" attribute filters (negative filter with empty exclusion list).
|
|
204
|
-
return !isAllValuesAttributeFilter(filter);
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
/**
|
|
208
|
-
* Get final filters for the dashboard scheduled export.
|
|
209
|
-
*/
|
|
210
|
-
export const getAppliedDashboardFilters = (selectedAutomationFilters, dashboardHiddenFilters, storeFilters) => {
|
|
211
|
-
if (!storeFilters) {
|
|
212
|
-
return undefined;
|
|
213
|
-
}
|
|
214
|
-
// Hidden filters are never included in selectedAutomationFilters,
|
|
215
|
-
// but we need them to construct proper execution filters, so merge them.
|
|
216
|
-
const selectedFiltersWithHiddenFilters = [...selectedAutomationFilters, ...dashboardHiddenFilters];
|
|
217
|
-
// Strip noop filters - they have no effect on execution.
|
|
218
|
-
return selectedFiltersWithHiddenFilters.filter((filter) => {
|
|
219
|
-
// Strip noop "All time" date filters (implicit default with no extra configuration).
|
|
220
|
-
if (isDashboardDateFilter(filter)) {
|
|
221
|
-
return !isNoopAllTimeDashboardDateFilter(filter);
|
|
222
|
-
}
|
|
223
|
-
// Strip noop "All" measure value filters (no/empty conditions).
|
|
224
|
-
if (isDashboardMeasureValueFilter(filter)) {
|
|
225
|
-
return !isAllDashboardMeasureValueFilter(filter);
|
|
226
|
-
}
|
|
227
|
-
// Strip noop "All values" attribute filters.
|
|
228
|
-
return !isAllValuesDashboardAttributeFilter(filter);
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
83
|
export const getNonHiddenFilters = (filters, attributeConfigs, dateConfigs, isCommonDateFilterHidden, disableDateFilters) => {
|
|
232
84
|
return (filters ?? []).filter((filter) => {
|
|
233
85
|
if (isDashboardAttributeFilterItem(filter)) {
|
|
@@ -279,33 +131,6 @@ export function isAllTimeDateFilterFixed(f) {
|
|
|
279
131
|
}
|
|
280
132
|
return false;
|
|
281
133
|
}
|
|
282
|
-
/**
|
|
283
|
-
* Similar to {@link isAllTimeDateFilterFixed}, but only matches *noop* all-time filters.
|
|
284
|
-
*
|
|
285
|
-
* @remarks
|
|
286
|
-
* Noop all-time filters are implicit defaults and have no effect on execution. All-time filters with `emptyValueHandling`
|
|
287
|
-
* are considered meaningful (they carry extra configuration) and should not be treated as no-op.
|
|
288
|
-
*/
|
|
289
|
-
export function isNoopAllTimeDateFilterFixed(f) {
|
|
290
|
-
// Standard check for noop all-time date filter.
|
|
291
|
-
if (isAllTimeDateFilter(f)) {
|
|
292
|
-
return f.relativeDateFilter.emptyValueHandling === undefined;
|
|
293
|
-
}
|
|
294
|
-
// Analytical Designer may store "all-time" as a relative date filter without from/to.
|
|
295
|
-
// Treat it as no-op only when it does NOT carry extra configuration (e.g. emptyValueHandling).
|
|
296
|
-
if (isRelativeDateFilter(f)) {
|
|
297
|
-
return ((f.relativeDateFilter.from === null || f.relativeDateFilter.from === undefined) &&
|
|
298
|
-
(f.relativeDateFilter.to === null || f.relativeDateFilter.to === undefined) &&
|
|
299
|
-
f.relativeDateFilter.emptyValueHandling === undefined);
|
|
300
|
-
}
|
|
301
|
-
// Not expected, but keep the symmetric safety behavior for absolute filters.
|
|
302
|
-
if (isAbsoluteDateFilter(f)) {
|
|
303
|
-
return ((f.absoluteDateFilter.from === null || f.absoluteDateFilter.from === undefined) &&
|
|
304
|
-
(f.absoluteDateFilter.to === null || f.absoluteDateFilter.to === undefined) &&
|
|
305
|
-
f.absoluteDateFilter.emptyValueHandling === undefined);
|
|
306
|
-
}
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
134
|
export function areFiltersEqual(filter1, filter2) {
|
|
310
135
|
if (isAttributeFilter(filter1) && isAttributeFilter(filter2)) {
|
|
311
136
|
const filter1Ref = filterObjRef(filter1);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type FilterContextItem, type IAutomationVisibleFilter, type IFilter, type IInsight } from "@gooddata/sdk-model";
|
|
2
|
+
import { type ExtendedDashboardWidget } from "../../../../model/types/layoutTypes.js";
|
|
3
|
+
import { type IDashboardFilter } from "../../../../types.js";
|
|
4
|
+
export declare const getVisibleFiltersByFilters: (selectedFilters: FilterContextItem[] | undefined, visibleFiltersMetadata: IAutomationVisibleFilter[] | undefined, storeFilters?: boolean | undefined) => IAutomationVisibleFilter[] | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Get visible filters metadata structured by tab.
|
|
7
|
+
* Applies the same logic as getVisibleFiltersByFilters to each tab's filters.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getVisibleFiltersByFiltersByTab: (filtersByTab: Record<string, FilterContextItem[]> | undefined, visibleFiltersMetadata: Record<string, IAutomationVisibleFilter[]> | undefined, storeFilters?: boolean | undefined) => Record<string, IAutomationVisibleFilter[]> | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Get final execution filters for the widget alert or scheduled export.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getAppliedWidgetFilters: (selectedAutomationFilters: FilterContextItem[], dashboardHiddenFilters: FilterContextItem[], widget: ExtendedDashboardWidget | undefined, insight: IInsight | undefined, commonDateFilterId: string | undefined, mergeInsightFilters?: boolean, withoutWidget?: boolean) => IFilter[];
|
|
14
|
+
/**
|
|
15
|
+
* Get final filters for the dashboard scheduled export.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getAppliedDashboardFilters: (selectedAutomationFilters: FilterContextItem[], dashboardHiddenFilters: FilterContextItem[], storeFilters?: boolean | undefined) => FilterContextItem[] | undefined;
|
|
18
|
+
export declare function dashboardFilterToFilterContextItem(filter: IDashboardFilter, keepDatasets: boolean): FilterContextItem | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve MVF dimensionality localIdRefs to stable identifierRefs using the insight's attributes.
|
|
21
|
+
*
|
|
22
|
+
* Measure value filters may reference attributes in their dimensionality via localIdRef,
|
|
23
|
+
* which is only meaningful within the insight's own execution context. When these filters
|
|
24
|
+
* are used in an alert execution (which may not include the original attributes), the
|
|
25
|
+
* localIdRefs become dangling. This function resolves them to display form identifierRefs.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveMvfDimensionalityLocalRefs(filters: IFilter[], insight: IInsight | undefined): IFilter[];
|
|
28
|
+
/**
|
|
29
|
+
* Similar to {@link isAllTimeDateFilterFixed}, but only matches *noop* all-time filters.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Noop all-time filters are implicit defaults and have no effect on execution. All-time filters with `emptyValueHandling`
|
|
33
|
+
* are considered meaningful (they carry extra configuration) and should not be treated as no-op.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isNoopAllTimeDateFilterFixed(f: IFilter): boolean;
|
|
36
|
+
//# sourceMappingURL=conversions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/filters/conversions.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,OAAO,EACZ,KAAK,QAAQ,EAkChB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEtF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,0BAA0B,kMAmCtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,+OAuB3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,wRA+CnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,sKAyBtC,CAAC;AAEF,wBAAgB,kCAAkC,CAC9C,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,OAAO,GACtB,iBAAiB,GAAG,SAAS,CA8E/B;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC7C,OAAO,EAAE,OAAO,EAAE,EAClB,OAAO,EAAE,QAAQ,GAAG,SAAS,GAC9B,OAAO,EAAE,CA4CX;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CA0BhE"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
// (C) 2025-2026 GoodData Corporation
|
|
2
|
+
import { compact } from "lodash-es";
|
|
3
|
+
import { NotSupported } from "@gooddata/sdk-backend-spi";
|
|
4
|
+
import { attributeLocalId, dashboardFilterLocalIdentifier, filterAttributeElements, filterLocalIdentifier, filterObjRef, hasMeasureValueFilterConditions, insightAttributes, isAbsoluteDateFilter, isAllDashboardMeasureValueFilter, isAllTimeDateFilter, isAllValuesAttributeFilter, isAllValuesDashboardAttributeFilter, isArbitraryAttributeFilter, isAttributeFilterWithSelection, isDashboardDateFilter, isDashboardMeasureValueFilter, isDateFilter, isInsightWidget, isLocalIdRef, isMatchAttributeFilter, isMeasureValueFilter, isNegativeAttributeFilter, isNoopAllTimeDashboardDateFilter, isObjRef, isRelativeBoundedDateFilter, isRelativeDateFilter, measureValueFilterConditions, measureValueFilterMeasure, mergeFilters, newAbsoluteDashboardDateFilter, newAllTimeDashboardDateFilter, newRelativeDashboardDateFilter, } from "@gooddata/sdk-model";
|
|
5
|
+
import { filterContextItemsToDashboardFiltersByWidget } from "../../../../converters/filterConverters.js";
|
|
6
|
+
import { removeIgnoredWidgetFilters } from "../../../../model/utils/widgetFilters.js";
|
|
7
|
+
export const getVisibleFiltersByFilters = (selectedFilters, visibleFiltersMetadata, storeFilters) => {
|
|
8
|
+
if (!storeFilters) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
const filters = (selectedFilters ?? [])
|
|
12
|
+
// Strip noop "All values" attribute filters and "All" measure value filters —
|
|
13
|
+
// they have no effect on execution and should not be stored in visible filters metadata.
|
|
14
|
+
.filter((filter) => !isAllValuesDashboardAttributeFilter(filter) && !isAllDashboardMeasureValueFilter(filter))
|
|
15
|
+
.map((selectedFilter) => {
|
|
16
|
+
const selectedLocalIdentifier = dashboardFilterLocalIdentifier(selectedFilter);
|
|
17
|
+
const targetFilter = (visibleFiltersMetadata ?? []).find((visibleFilter) => {
|
|
18
|
+
return selectedLocalIdentifier === visibleFilter.localIdentifier;
|
|
19
|
+
});
|
|
20
|
+
if (targetFilter && isDashboardDateFilter(selectedFilter)) {
|
|
21
|
+
return {
|
|
22
|
+
...targetFilter,
|
|
23
|
+
// NOTE: despite the name, this flag is used to mark *noop* "All time" filters (implicit default)
|
|
24
|
+
// that are intentionally not stored in automation execution filters.
|
|
25
|
+
isAllTimeDateFilter: isNoopAllTimeDashboardDateFilter(selectedFilter),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return targetFilter;
|
|
29
|
+
});
|
|
30
|
+
return compact(filters);
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Get visible filters metadata structured by tab.
|
|
34
|
+
* Applies the same logic as getVisibleFiltersByFilters to each tab's filters.
|
|
35
|
+
*/
|
|
36
|
+
export const getVisibleFiltersByFiltersByTab = (filtersByTab, visibleFiltersMetadata, storeFilters) => {
|
|
37
|
+
if (!storeFilters || !filtersByTab) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return Object.entries(filtersByTab).reduce((acc, [tabId, tabFilters]) => {
|
|
41
|
+
const visibleFilters = getVisibleFiltersByFilters(tabFilters, visibleFiltersMetadata?.[tabId], true);
|
|
42
|
+
if (visibleFilters && visibleFilters.length > 0) {
|
|
43
|
+
acc[tabId] = visibleFilters;
|
|
44
|
+
}
|
|
45
|
+
return acc;
|
|
46
|
+
}, {});
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Get final execution filters for the widget alert or scheduled export.
|
|
50
|
+
*/
|
|
51
|
+
export const getAppliedWidgetFilters = (selectedAutomationFilters, dashboardHiddenFilters, widget, insight, commonDateFilterId, mergeInsightFilters = false, withoutWidget = false) => {
|
|
52
|
+
// Hidden filters are never included in selectedAutomationFilters,
|
|
53
|
+
// but we need them to construct proper execution filters, so merge them.
|
|
54
|
+
const selectedFiltersWithHiddenFilters = [...selectedAutomationFilters, ...dashboardHiddenFilters];
|
|
55
|
+
// Now, remove ignored filters (some of the hidden filters might be ignored).
|
|
56
|
+
const selectedFiltersWithoutIgnoredFilters = removeIgnoredWidgetFilters(selectedFiltersWithHiddenFilters, widget);
|
|
57
|
+
// Now, convert sanitized selected filters to execution filters shape.
|
|
58
|
+
const selectedExecutionFilters = isInsightWidget(widget)
|
|
59
|
+
? filterContextItemsToDashboardFiltersByWidget(selectedFiltersWithoutIgnoredFilters, widget)
|
|
60
|
+
: withoutWidget
|
|
61
|
+
? filterContextItemsToDashboardFiltersByWidget(selectedFiltersWithoutIgnoredFilters, undefined)
|
|
62
|
+
: [];
|
|
63
|
+
const filtersToUse = mergeInsightFilters
|
|
64
|
+
? mergeFilters(insight?.insight?.filters ?? [], selectedExecutionFilters, commonDateFilterId)
|
|
65
|
+
: selectedExecutionFilters;
|
|
66
|
+
// Resolve MVF dimensionality localIdRefs to stable identifierRefs so that
|
|
67
|
+
// alert executions (which have empty attributes) don't contain dangling refs.
|
|
68
|
+
const resolvedFilters = resolveMvfDimensionalityLocalRefs(filtersToUse, insight);
|
|
69
|
+
// Strip noop filters - they have no effect on execution.
|
|
70
|
+
return resolvedFilters.filter((filter) => {
|
|
71
|
+
// Strip noop "All time" date filters (implicit default with no extra configuration).
|
|
72
|
+
if (isDateFilter(filter)) {
|
|
73
|
+
return !isNoopAllTimeDateFilterFixed(filter);
|
|
74
|
+
}
|
|
75
|
+
// Strip noop "All" measure value filters (no conditions).
|
|
76
|
+
if (isMeasureValueFilter(filter)) {
|
|
77
|
+
return hasMeasureValueFilterConditions(filter);
|
|
78
|
+
}
|
|
79
|
+
// Strip noop "All values" attribute filters (negative filter with empty exclusion list).
|
|
80
|
+
return !isAllValuesAttributeFilter(filter);
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Get final filters for the dashboard scheduled export.
|
|
85
|
+
*/
|
|
86
|
+
export const getAppliedDashboardFilters = (selectedAutomationFilters, dashboardHiddenFilters, storeFilters) => {
|
|
87
|
+
if (!storeFilters) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
// Hidden filters are never included in selectedAutomationFilters,
|
|
91
|
+
// but we need them to construct proper execution filters, so merge them.
|
|
92
|
+
const selectedFiltersWithHiddenFilters = [...selectedAutomationFilters, ...dashboardHiddenFilters];
|
|
93
|
+
// Strip noop filters - they have no effect on execution.
|
|
94
|
+
return selectedFiltersWithHiddenFilters.filter((filter) => {
|
|
95
|
+
// Strip noop "All time" date filters (implicit default with no extra configuration).
|
|
96
|
+
if (isDashboardDateFilter(filter)) {
|
|
97
|
+
return !isNoopAllTimeDashboardDateFilter(filter);
|
|
98
|
+
}
|
|
99
|
+
// Strip noop "All" measure value filters (no/empty conditions).
|
|
100
|
+
if (isDashboardMeasureValueFilter(filter)) {
|
|
101
|
+
return !isAllDashboardMeasureValueFilter(filter);
|
|
102
|
+
}
|
|
103
|
+
// Strip noop "All values" attribute filters.
|
|
104
|
+
return !isAllValuesDashboardAttributeFilter(filter);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
export function dashboardFilterToFilterContextItem(filter, keepDatasets) {
|
|
108
|
+
if (isAttributeFilterWithSelection(filter)) {
|
|
109
|
+
return {
|
|
110
|
+
attributeFilter: {
|
|
111
|
+
negativeSelection: isNegativeAttributeFilter(filter),
|
|
112
|
+
displayForm: filterObjRef(filter),
|
|
113
|
+
attributeElements: filterAttributeElements(filter),
|
|
114
|
+
selectionMode: "multi",
|
|
115
|
+
localIdentifier: filterLocalIdentifier(filter),
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
else if (isArbitraryAttributeFilter(filter)) {
|
|
120
|
+
return {
|
|
121
|
+
arbitraryAttributeFilter: {
|
|
122
|
+
displayForm: filterObjRef(filter),
|
|
123
|
+
values: filter.arbitraryAttributeFilter.values,
|
|
124
|
+
negativeSelection: filter.arbitraryAttributeFilter.negativeSelection ?? false,
|
|
125
|
+
localIdentifier: filterLocalIdentifier(filter),
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
else if (isMatchAttributeFilter(filter)) {
|
|
130
|
+
return {
|
|
131
|
+
matchAttributeFilter: {
|
|
132
|
+
displayForm: filterObjRef(filter),
|
|
133
|
+
operator: filter.matchAttributeFilter.operator,
|
|
134
|
+
literal: filter.matchAttributeFilter.literal,
|
|
135
|
+
caseSensitive: filter.matchAttributeFilter.caseSensitive,
|
|
136
|
+
negativeSelection: filter.matchAttributeFilter.negativeSelection,
|
|
137
|
+
localIdentifier: filterLocalIdentifier(filter),
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
else if (isAbsoluteDateFilter(filter)) {
|
|
142
|
+
return newAbsoluteDashboardDateFilter(filter.absoluteDateFilter.from, filter.absoluteDateFilter.to, keepDatasets ? filter.absoluteDateFilter.dataSet : undefined, filter.absoluteDateFilter.localIdentifier, filter.absoluteDateFilter.emptyValueHandling);
|
|
143
|
+
}
|
|
144
|
+
else if (isAllTimeDateFilter(filter)) {
|
|
145
|
+
return newAllTimeDashboardDateFilter(keepDatasets ? filter.relativeDateFilter.dataSet : undefined, filter.relativeDateFilter.localIdentifier, filter.relativeDateFilter.emptyValueHandling);
|
|
146
|
+
}
|
|
147
|
+
else if (isRelativeDateFilter(filter)) {
|
|
148
|
+
return newRelativeDashboardDateFilter(filter.relativeDateFilter.granularity, filter.relativeDateFilter.from, filter.relativeDateFilter.to, keepDatasets ? filter.relativeDateFilter.dataSet : undefined, filter.relativeDateFilter.localIdentifier, isRelativeBoundedDateFilter(filter) ? filter.relativeDateFilter.boundedFilter : undefined, filter.relativeDateFilter.emptyValueHandling);
|
|
149
|
+
}
|
|
150
|
+
else if (isMeasureValueFilter(filter)) {
|
|
151
|
+
const measure = measureValueFilterMeasure(filter);
|
|
152
|
+
// Dashboard MVFs always reference the measure by ObjRef. Insight MVFs use LocalIdRef
|
|
153
|
+
// (bucket localId) and have no honest representation in the dashboard filter context —
|
|
154
|
+
// they reach this converter only because automation execution filters mix dashboard and
|
|
155
|
+
// insight filters. Caller is responsible for dropping these undefined entries.
|
|
156
|
+
if (!isObjRef(measure)) {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
const conditions = measureValueFilterConditions(filter);
|
|
160
|
+
return {
|
|
161
|
+
dashboardMeasureValueFilter: {
|
|
162
|
+
measure,
|
|
163
|
+
localIdentifier: filter.measureValueFilter.localIdentifier ?? `mvf:${JSON.stringify(measure)}`,
|
|
164
|
+
...(conditions ? { conditions } : {}),
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
throw new NotSupported(`Unsupported filter type! Please provide valid dashboard filter. Filter: ${JSON.stringify(filter)}`);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Resolve MVF dimensionality localIdRefs to stable identifierRefs using the insight's attributes.
|
|
172
|
+
*
|
|
173
|
+
* Measure value filters may reference attributes in their dimensionality via localIdRef,
|
|
174
|
+
* which is only meaningful within the insight's own execution context. When these filters
|
|
175
|
+
* are used in an alert execution (which may not include the original attributes), the
|
|
176
|
+
* localIdRefs become dangling. This function resolves them to display form identifierRefs.
|
|
177
|
+
*/
|
|
178
|
+
export function resolveMvfDimensionalityLocalRefs(filters, insight) {
|
|
179
|
+
if (!insight) {
|
|
180
|
+
return filters;
|
|
181
|
+
}
|
|
182
|
+
const attributeLocalIdToDisplayForm = new Map();
|
|
183
|
+
insightAttributes(insight).forEach((attribute) => {
|
|
184
|
+
attributeLocalIdToDisplayForm.set(attributeLocalId(attribute), attribute.attribute.displayForm);
|
|
185
|
+
});
|
|
186
|
+
if (attributeLocalIdToDisplayForm.size === 0) {
|
|
187
|
+
return filters;
|
|
188
|
+
}
|
|
189
|
+
return filters.map((filter) => {
|
|
190
|
+
if (!isMeasureValueFilter(filter)) {
|
|
191
|
+
return filter;
|
|
192
|
+
}
|
|
193
|
+
const dimensionality = filter.measureValueFilter.dimensionality;
|
|
194
|
+
if (!dimensionality?.length) {
|
|
195
|
+
return filter;
|
|
196
|
+
}
|
|
197
|
+
const resolvedDimensionality = dimensionality.map((item) => {
|
|
198
|
+
if (!isLocalIdRef(item)) {
|
|
199
|
+
return item;
|
|
200
|
+
}
|
|
201
|
+
return attributeLocalIdToDisplayForm.get(item.localIdentifier) ?? item;
|
|
202
|
+
});
|
|
203
|
+
const changed = dimensionality.some((item, i) => item !== resolvedDimensionality[i]);
|
|
204
|
+
if (!changed) {
|
|
205
|
+
return filter;
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
...filter,
|
|
209
|
+
measureValueFilter: {
|
|
210
|
+
...filter.measureValueFilter,
|
|
211
|
+
dimensionality: resolvedDimensionality,
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Similar to {@link isAllTimeDateFilterFixed}, but only matches *noop* all-time filters.
|
|
218
|
+
*
|
|
219
|
+
* @remarks
|
|
220
|
+
* Noop all-time filters are implicit defaults and have no effect on execution. All-time filters with `emptyValueHandling`
|
|
221
|
+
* are considered meaningful (they carry extra configuration) and should not be treated as no-op.
|
|
222
|
+
*/
|
|
223
|
+
export function isNoopAllTimeDateFilterFixed(f) {
|
|
224
|
+
// Standard check for noop all-time date filter.
|
|
225
|
+
if (isAllTimeDateFilter(f)) {
|
|
226
|
+
return f.relativeDateFilter.emptyValueHandling === undefined;
|
|
227
|
+
}
|
|
228
|
+
// Analytical Designer may store "all-time" as a relative date filter without from/to.
|
|
229
|
+
// Treat it as no-op only when it does NOT carry extra configuration (e.g. emptyValueHandling).
|
|
230
|
+
if (isRelativeDateFilter(f)) {
|
|
231
|
+
return ((f.relativeDateFilter.from === null || f.relativeDateFilter.from === undefined) &&
|
|
232
|
+
(f.relativeDateFilter.to === null || f.relativeDateFilter.to === undefined) &&
|
|
233
|
+
f.relativeDateFilter.emptyValueHandling === undefined);
|
|
234
|
+
}
|
|
235
|
+
// Not expected, but keep the symmetric safety behavior for absolute filters.
|
|
236
|
+
if (isAbsoluteDateFilter(f)) {
|
|
237
|
+
return ((f.absoluteDateFilter.from === null || f.absoluteDateFilter.from === undefined) &&
|
|
238
|
+
(f.absoluteDateFilter.to === null || f.absoluteDateFilter.to === undefined) &&
|
|
239
|
+
f.absoluteDateFilter.emptyValueHandling === undefined);
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, getAppliedWidgetFilters, getAppliedDashboardFilters, dashboardFilterToFilterContextItem, resolveMvfDimensionalityLocalRefs, isNoopAllTimeDateFilterFixed, } from "./conversions.js";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/filters/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,0BAA0B,EAC1B,+BAA+B,EAC/B,uBAAuB,EACvB,0BAA0B,EAC1B,kCAAkC,EAClC,iCAAiC,EACjC,4BAA4B,GAC/B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/* oxlint-disable no-barrel-files/no-barrel-files */
|
|
3
|
+
export { getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, getAppliedWidgetFilters, getAppliedDashboardFilters, dashboardFilterToFilterContextItem, resolveMvfDimensionalityLocalRefs, isNoopAllTimeDateFilterFixed, } from "./conversions.js";
|
|
@@ -20,7 +20,7 @@ export function DashboardLoading(props) {
|
|
|
20
20
|
// can tell the rendering has started even before any dashboard data is loaded.
|
|
21
21
|
// The element is a hidden sibling (same as the gd-dashboard-meta export data),
|
|
22
22
|
// so it cannot affect the layout of the loading indicator.
|
|
23
|
-
return (_jsxs(_Fragment, { children: [exportData ? _jsx("div", { style: { display: "none" }, ...exportData }) : null, _jsx(LoadingComponent, {})
|
|
23
|
+
return (_jsxs(_Fragment, { children: [exportData ? _jsx("div", { style: { display: "none" }, ...exportData }) : null, _jsx(LoadingComponent, { className: "sdk-dashboard-loading s-loading" })
|
|
24
24
|
] }));
|
|
25
25
|
}
|
|
26
26
|
return _jsx(DashboardInner, { ...props });
|
|
@@ -6,30 +6,25 @@ export declare function useSlideData(renderMode: RenderMode | undefined): {
|
|
|
6
6
|
slideWidth: number;
|
|
7
7
|
slideHeight: number;
|
|
8
8
|
} | undefined;
|
|
9
|
-
export declare function useSlideSizeStyle(renderMode: RenderMode | undefined, type: LayoutElementType, parentLayoutPath?: ILayoutItemPath): {
|
|
9
|
+
export declare function useSlideSizeStyle(renderMode: RenderMode | undefined, type: LayoutElementType, parentLayoutPath?: ILayoutItemPath, hasHeaderRow?: boolean): {
|
|
10
10
|
width?: undefined;
|
|
11
|
-
gridTemplateRows?: undefined;
|
|
12
|
-
overflow?: undefined;
|
|
13
11
|
height?: undefined;
|
|
14
12
|
} | {
|
|
15
13
|
width: string;
|
|
16
|
-
gridTemplateRows?: undefined;
|
|
17
|
-
overflow?: undefined;
|
|
18
14
|
height?: undefined;
|
|
19
15
|
} | {
|
|
20
16
|
width?: undefined;
|
|
21
|
-
gridTemplateRows
|
|
17
|
+
gridTemplateRows?: string | undefined;
|
|
18
|
+
gridAutoRows: string;
|
|
22
19
|
height: string;
|
|
23
|
-
overflow?: undefined;
|
|
24
20
|
} | {
|
|
25
21
|
width?: undefined;
|
|
26
|
-
gridTemplateRows?: undefined;
|
|
22
|
+
gridTemplateRows?: string | undefined;
|
|
23
|
+
gridAutoRows: string;
|
|
27
24
|
height: string;
|
|
28
25
|
overflow: string;
|
|
29
26
|
} | {
|
|
30
27
|
width?: undefined;
|
|
31
|
-
gridTemplateRows?: undefined;
|
|
32
|
-
overflow?: undefined;
|
|
33
28
|
height: string;
|
|
34
29
|
};
|
|
35
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSlideData.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/useSlideData.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIvE,KAAK,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9E,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,wBAAgB,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS;;;cAW9D;AAED,wBAAgB,iBAAiB,CAC7B,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,IAAI,EAAE,iBAAiB,EACvB,gBAAgB,CAAC,EAAE,eAAe
|
|
1
|
+
{"version":3,"file":"useSlideData.d.ts","sourceRoot":"","sources":["../../../src/presentation/dashboardContexts/useSlideData.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIvE,KAAK,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9E,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,wBAAgB,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS;;;cAW9D;AAED,wBAAgB,iBAAiB,CAC7B,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,IAAI,EAAE,iBAAiB,EACvB,gBAAgB,CAAC,EAAE,eAAe,EAClC,YAAY,UAAQ;;;;;;;;;;;;;;;;;;;;EAmCvB"}
|
|
@@ -12,7 +12,7 @@ export function useSlideData(renderMode) {
|
|
|
12
12
|
slideHeight: slideConfig?.height ?? DEFAULT_SLIDE_HEIGHT,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export function useSlideSizeStyle(renderMode, type, parentLayoutPath) {
|
|
15
|
+
export function useSlideSizeStyle(renderMode, type, parentLayoutPath, hasHeaderRow = false) {
|
|
16
16
|
const data = useSlideData(renderMode);
|
|
17
17
|
if (!data) {
|
|
18
18
|
return {};
|
|
@@ -23,15 +23,21 @@ export function useSlideSizeStyle(renderMode, type, parentLayoutPath) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
if (type === "section") {
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
return {
|
|
27
|
+
// Widgets in export mode have no min-height, their height comes solely from the
|
|
28
|
+
// `height: 100%` chain below the grid item, so the row tracks must have a definite size.
|
|
29
|
+
// Tracks sized from content (`auto`, `max-content`) collapse to the widget title only,
|
|
30
|
+
// because visualizations are absolutely positioned and contribute no intrinsic height.
|
|
31
|
+
//
|
|
32
|
+
// The section header, when rendered, is the first grid item and must take just the space
|
|
33
|
+
// it needs; the remaining rows split what is left. `minmax(0, 1fr)` (rather than plain
|
|
34
|
+
// `1fr`) keeps tall content from pushing the rows over the slide height.
|
|
35
|
+
...(hasHeaderRow ? { gridTemplateRows: "max-content" } : {}),
|
|
36
|
+
gridAutoRows: "minmax(0, 1fr)",
|
|
37
|
+
...(parentLayoutPath && parentLayoutPath.length > 0
|
|
38
|
+
? { height: "100%" }
|
|
39
|
+
: { height: `${data.slideHeight}px`, overflow: "hidden" }),
|
|
40
|
+
};
|
|
35
41
|
}
|
|
36
42
|
return {
|
|
37
43
|
height: "100%",
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { DefaultUiMenuInteractiveItem } from "@gooddata/sdk-ui-kit";
|
|
4
4
|
export function DrillSelectDropdownMenuItem(props) {
|
|
5
|
-
const { item, isFocused } = props;
|
|
5
|
+
const { item, isFocused, isTooltipOpen } = props;
|
|
6
6
|
if (!item.stringTitle) {
|
|
7
7
|
return (_jsx("div", { className: "gd-drill-to-url-modal-picker s-drill-to-url-modal-picker", children: _jsx("div", { className: "gd-spinner small" }) }));
|
|
8
8
|
}
|
|
9
|
-
return (_jsx("div", { className: `s-gd-drill-modal-picker-item s-${item.data.type}`, children: _jsx(DefaultUiMenuInteractiveItem, { item: item, isFocused: isFocused }) }));
|
|
9
|
+
return (_jsx("div", { className: `s-gd-drill-modal-picker-item s-${item.data.type}`, children: _jsx(DefaultUiMenuInteractiveItem, { item: item, isFocused: isFocused, isTooltipOpen: isTooltipOpen }) }));
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardLayoutSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAEH,KAAK,6BAA6B,EACrC,MAAM,iEAAiE,CAAC;AAGzE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAS1E,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACtC,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,OAAO;IACjD,OAAO,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAChD,gBAAgB,CAAC,EAAE,gCAAgC,CAAC,OAAO,CAAC,CAAC;IAC7D,eAAe,CAAC,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAC3D,qBAAqB,CAAC,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACvE,aAAa,CAAC,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACrD,cAAc,EAAE,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACxD,eAAe,CAAC,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAC3D,mBAAmB,EAAE,MAAM,OAAO,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,gCAAgC,CAAC;IACxD,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAC;CACjD;AA2BD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,EAC5C,OAAO,EACP,eAAwC,EACxC,qBAA6C,EAC7C,aAAoC,EACpC,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EACnB,EAAE,4BAA4B,CAAC,OAAO,CAAC,GAAG,YAAY,CAwGtD"}
|