@gooddata/sdk-ui-dashboard 11.70.0-alpha.1 → 11.70.0-alpha.3
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 +50 -83
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/_staging/automation/index.d.ts.map +1 -1
- package/esm/_staging/automation/index.js +18 -8
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.d.ts +11 -0
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.d.ts.map +1 -0
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.js +46 -0
- package/esm/_staging/dashboard/dashboardFilterConverter.d.ts.map +1 -1
- package/esm/_staging/dashboard/dashboardFilterConverter.js +5 -2
- package/esm/_staging/dashboard/parameterizedDateFilters.d.ts +2 -0
- package/esm/_staging/dashboard/parameterizedDateFilters.d.ts.map +1 -0
- package/esm/_staging/dashboard/parameterizedDateFilters.js +2 -0
- package/esm/_staging/drills/drillingUtils.d.ts +2 -2
- package/esm/_staging/drills/drillingUtils.d.ts.map +1 -1
- package/esm/_staging/drills/drillingUtils.js +3 -3
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/kdaDialog/components/bars/AttributeBar.d.ts.map +1 -1
- package/esm/kdaDialog/components/bars/AttributeBar.js +9 -2
- package/esm/kdaDialog/components/bars/DateBar.d.ts.map +1 -1
- package/esm/kdaDialog/components/bars/DateBar.js +2 -1
- package/esm/kdaDialog/composition/hooks/useDrillAttributeHandler.d.ts.map +1 -1
- package/esm/kdaDialog/composition/hooks/useDrillAttributeHandler.js +9 -5
- package/esm/kdaDialog/internalTypes.d.ts +3 -0
- package/esm/kdaDialog/internalTypes.d.ts.map +1 -1
- package/esm/kdaDialog/providers/KdaState.d.ts.map +1 -1
- package/esm/kdaDialog/providers/KdaState.js +1 -0
- package/esm/kdaDialog/types.d.ts +9 -2
- package/esm/kdaDialog/types.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDashboardDefinitionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDashboardDefinitionHandler.js +5 -0
- package/esm/model/commandHandlers/dashboard/common/filterViews.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/filterViews.js +14 -3
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +10 -30
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.d.ts +14 -2
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.js +44 -7
- package/esm/model/commandHandlers/drill/common/filterValuesResolver.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/common/filterValuesResolver.js +11 -4
- package/esm/model/commandHandlers/drill/common/sourceDrillFilters.d.ts +2 -2
- package/esm/model/commandHandlers/drill/common/sourceDrillFilters.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/common/sourceDrillFilters.js +18 -4
- package/esm/model/commandHandlers/drill/drillToDashboardHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/drillToDashboardHandler.js +15 -7
- package/esm/model/commandHandlers/drill/drillToInsightUtils.js +3 -3
- package/esm/model/commandHandlers/drill/getDrillToUrlFilters.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/getDrillToUrlFilters.js +5 -4
- package/esm/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.js +12 -2
- package/esm/model/commandHandlers/filterContext/filterViewHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/filterViewHandler.js +6 -1
- package/esm/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.js +3 -3
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.js +27 -11
- package/esm/model/commands/filters.d.ts +2 -0
- package/esm/model/commands/filters.d.ts.map +1 -1
- package/esm/model/commands/filters.js +11 -2
- package/esm/model/events/drill.d.ts +21 -0
- package/esm/model/events/drill.d.ts.map +1 -1
- package/esm/model/queryServices/queryInsightDateDatasets.js +2 -2
- package/esm/model/queryServices/queryWidgetFilters.js +2 -2
- package/esm/model/store/catalog/catalogSelectors.d.ts +42 -6
- package/esm/model/store/catalog/catalogSelectors.d.ts.map +1 -1
- package/esm/model/store/catalog/catalogSelectors.js +42 -6
- package/esm/model/store/catalog/catalogState.d.ts +22 -2
- package/esm/model/store/catalog/catalogState.d.ts.map +1 -1
- package/esm/model/store/catalog/catalogState.js +6 -1
- package/esm/model/utils/widgetFilters.d.ts +3 -3
- package/esm/model/utils/widgetFilters.d.ts.map +1 -1
- package/esm/model/utils/widgetFilters.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.js +20 -3
- package/esm/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.js +2 -3
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.js +12 -5
- package/esm/presentation/automations/shared/automationFilters/utils.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/utils.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/utils.js +45 -11
- package/esm/presentation/automations/shared/filters/conversions.js +2 -2
- package/esm/presentation/automations/shared/utils/automationUtils.d.ts.map +1 -1
- package/esm/presentation/automations/shared/utils/automationUtils.js +18 -8
- package/esm/presentation/filterBar/dateFilter/DefaultDashboardDateFilter.d.ts.map +1 -1
- package/esm/presentation/filterBar/dateFilter/DefaultDashboardDateFilter.js +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBar.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBar.js +5 -1
- package/esm/presentation/filterBar/utils.d.ts +1 -0
- package/esm/presentation/filterBar/utils.d.ts.map +1 -1
- package/esm/presentation/filterBar/utils.js +3 -1
- package/esm/presentation/insightEditor/filterContext/dateFilters.d.ts.map +1 -1
- package/esm/presentation/insightEditor/filterContext/dateFilters.js +15 -5
- package/esm/presentation/topBar/buttonBar/button/saveButton/DefaultSaveButton.d.ts.map +1 -1
- package/esm/presentation/topBar/buttonBar/button/saveButton/DefaultSaveButton.js +4 -1
- package/esm/presentation/topBar/buttonBar/button/shareButton/DefaultShareButton.d.ts.map +1 -1
- package/esm/presentation/topBar/buttonBar/button/shareButton/DefaultShareButton.js +3 -1
- package/esm/presentation/widget/common/configuration/utils.js +2 -2
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/useExcludedDrillDefinitionFilters.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/useExcludedDrillDefinitionFilters.js +4 -2
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js +7 -2
- package/esm/sdk-ui-dashboard.d.ts +77 -6
- package/package.json +23 -23
|
@@ -5,6 +5,7 @@ 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 { assertNoAbsoluteGranularityDateFilterInDashboards } from "../../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
8
9
|
import { deriveAbsoluteFormGranularitiesFromRelativeForm } from "../../../../_staging/dateFilterConfig/merge.js";
|
|
9
10
|
import { changeDashboardTimezoneOverride } from "../../../commands/timezone.js";
|
|
10
11
|
import { dashboardInitialized } from "../../../events/dashboard.js";
|
|
@@ -187,6 +188,7 @@ function* loadExistingDashboard(ctx, cmd, dashboardRef) {
|
|
|
187
188
|
];
|
|
188
189
|
const [dashboardWithReferences, { resolvedConfig: config, additionalData: { workspaceAutomationsCount, notificationChannelsCount }, }, permissions, entitlements, user, dashboardPermissions, dateHierarchyTemplates, filterViews, exportTimezone, automationTimezone,] = yield all(calls);
|
|
189
190
|
const { dashboard: loadedDashboard, references: { insights, unavailable }, } = dashboardWithReferences;
|
|
191
|
+
assertNoAbsoluteGranularityDateFilterInDashboards([loadedDashboard, cmd.payload.persistedDashboard], ctx.config?.overrideDefaultFilters);
|
|
190
192
|
// must be in the store before filter sanitization/resolution so they can keep forbidden refs;
|
|
191
193
|
// FF off => nothing is ever marked unavailable and behavior is unchanged
|
|
192
194
|
const unavailableReferences = yield call(loadUnavailableReferences, ctx, loadedDashboard, unavailable, Boolean(config.settings?.enableDashboardPartialRendering), !!cmd.payload.persistedDashboard);
|
|
@@ -205,15 +207,14 @@ function* loadExistingDashboard(ctx, cmd, dashboardRef) {
|
|
|
205
207
|
});
|
|
206
208
|
const dashboard = dashboardWithFilterView;
|
|
207
209
|
const enableParameters = config.settings?.enableParameters ?? false;
|
|
208
|
-
const [{ tabsAttributeFilterConfigs, tabsDateFilterConfig, tabsDateFilterConfigSource },
|
|
210
|
+
const [{ tabsAttributeFilterConfigs, tabsDateFilterConfig, tabsDateFilterConfigSource }, catalogParameters, parameterDependencies,] = yield all([
|
|
209
211
|
call(getTabsFilterConfigs, dashboard, config, ctx, cmd),
|
|
210
|
-
call(
|
|
212
|
+
call(loadDashboardParameters, ctx, config.settings),
|
|
211
213
|
call(loadParameterDependencies, ctx, enableParameters ? collectDashboardParameterRoots(dashboard, insights) : []),
|
|
212
214
|
]);
|
|
213
|
-
const workspaceParametersList = Array.isArray(workspaceParameters) ? workspaceParameters : [];
|
|
214
215
|
const initActions = yield call(actionsToInitializeExistingDashboard, ctx, dashboard, insights, config.settings, config.settings.enableImmediateAttributeFilterDisplayAsLabelMigration ?? false, undefined, undefined, tabsAttributeFilterConfigs, tabsDateFilterConfig, tabsDateFilterConfigSource, createDisplayFormMap([], []),
|
|
215
216
|
// the default filter view changes only the working filters, never the persisted ones
|
|
216
|
-
cmd.payload.persistedDashboard ?? loadedDashboard, resolvedActiveTabId,
|
|
217
|
+
cmd.payload.persistedDashboard ?? loadedDashboard, resolvedActiveTabId, catalogParameters.parameters, undefined, preloadedAttributeFilters?.attributesWithReferences);
|
|
217
218
|
const catalogPayload = {
|
|
218
219
|
dateHierarchyTemplates,
|
|
219
220
|
};
|
|
@@ -224,7 +225,7 @@ function* loadExistingDashboard(ctx, cmd, dashboardRef) {
|
|
|
224
225
|
userActions.setUser(user),
|
|
225
226
|
permissionsActions.setPermissions(permissions),
|
|
226
227
|
catalogActions.setCatalogItems(catalogPayload),
|
|
227
|
-
catalogActions.setCatalogParameters(
|
|
228
|
+
catalogActions.setCatalogParameters(catalogParameters),
|
|
228
229
|
catalogActions.setCatalogParameterDependencies({
|
|
229
230
|
status: enableParameters ? "loaded" : "uninitialized",
|
|
230
231
|
byRoot: {},
|
|
@@ -264,6 +265,7 @@ function* loadExistingDashboard(ctx, cmd, dashboardRef) {
|
|
|
264
265
|
}
|
|
265
266
|
function* initializeNewDashboard(ctx, cmd) {
|
|
266
267
|
const { backend } = ctx;
|
|
268
|
+
assertNoAbsoluteGranularityDateFilterInDashboards([], ctx.config?.overrideDefaultFilters);
|
|
267
269
|
const [{ resolvedConfig: config, additionalData: { notificationChannelsCount, workspaceAutomationsCount }, loadedCatalog, }, permissions, entitlements, user, listedDashboards, dateHierarchyTemplates, , exportTimezone,] = yield all([
|
|
268
270
|
// the catalog load rides along with the config resolution because its computed-attributes
|
|
269
271
|
// part is feature-flag dependent - see resolveDashboardConfigAndFeatureFlagDependentCalls
|
|
@@ -276,12 +278,11 @@ function* initializeNewDashboard(ctx, cmd) {
|
|
|
276
278
|
call(loadFilterViews, ctx),
|
|
277
279
|
call(loadExportTimezone, ctx),
|
|
278
280
|
]);
|
|
279
|
-
const
|
|
280
|
-
const workspaceParametersList = Array.isArray(workspaceParameters) ? workspaceParameters : [];
|
|
281
|
+
const catalogParameters = yield call(loadDashboardParameters, ctx, config.settings);
|
|
281
282
|
const dateFilterConfig = deriveAbsoluteFormGranularitiesFromRelativeForm(config.dateFilterConfig, !!config.settings.enableAbsoluteDateFilterGranularity);
|
|
282
283
|
const { initActions, dashboard, insights } = yield call(actionsToInitializeNewDashboard, ctx, config.settings, dateFilterConfig, loadedCatalog
|
|
283
284
|
? createDisplayFormMapFromCatalog(loadedCatalog.catalog, loadedCatalog.computedAttributes)
|
|
284
|
-
: createDisplayFormMap([], []), cmd.payload.initialTabId,
|
|
285
|
+
: createDisplayFormMap([], []), cmd.payload.initialTabId, catalogParameters.parameters);
|
|
285
286
|
const enableParameters = config.settings?.enableParameters ?? false;
|
|
286
287
|
const parameterDependencies = yield call(loadParameterDependencies, ctx, enableParameters ? collectDashboardParameterRoots(dashboard, insights) : []);
|
|
287
288
|
const batch = batchActions([
|
|
@@ -299,7 +300,7 @@ function* initializeNewDashboard(ctx, cmd) {
|
|
|
299
300
|
computedAttributes: loadedCatalog?.computedAttributes ?? [],
|
|
300
301
|
dateHierarchyTemplates: dateHierarchyTemplates,
|
|
301
302
|
}),
|
|
302
|
-
catalogActions.setCatalogParameters(
|
|
303
|
+
catalogActions.setCatalogParameters(catalogParameters),
|
|
303
304
|
catalogActions.setCatalogParameterDependencies({
|
|
304
305
|
status: enableParameters ? "loaded" : "uninitialized",
|
|
305
306
|
byRoot: {},
|
|
@@ -355,27 +356,6 @@ export function* requestCatalog(ctx, cmd) {
|
|
|
355
356
|
dateHierarchyTemplates: dateHierarchyTemplates,
|
|
356
357
|
}));
|
|
357
358
|
}
|
|
358
|
-
function* loadWorkspaceParametersWithStatus(ctx, settings) {
|
|
359
|
-
if (!settings?.enableParameters) {
|
|
360
|
-
return "gated-off";
|
|
361
|
-
}
|
|
362
|
-
try {
|
|
363
|
-
const result = yield call(loadDashboardParameters, ctx, settings.enableStringParameters ?? true);
|
|
364
|
-
return result;
|
|
365
|
-
}
|
|
366
|
-
catch {
|
|
367
|
-
return "failed";
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
function makeCatalogParametersPayload(result) {
|
|
371
|
-
if (result === "gated-off") {
|
|
372
|
-
return { status: "gated-off", parameters: [] };
|
|
373
|
-
}
|
|
374
|
-
if (result === "failed") {
|
|
375
|
-
return { status: "failed", parameters: [] };
|
|
376
|
-
}
|
|
377
|
-
return { status: "loaded", parameters: result };
|
|
378
|
-
}
|
|
379
359
|
/**
|
|
380
360
|
* The attributes of the attribute filters, which match the filters of the tabs when a selection is
|
|
381
361
|
* written to the other tabs: the default view of the active tab, or embed-url filter overrides.
|
package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ISettings } from "@gooddata/sdk-model";
|
|
2
|
+
import { type ICatalogParametersState } from "../../../store/catalog/catalogState.js";
|
|
2
3
|
import { type DashboardContext } from "../../../types/commonTypes.js";
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Loads the workspace parameters into the shape of the catalog parameters slice: one request, two lists,
|
|
6
|
+
* each with its own status. Never throws.
|
|
7
|
+
*
|
|
8
|
+
* Number and string parameters load only when the `enableParameters` setting is on, date range parameters
|
|
9
|
+
* only when the `enableDateRangeParameters` setting is on. With neither on, no request is sent. A list whose
|
|
10
|
+
* setting is off is empty and `gated-off`, whatever the request did. When the request fails, each list whose
|
|
11
|
+
* setting is on is `failed` and the dashboard renders without parameters. String parameters are kept only
|
|
12
|
+
* when `enableStringParameters` is on (the default). Each list keeps only the kinds it is typed for. A
|
|
13
|
+
* backend that rejects a kind this SDK does not know fails the whole request.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadDashboardParameters(ctx: DashboardContext, settings: ISettings | undefined): Promise<ICatalogParametersState>;
|
|
4
16
|
//# sourceMappingURL=loadDashboardParameters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadDashboardParameters.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"loadDashboardParameters.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,SAAS,EAIjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CACzC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,SAAS,GAAG,SAAS,GAChC,OAAO,CAAC,uBAAuB,CAAC,CA6BlC"}
|
package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.js
CHANGED
|
@@ -1,9 +1,46 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { isNumberParameterDefinition, isScalarParameterMetadataObject, } from "@gooddata/sdk-model";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { isDateRangeParameterMetadataObject, isNumberParameterDefinition, isScalarParameterMetadataObject, } from "@gooddata/sdk-model";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the workspace parameters into the shape of the catalog parameters slice: one request, two lists,
|
|
5
|
+
* each with its own status. Never throws.
|
|
6
|
+
*
|
|
7
|
+
* Number and string parameters load only when the `enableParameters` setting is on, date range parameters
|
|
8
|
+
* only when the `enableDateRangeParameters` setting is on. With neither on, no request is sent. A list whose
|
|
9
|
+
* setting is off is empty and `gated-off`, whatever the request did. When the request fails, each list whose
|
|
10
|
+
* setting is on is `failed` and the dashboard renders without parameters. String parameters are kept only
|
|
11
|
+
* when `enableStringParameters` is on (the default). Each list keeps only the kinds it is typed for. A
|
|
12
|
+
* backend that rejects a kind this SDK does not know fails the whole request.
|
|
13
|
+
*/
|
|
14
|
+
export async function loadDashboardParameters(ctx, settings) {
|
|
15
|
+
const enableParameters = settings?.enableParameters ?? false;
|
|
16
|
+
const enableDateRangeParameters = settings?.enableDateRangeParameters ?? false;
|
|
17
|
+
if (!enableParameters && !enableDateRangeParameters) {
|
|
18
|
+
return {
|
|
19
|
+
status: "gated-off",
|
|
20
|
+
parameters: [],
|
|
21
|
+
dateRangeParametersStatus: "gated-off",
|
|
22
|
+
dateRangeParameters: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const { status, all } = await queryParameters(ctx);
|
|
26
|
+
const enableStringParameters = settings?.enableStringParameters ?? true;
|
|
27
|
+
return {
|
|
28
|
+
status: enableParameters ? status : "gated-off",
|
|
29
|
+
parameters: enableParameters
|
|
30
|
+
? all
|
|
31
|
+
.filter(isScalarParameterMetadataObject)
|
|
32
|
+
.filter((parameter) => enableStringParameters || isNumberParameterDefinition(parameter.definition))
|
|
33
|
+
: [],
|
|
34
|
+
dateRangeParametersStatus: enableDateRangeParameters ? status : "gated-off",
|
|
35
|
+
dateRangeParameters: enableDateRangeParameters ? all.filter(isDateRangeParameterMetadataObject) : [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function queryParameters({ backend, workspace, }) {
|
|
39
|
+
try {
|
|
40
|
+
const firstPage = await backend.workspace(workspace).parameters().getParametersQuery().query();
|
|
41
|
+
return { status: "loaded", all: await firstPage.all() };
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return { status: "failed", all: [] };
|
|
45
|
+
}
|
|
9
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterValuesResolver.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/drill/common/filterValuesResolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"filterValuesResolver.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/drill/common/filterValuesResolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAmBpE,OAAO,EAGH,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACxB,MAAM,+BAA+B,CAAC;AAIvC;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACrC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,OAAO,CAAC,EAAE,kBAAkB,EAC5B,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAoDhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { invariant } from "ts-invariant";
|
|
3
|
-
import { attributeElementsCount, filterAttributeElements, filterObjRef, isAbsoluteDateFilter, isAttributeFilter,
|
|
3
|
+
import { attributeElementsCount, filterAttributeElements, filterObjRef, isAbsoluteDateFilter, isAbsoluteGranularityDateFilter, isAttributeFilter, isDateFilterOfAnyType, isObjRef, isRelativeDateFilter, objRefToString, } from "@gooddata/sdk-model";
|
|
4
4
|
import { _isEmpty } from "@gooddata/util";
|
|
5
5
|
const MAX_ELEMENTS_COUNT_PER_REQUEST = 500; // should cover all attribute filters created by UI where we have 500 elements limit
|
|
6
6
|
/**
|
|
@@ -24,14 +24,21 @@ export async function resolveFilterValues(filters, backend, workspace) {
|
|
|
24
24
|
};
|
|
25
25
|
return Promise.resolve(resolved);
|
|
26
26
|
}
|
|
27
|
+
// The drill event gets no days for this filter, because its periods are not resolved to days yet.
|
|
28
|
+
// The days of a week depend on the week start setting and an open range has no first or last day.
|
|
29
|
+
// Sending the periods instead would make the receiver read them as days.
|
|
30
|
+
if (isAbsoluteGranularityDateFilter(filter)) {
|
|
31
|
+
return Promise.resolve(undefined);
|
|
32
|
+
}
|
|
27
33
|
invariant(backend, `backend needs to be provided for this type of filter: ${filter}`);
|
|
28
34
|
invariant(workspace, `workspace needs to be provided for this type of filter: ${filter}`);
|
|
29
35
|
if (isAttributeFilter(filter)) {
|
|
30
36
|
return resolveAttributeFilterValues(filter, backend, workspace);
|
|
31
37
|
}
|
|
32
|
-
else {
|
|
38
|
+
else if (isRelativeDateFilter(filter)) {
|
|
33
39
|
return resolveRelativeDateFilterValues(filter, backend, workspace);
|
|
34
40
|
}
|
|
41
|
+
return Promise.resolve(undefined);
|
|
35
42
|
});
|
|
36
43
|
return Promise.all(promises).then((resolvedValues) => {
|
|
37
44
|
const resolvedValuesMap = {
|
|
@@ -42,7 +49,7 @@ export async function resolveFilterValues(filters, backend, workspace) {
|
|
|
42
49
|
const filter = filters[index];
|
|
43
50
|
const ref = filterObjRef(filter);
|
|
44
51
|
invariant(ref, `filter without reference not supported: ${filter}`);
|
|
45
|
-
if (
|
|
52
|
+
if (isDateFilterOfAnyType(filter)) {
|
|
46
53
|
const value = getResolvedFilterValues(resolvedValues, filter, index);
|
|
47
54
|
if (value) {
|
|
48
55
|
result.dateFilters.push(value);
|
|
@@ -122,7 +129,7 @@ async function resolveAttributeFilterValues(filter, backend, workspace) {
|
|
|
122
129
|
}, result);
|
|
123
130
|
}
|
|
124
131
|
function getResolvedFilterValues(array, filter, index) {
|
|
125
|
-
if (
|
|
132
|
+
if (isDateFilterOfAnyType(filter)) {
|
|
126
133
|
return array[index];
|
|
127
134
|
}
|
|
128
135
|
return array[index];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DateFilterOfAnyType, type IAttributeFilter, type IDrillToDashboard, type IDrillToInsight, type IFilter, type IInsight, type SourceInsightFilterObjRef } from "@gooddata/sdk-model";
|
|
2
2
|
import { type SourceFilter } from "./mergeFilters.js";
|
|
3
3
|
type IDrillDefinitionWithIncludedSourceFilters = Pick<IDrillToDashboard | IDrillToInsight, "origin" | "includedSourceInsightFiltersObjRefs" | "includedSourceMeasureFiltersObjRefs">;
|
|
4
4
|
export declare function getIncludedSourceInsightFilters(sourceInsight: IInsight | null, includedSourceInsightFiltersObjRefs: SourceInsightFilterObjRef[]): IFilter[];
|
|
5
|
-
export declare function getIncludedSourceMeasureFilters(sourceInsight: IInsight | null, drillDefinition: IDrillDefinitionWithIncludedSourceFilters): Array<IAttributeFilter |
|
|
5
|
+
export declare function getIncludedSourceMeasureFilters(sourceInsight: IInsight | null, drillDefinition: IDrillDefinitionWithIncludedSourceFilters): Array<IAttributeFilter | DateFilterOfAnyType>;
|
|
6
6
|
export declare function getIncludedSourceFiltersForDashboard(sourceInsight: IInsight | null, drillDefinition: IDrillDefinitionWithIncludedSourceFilters): Array<SourceFilter>;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=sourceDrillFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceDrillFilters.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/drill/common/sourceDrillFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,
|
|
1
|
+
{"version":3,"file":"sourceDrillFilters.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/drill/common/sourceDrillFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,mBAAmB,EAExB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,QAAQ,EAGb,KAAK,yBAAyB,EAUjC,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,KAAK,yCAAyC,GAAG,IAAI,CACjD,iBAAiB,GAAG,eAAe,EACnC,QAAQ,GAAG,qCAAqC,GAAG,qCAAqC,CAC3F,CAAC;AAEF,wBAAgB,+BAA+B,CAC3C,aAAa,EAAE,QAAQ,GAAG,IAAI,EAC9B,mCAAmC,EAAE,yBAAyB,EAAE,GACjE,OAAO,EAAE,CAYX;AAED,wBAAgB,+BAA+B,CAC3C,aAAa,EAAE,QAAQ,GAAG,IAAI,EAC9B,eAAe,EAAE,yCAAyC,GAC3D,KAAK,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAc/C;AAED,wBAAgB,oCAAoC,CAChD,aAAa,EAAE,QAAQ,GAAG,IAAI,EAC9B,eAAe,EAAE,yCAAyC,GAC3D,KAAK,CAAC,YAAY,CAAC,CAqBrB"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
import { filterMeasureRef, insightFilters, insightMeasures, isAttributeFilter,
|
|
2
|
+
import { filterMeasureRef, insightFilters, insightMeasures, isAbsoluteGranularityDateFilter, isAttributeFilter, isDateFilterOfAnyType, isMeasureValueFilter, isParameterizedDateFilter, isRankingFilter, } from "@gooddata/sdk-model";
|
|
3
|
+
import { ABSOLUTE_GRANULARITY_DATE_FILTER_NOT_SUPPORTED } from "../../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
4
|
+
import { PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED } from "../../../../_staging/dashboard/parameterizedDateFilters.js";
|
|
3
5
|
import { getSourceMeasureFiltersForDrillDefinition, isMatchingSourceInsightFilter, resolveSourceMeasureRef, } from "../../../../_staging/drills/drillingUtils.js";
|
|
4
6
|
export function getIncludedSourceInsightFilters(sourceInsight, includedSourceInsightFiltersObjRefs) {
|
|
5
7
|
const sourceFilters = sourceInsight
|
|
6
8
|
? insightFilters(sourceInsight).filter((filter) => isAttributeFilter(filter) ||
|
|
7
|
-
|
|
9
|
+
isDateFilterOfAnyType(filter) ||
|
|
8
10
|
isMeasureValueFilter(filter) ||
|
|
9
11
|
isRankingFilter(filter))
|
|
10
12
|
: [];
|
|
@@ -19,15 +21,27 @@ export function getIncludedSourceMeasureFilters(sourceInsight, drillDefinition)
|
|
|
19
21
|
}
|
|
20
22
|
export function getIncludedSourceFiltersForDashboard(sourceInsight, drillDefinition) {
|
|
21
23
|
const sourceInsightMeasures = sourceInsight ? insightMeasures(sourceInsight) : [];
|
|
22
|
-
const sourceMeasureFilters = getIncludedSourceMeasureFilters(sourceInsight, drillDefinition);
|
|
24
|
+
const sourceMeasureFilters = getIncludedSourceMeasureFilters(sourceInsight, drillDefinition).filter(isSourceFilterSupportedByDashboard);
|
|
23
25
|
const sourceInsightFilters = getIncludedSourceInsightFilters(sourceInsight, drillDefinition.includedSourceInsightFiltersObjRefs ?? [])
|
|
24
26
|
.filter((filter) => {
|
|
25
|
-
return isAttributeFilter(filter) ||
|
|
27
|
+
return (isAttributeFilter(filter) || isDateFilterOfAnyType(filter) || isMeasureValueFilter(filter));
|
|
26
28
|
})
|
|
29
|
+
.filter(isSourceFilterSupportedByDashboard)
|
|
27
30
|
.flatMap((filter) => normalizeSourceFilterForDashboard(filter, sourceInsightMeasures));
|
|
28
31
|
// Keep the same precedence as drill-to-insight: measure filters win over source insight filters.
|
|
29
32
|
return [...sourceMeasureFilters, ...sourceInsightFilters];
|
|
30
33
|
}
|
|
34
|
+
function isSourceFilterSupportedByDashboard(filter) {
|
|
35
|
+
if (isAbsoluteGranularityDateFilter(filter)) {
|
|
36
|
+
console.warn(`Skipping a source insight filter. ${ABSOLUTE_GRANULARITY_DATE_FILTER_NOT_SUPPORTED}`, filter);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if (isParameterizedDateFilter(filter)) {
|
|
40
|
+
console.warn(`Skipping a source insight filter. ${PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED}`, filter);
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
31
45
|
function normalizeSourceFilterForDashboard(filter, sourceInsightMeasures) {
|
|
32
46
|
if (!isMeasureValueFilter(filter)) {
|
|
33
47
|
return [filter];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drillToDashboardHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/drill/drillToDashboardHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"drillToDashboardHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/drill/drillToDashboardHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAiC/C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACH,KAAK,kCAAkC,EAG1C,MAAM,uBAAuB,CAAC;AAmB/B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAWnE,wBAAiB,uBAAuB,CACpC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,iBAAiB,GACvB,YAAY,CAAC,kCAAkC,CAAC,CAoIlD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { call, put, select } from "redux-saga/effects";
|
|
3
3
|
import { invariant } from "ts-invariant";
|
|
4
|
-
import { areObjRefsEqual, dashboardAttributeFilterItemToAttributeFilter, dashboardDateFilterToDateFilterByWidget, dashboardFilterLocalIdentifier, dashboardMeasureValueFilterToMeasureValueFilter, insightMeasures, isDashboardAttributeFilter, isDashboardMeasureValueFilter,
|
|
4
|
+
import { areObjRefsEqual, dashboardAbsoluteGranularityDateFilterToDateFilterByWidget, dashboardAttributeFilterItemToAttributeFilter, dashboardDateFilterToDateFilterByWidget, dashboardFilterLocalIdentifier, dashboardMeasureValueFilterToMeasureValueFilter, insightMeasures, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardMeasureValueFilter, isDateFilterOfAnyType, isSimpleMeasure, measureFilters, newAllTimeDashboardDateFilter, } from "@gooddata/sdk-model";
|
|
5
5
|
import { _compact, _isEmpty, _isEqual } from "@gooddata/util";
|
|
6
6
|
import { switchDashboardTab } from "../../commands/tabs.js";
|
|
7
7
|
import { drillToDashboardRequested, drillToDashboardResolved, } from "../../events/drill.js";
|
|
@@ -140,10 +140,18 @@ function convertFilterItemsToFilters(filter, widget) {
|
|
|
140
140
|
if ("dateFilter" in filter) {
|
|
141
141
|
return dashboardDateFilterToDateFilterByWidget(filter, widget);
|
|
142
142
|
}
|
|
143
|
+
if ("dashboardAbsoluteGranularityDateFilter" in filter) {
|
|
144
|
+
return dashboardAbsoluteGranularityDateFilterToDateFilterByWidget(filter, widget);
|
|
145
|
+
}
|
|
143
146
|
if (isDashboardMeasureValueFilter(filter)) {
|
|
144
147
|
return dashboardMeasureValueFilterToMeasureValueFilter(filter);
|
|
145
148
|
}
|
|
146
|
-
|
|
149
|
+
if (isDashboardAttributeFilterItem(filter)) {
|
|
150
|
+
return dashboardAttributeFilterItemToAttributeFilter(filter);
|
|
151
|
+
}
|
|
152
|
+
const unknownFilter = filter;
|
|
153
|
+
console.warn("Skipping a filter of an unknown type.", unknownFilter);
|
|
154
|
+
return undefined;
|
|
147
155
|
}
|
|
148
156
|
function removeIgnoredDashboardFilters(filters, ignoredDashboardFilterIds) {
|
|
149
157
|
if (!ignoredDashboardFilterIds.size) {
|
|
@@ -156,10 +164,10 @@ function removeIgnoredDashboardFilters(filters, ignoredDashboardFilterIds) {
|
|
|
156
164
|
}
|
|
157
165
|
function* getWidgetAwareDashboardFilters(ctx, widget, filterContextItems) {
|
|
158
166
|
const attributeFilterConfigs = yield select(selectAttributeFilterConfigsOverrides);
|
|
159
|
-
const filtersPairs = filterContextItems.
|
|
160
|
-
filter
|
|
161
|
-
originalFilter:
|
|
162
|
-
})
|
|
167
|
+
const filtersPairs = filterContextItems.flatMap((originalFilter) => {
|
|
168
|
+
const filter = convertFilterItemsToFilters(originalFilter, widget);
|
|
169
|
+
return filter ? [{ filter, originalFilter }] : [];
|
|
170
|
+
});
|
|
163
171
|
const widgetFilters = yield call(getResolvedFiltersForWidget, ctx, widget, filtersPairs.map((pair) => pair.filter), attributeFilterConfigs);
|
|
164
172
|
return filtersPairs
|
|
165
173
|
.filter((pair) => widgetFilters.some((wf) => _isEqual(wf, pair.filter)))
|
|
@@ -172,7 +180,7 @@ function isDateFilterDisabled(insight) {
|
|
|
172
180
|
: measures.every((measure) => {
|
|
173
181
|
if (isSimpleMeasure(measure)) {
|
|
174
182
|
const filters = measureFilters(measure);
|
|
175
|
-
return !!filters?.some(
|
|
183
|
+
return !!filters?.some(isDateFilterOfAnyType);
|
|
176
184
|
}
|
|
177
185
|
return true;
|
|
178
186
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
import { areObjRefsEqual, attributeLocalId, filterMeasureRef, filterObjRef, insightAttributes, insightFilters, insightMeasures, insightSetFilters,
|
|
2
|
+
import { areObjRefsEqual, attributeLocalId, filterMeasureRef, filterObjRef, insightAttributes, insightFilters, insightMeasures, insightSetFilters, isDateFilterOfAnyType, isLocalIdRef, isMeasureValueFilter, isRankingFilter, measureLocalId, measureValueFilterDimensionality, } from "@gooddata/sdk-model";
|
|
3
3
|
import { addIntersectionFiltersToInsight } from "@gooddata/sdk-ui-ext";
|
|
4
4
|
import { removeIgnoredValuesFromDrillIntersection } from "./common/intersectionUtils.js";
|
|
5
5
|
import { getIncludedSourceInsightFilters, getIncludedSourceMeasureFilters, } from "./common/sourceDrillFilters.js";
|
|
@@ -87,7 +87,7 @@ function stripInvalidDimensionality(filter, targetAttributeLocalIds) {
|
|
|
87
87
|
}
|
|
88
88
|
function mergeInsightFilters(sourceFiltersToApply, targetFilters) {
|
|
89
89
|
const sourceContainsMeasureValueFilter = sourceFiltersToApply.some((filter) => isMeasureValueFilter(filter) || isRankingFilter(filter));
|
|
90
|
-
const sourceDateFilters = sourceFiltersToApply.filter(
|
|
90
|
+
const sourceDateFilters = sourceFiltersToApply.filter(isDateFilterOfAnyType);
|
|
91
91
|
const sourceDateFilterRefs = sourceDateFilters.flatMap((sourceFilter) => {
|
|
92
92
|
const sourceRef = filterObjRef(sourceFilter);
|
|
93
93
|
return sourceRef ? [sourceRef] : [];
|
|
@@ -97,7 +97,7 @@ function mergeInsightFilters(sourceFiltersToApply, targetFilters) {
|
|
|
97
97
|
(isMeasureValueFilter(targetFilter) || isRankingFilter(targetFilter))) {
|
|
98
98
|
return false;
|
|
99
99
|
}
|
|
100
|
-
if (!
|
|
100
|
+
if (!isDateFilterOfAnyType(targetFilter)) {
|
|
101
101
|
return true;
|
|
102
102
|
}
|
|
103
103
|
const targetRef = filterObjRef(targetFilter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDrillToUrlFilters.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/drill/getDrillToUrlFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAEH,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"getDrillToUrlFilters.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/drill/getDrillToUrlFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAEH,KAAK,MAAM,EAKd,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAyB,MAAM,4BAA4B,CAAC;AAI5G,wBAAiB,sCAAsC,CACnD,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,GAClB,YAAY,CAAC,WAAW,CAAC,CA2C3B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { call, select } from "redux-saga/effects";
|
|
3
|
-
import { isAttributeFilter,
|
|
4
|
-
import { isDashboardFilter } from "../../../types.js";
|
|
3
|
+
import { isAttributeFilter, isDashboardFilterOfAnyType, isDateFilterOfAnyType, isMeasureValueFilter, } from "@gooddata/sdk-model";
|
|
5
4
|
import { queryWidgetFilters } from "../../queries/widgets.js";
|
|
6
5
|
import { query } from "../../store/_infra/queryCall.js";
|
|
7
6
|
import { selectEnableFilterValuesResolutionInDrillEvents } from "../../store/config/configSelectors.js";
|
|
@@ -14,10 +13,12 @@ export function* getDrillToUrlFiltersWithResolvedValues(ctx, widgetRef) {
|
|
|
14
13
|
// know about attribute and date filters and throw on anything else.
|
|
15
14
|
// TODO INE: revisit when MVFs become part of the drill payload in
|
|
16
15
|
// https://gooddata.atlassian.net/browse/CQ-2286.
|
|
17
|
-
const filters = effectiveFilters
|
|
16
|
+
const filters = effectiveFilters
|
|
17
|
+
.filter(isDashboardFilterOfAnyType)
|
|
18
|
+
.filter((f) => !isMeasureValueFilter(f));
|
|
18
19
|
const enableFilterValuesResolutionInDrillEvents = yield select(selectEnableFilterValuesResolutionInDrillEvents);
|
|
19
20
|
if (enableFilterValuesResolutionInDrillEvents) {
|
|
20
|
-
const resolvableFilters = filters.filter((f) => isAttributeFilter(f) ||
|
|
21
|
+
const resolvableFilters = filters.filter((f) => isAttributeFilter(f) || isDateFilterOfAnyType(f));
|
|
21
22
|
try {
|
|
22
23
|
const resolvedFilterValues = yield call(resolveFilterValues, resolvableFilters, ctx.backend, ctx.workspace);
|
|
23
24
|
return { filters, resolvedFilterValues };
|
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;AAgD/C,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAuC9E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAiOnE,wBAAiB,mCAAmC,CAChD,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,4BAA4B,GAClC,YAAY,CAAC,IAAI,CAAC,CAgQpB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
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, isAllTimeDashboardDateFilter, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardMeasureValueFilter, isDashboardTextAttributeFilter, isSingleSelectionFilter, isUriRef, objRefToString, serializeObjRef, updateAttributeElementsItems, } from "@gooddata/sdk-model";
|
|
4
|
+
import { areObjRefsEqual, attributeElementsIsEmpty, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemFilterElementsBy, dashboardAttributeFilterItemFilterElementsByDate, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemValidateElementsBy, dashboardFilterLocalIdentifier, dashboardFilterObjRef, dashboardMeasureValueFilterLocalIdentifier, getAttributeElementsItems, isAbsoluteGranularityDateFilter, isAllTimeDashboardDateFilter, isDashboardAbsoluteGranularityDateFilter, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardDateFilterOfAnyType, isDashboardMeasureValueFilter, 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_NOT_SUPPORTED } from "../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
6
7
|
import { dashboardFilterToFilterContextItem } from "../../../_staging/dashboard/dashboardFilterContext.js";
|
|
8
|
+
import { PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED } from "../../../_staging/dashboard/parameterizedDateFilters.js";
|
|
7
9
|
import { invalidArgumentsProvided } from "../../events/general.js";
|
|
8
10
|
import { dispatchDashboardEvent } from "../../store/_infra/eventDispatcher.js";
|
|
9
11
|
import { selectRestrictedDashboardFilterLocalIdentifiers, selectRestrictedDashboardFilterLocalIdentifiersForTab, } from "../../store/filtering/dashboardFilterSelectors.js";
|
|
@@ -132,6 +134,14 @@ export function* changeFilterContextSelectionHandler(ctx, cmd) {
|
|
|
132
134
|
return;
|
|
133
135
|
}
|
|
134
136
|
}
|
|
137
|
+
if (filters.some((filter) => isDashboardAbsoluteGranularityDateFilter(filter) || isAbsoluteGranularityDateFilter(filter))) {
|
|
138
|
+
yield dispatchDashboardEvent(invalidArgumentsProvided(ctx, cmd, ABSOLUTE_GRANULARITY_DATE_FILTER_NOT_SUPPORTED));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (filters.some(isParameterizedDateFilter)) {
|
|
142
|
+
yield dispatchDashboardEvent(invalidArgumentsProvided(ctx, cmd, PARAMETERIZED_DATE_FILTER_NOT_SUPPORTED));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
135
145
|
// Cross-filtering is always compatible with dashboard tabs now
|
|
136
146
|
// (removed the check that prevented cross-filtering without tabs)
|
|
137
147
|
const unavailableObjects = yield select(selectUnavailableObjects);
|
|
@@ -163,7 +173,7 @@ export function* changeFilterContextSelectionHandler(ctx, cmd) {
|
|
|
163
173
|
};
|
|
164
174
|
const normalizedFilters = _compact(filters.map((filter) => {
|
|
165
175
|
if (isDashboardAttributeFilterItem(filter) ||
|
|
166
|
-
|
|
176
|
+
isDashboardDateFilterOfAnyType(filter) ||
|
|
167
177
|
isDashboardMeasureValueFilter(filter)) {
|
|
168
178
|
return filter;
|
|
169
179
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterViewHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/filterContext/filterViewHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"filterViewHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/filterContext/filterViewHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAmB/C,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAoClE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAiBnE,wBAAiB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,CAqEtG;AAMD,wBAAiB,uBAAuB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,iBAAiB,GAAG,YAAY,CAAC,IAAI,CAAC,CAsB1G;AAOD,wBAAiB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAG,YAAY,CAAC,IAAI,CAAC,CAiBxG;AA6DD;;;;;;;GAOG;AACH,wBAAiB,qCAAqC,CAClD,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,mBAAmB,EACxB,kBAAkB,EAAE,MAAM,GAC3B,YAAY,CAAC,IAAI,CAAC,CAyCpB;AAMD,wBAAiB,6BAA6B,CAC1C,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,uBAAuB,GAC7B,YAAY,CAAC,IAAI,CAAC,CAuBpB;AAED,wBAAiB,wBAAwB,CAAC,GAAG,EAAE,gBAAgB,GAAG,YAAY,CAAC,IAAI,CAAC,CAcnF"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { call, put, select } from "redux-saga/effects";
|
|
3
3
|
import { areObjRefsEqual, isDashboardAttributeFilter, } from "@gooddata/sdk-model";
|
|
4
4
|
import { defaultErrorHandler } from "@gooddata/sdk-ui";
|
|
5
|
+
import { ABSOLUTE_GRANULARITY_DATE_FILTER_NOT_SUPPORTED, containsAbsoluteGranularityDateFilter, } from "../../../_staging/dashboard/absoluteGranularityDateFilters.js";
|
|
5
6
|
import { changeFilterContextSelectionByParams, } from "../../commands/filters.js";
|
|
6
7
|
import { changeParameterValues } from "../../commands/parameters.js";
|
|
7
8
|
import { filterViewApplicationFailed, filterViewApplicationSucceeded, filterViewCreationFailed, filterViewCreationSucceeded, filterViewDefaultStatusChangeFailed, filterViewDefaultStatusChangeSucceeded, filterViewDeletionFailed, filterViewDeletionSucceeded, } from "../../events/filters.js";
|
|
@@ -97,7 +98,11 @@ function* findFilterView(ref) {
|
|
|
97
98
|
}
|
|
98
99
|
export function* applyFilterViewHandler(ctx, cmd) {
|
|
99
100
|
const filterView = yield call(findFilterView, cmd.payload.ref);
|
|
100
|
-
if (filterView) {
|
|
101
|
+
if (filterView && containsAbsoluteGranularityDateFilter(filterView.filterContext.filters)) {
|
|
102
|
+
console.warn(`The filter view "${filterView.name}" was not applied. ${ABSOLUTE_GRANULARITY_DATE_FILTER_NOT_SUPPORTED}`);
|
|
103
|
+
yield put(filterViewApplicationFailed(ctx));
|
|
104
|
+
}
|
|
105
|
+
else if (filterView) {
|
|
101
106
|
yield call(applyFilterViewSelection, ctx, cmd, filterView);
|
|
102
107
|
yield put(filterViewApplicationSucceeded(ctx, filterView, cmd.correlationId));
|
|
103
108
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
|
-
import { filterContextItemsToDashboardFiltersByWidget,
|
|
2
|
+
import { filterContextItemsToDashboardFiltersByWidget, isFilterContextItemOfAnyType, isFilterOfAnyType, isWidget, mergeFilters, objRefToString, } from "@gooddata/sdk-model";
|
|
3
3
|
import { exportParametersToValues } from "../../../_staging/automation/index.js";
|
|
4
4
|
export function prepareCsvRawExecutionDefinition({ executionDefinition, csvRawRequest, insight, insightParameterValues, enableStringParameters, widget, commonDateFilterId, }) {
|
|
5
5
|
if (!executionDefinition) {
|
|
@@ -50,8 +50,8 @@ function mergeParameterValues(base, overrides) {
|
|
|
50
50
|
return [...byRef.values()];
|
|
51
51
|
}
|
|
52
52
|
function exportRequestFiltersToExecutionFilters(filters, widget) {
|
|
53
|
-
const executionFilters = filters.filter(
|
|
54
|
-
const filterContextItems = filters.filter(
|
|
53
|
+
const executionFilters = filters.filter(isFilterOfAnyType);
|
|
54
|
+
const filterContextItems = filters.filter(isFilterContextItemOfAnyType);
|
|
55
55
|
if (!filterContextItems.length) {
|
|
56
56
|
return executionFilters;
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeAutomationsHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"initializeAutomationsHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAwD/C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AA8C/E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAWnE,wBAAiB,4BAA4B,CACzC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,sBAAsB,GAC7B,YAAY,CAyTd"}
|