@gooddata/sdk-ui-dashboard 11.65.1 → 11.65.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/esm/__version.d.ts +1 -1
- package/esm/__version.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/model/commandHandlers/dashboard/common/filterViews.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/filterViews.js +9 -3
- package/esm/model/commandHandlers/drill/keyDriverAnalysisHandler.js +1 -1
- package/esm/model/commandHandlers/filterContext/tabSync/tabSyncRules.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/tabSync/tabSyncRules.js +53 -4
- package/esm/model/store/tabs/filterContext/filterSync.d.ts +16 -4
- package/esm/model/store/tabs/filterContext/filterSync.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterSync.js +27 -10
- package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts +2 -1
- package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts.map +1 -1
- package/esm/model/store/widgetDrills/widgetDrillSelectors.js +1 -1
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.d.ts.map +1 -1
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.js +4 -2
- package/esm/presentation/drill/utils/kdaUtils.d.ts +1 -1
- package/esm/presentation/drill/utils/kdaUtils.d.ts.map +1 -1
- package/esm/presentation/drill/utils/kdaUtils.js +25 -26
- package/esm/sdk-ui-dashboard.d.ts +1 -1
- package/package.json +23 -23
package/NOTICE
CHANGED
|
@@ -13,7 +13,7 @@ The following 3rd-party software packages may be used by or distributed with goo
|
|
|
13
13
|
|
|
14
14
|
Date generated: 2026-10-29
|
|
15
15
|
|
|
16
|
-
Revision ID:
|
|
16
|
+
Revision ID: ec821649e08c87cdb55177d84aa9693212ca6afd
|
|
17
17
|
|
|
18
18
|
================================================================================
|
|
19
19
|
================================================================================
|
package/esm/__version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.65.1";
|
|
1
|
+
export declare const LIB_VERSION = "11.65.2-alpha.1";
|
|
2
2
|
export declare const LIB_DESCRIPTION = "GoodData SDK - Dashboard Component";
|
|
3
3
|
export declare const LIB_NAME = "@gooddata/sdk-ui-dashboard";
|
|
4
4
|
//# sourceMappingURL=__version.d.ts.map
|
package/esm/__version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__version.d.ts","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"__version.d.ts","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAE7C,eAAO,MAAM,eAAe,uCAAuC,CAAC;AAEpE,eAAO,MAAM,QAAQ,+BAA+B,CAAC"}
|
package/esm/__version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2021 GoodData Corporation
|
|
2
2
|
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
|
|
3
|
-
export const LIB_VERSION = "11.65.1";
|
|
3
|
+
export const LIB_VERSION = "11.65.2-alpha.1";
|
|
4
4
|
export const LIB_DESCRIPTION = "GoodData SDK - Dashboard Component";
|
|
5
5
|
export const LIB_NAME = "@gooddata/sdk-ui-dashboard";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterViews.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/common/filterViews.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACtC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAGf,KAAK,+BAA+B,EAEpC,KAAK,oBAAoB,EAGzB,KAAK,cAAc,EACnB,KAAK,MAAM,EAqBd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"filterViews.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/dashboard/common/filterViews.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACtC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAGf,KAAK,+BAA+B,EAEpC,KAAK,oBAAoB,EAGzB,KAAK,cAAc,EACnB,KAAK,MAAM,EAqBd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAgQvD,KAAK,oBAAoB,GAAG;IAAE,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAkBnE,UAAU,6BAA6B;IACnC,aAAa,EAAE,cAAc,CAAC;IAC9B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,4BAA4B,kBACtB,cAAc,qBACV,iBAAiB,EAAE,8BACV,WAAW,CAAC,MAAM,CAAC,2BACtB,+BAA+B,EAAE,KAC3D,6BAuJF,CAAC;AAIF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C;;;OAGG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAClE;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAC/C,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,oBAAoB,EAAE,EACnC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,8BAA8B,GACxC,OAAO,CAUT;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,oBAAoB,EAAE,EACnC,kBAAkB,EAAE,MAAM,EAC1B,UAAU,EAAE,OAAO,GACpB,oBAAoB,GAAG,SAAS,CAQlC;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAC/C,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,oBAAoB,EAAE,EACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,kBAAkB,EAAE,aAAa,CAAC,8BAA8B,CAAC,EACjE,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,8BAA8B,GACzC,UAAU,CAIZ;AAED,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,oBAAoB,EAAE,EACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,kBAAkB,EAAE,aAAa,CAAC,8BAA8B,CAAC,EACjE,OAAO,GAAE,8BAAmC,GAC7C,UAAU,CAuDZ"}
|
|
@@ -3,7 +3,7 @@ import { isEqual, omit } from "lodash-es";
|
|
|
3
3
|
import { areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemFilterElementsBy, dashboardAttributeFilterItemFilterElementsByDate, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemTitle, dashboardAttributeFilterItemValidateElementsBy, dashboardFilterLocalIdentifier, dashboardMeasureValueFilterLocalIdentifier, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, isDashboardTextAttributeFilter, isExportOverrideFilterContext, isFilterContext, isSingleSelectionFilter, } from "@gooddata/sdk-model";
|
|
4
4
|
import { filterLocalIdentifiers } from "../../../store/filtering/dashboardFilterSelectors.js";
|
|
5
5
|
import { getRestrictedDashboardFilters } from "../../../store/filtering/restrictedFilterUtils.js";
|
|
6
|
-
import { applyMirroredFilterValue, findCounterpartFilter, } from "../../../store/tabs/filterContext/filterSync.js";
|
|
6
|
+
import { applyMirroredFilterValue, findCounterpartFilter, targetAcceptsAttributeFilterValue, } from "../../../store/tabs/filterContext/filterSync.js";
|
|
7
7
|
import { isFilterTypeCompatibleWithSelectionType } from "../../../utils/attributeFilterSelectionTypeCompatibility.js";
|
|
8
8
|
const findMatchingAttributeFilterByLocalIdentifier = (filter, viewFilters) => viewFilters.find((item) => isDashboardAttributeFilter(item) &&
|
|
9
9
|
item.attributeFilter.localIdentifier === filter.attributeFilter.localIdentifier);
|
|
@@ -422,9 +422,15 @@ function mirrorTabSelection(sourceBefore, sourceAfter, target, filterView, unava
|
|
|
422
422
|
continue;
|
|
423
423
|
}
|
|
424
424
|
const counterpart = findCounterpartFilter(sourceState, before, targetState, attributesWithReferences);
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
// a filter keeps its own value when its selection type cannot store the mirrored one
|
|
426
|
+
if (!counterpart ||
|
|
427
|
+
isRestricted(targetRestricted, counterpart) ||
|
|
428
|
+
(isDashboardAttributeFilterItem(counterpart) &&
|
|
429
|
+
isDashboardAttributeFilterItem(after) &&
|
|
430
|
+
!targetAcceptsAttributeFilterValue(targetState, counterpart, after))) {
|
|
431
|
+
continue;
|
|
427
432
|
}
|
|
433
|
+
replacements.set(counterpart, applyMirroredFilterValue(after, counterpart));
|
|
428
434
|
}
|
|
429
435
|
const mirroredFilters = target.filterContext.filters
|
|
430
436
|
.filter((filter) => !isCommonDateFilter(filter))
|
|
@@ -20,7 +20,7 @@ export function* keyDriverAnalysisHandler(ctx, cmd) {
|
|
|
20
20
|
return localIdentifiers.includes(a.attribute.localIdentifier);
|
|
21
21
|
});
|
|
22
22
|
const metric = drillEvent.dataView.definition.measures.find((m) => {
|
|
23
|
-
return
|
|
23
|
+
return m.measure.localIdentifier === keyDriveItem.measure.measureHeaderItem.localIdentifier;
|
|
24
24
|
});
|
|
25
25
|
const metrics = drillEvent.dataView.definition.measures.filter((m) => m !== metric);
|
|
26
26
|
// Attributes that are used
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabSyncRules.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/tabSync/tabSyncRules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabSyncRules.d.ts","sourceRoot":"","sources":["../../../../../src/model/commandHandlers/filterContext/tabSync/tabSyncRules.ts"],"names":[],"mappings":"AAqCA,OAAO,EAA4B,KAAK,kBAAkB,EAAoB,MAAM,mBAAmB,CAAC;AAExG,KAAK,cAAc,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAye9C;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAG3D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { areObjRefsEqual, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, isAllTimeDashboardDateFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardDateFilterWithDimension, isDashboardMeasureValueFilter, isNoopAllTimeDashboardDateFilter, } from "@gooddata/sdk-model";
|
|
3
|
-
import { applyMirroredFilterValue, findAppliedFilterForStaged, findCounterpartFilter, findOriginalFilter, isCrossFilteringVirtualFilter, retargetAttributeFilterItem, } from "../../../store/tabs/filterContext/filterSync.js";
|
|
3
|
+
import { applyMirroredFilterValue, findAppliedFilterForStaged, findCounterpartFilter, findOriginalFilter, isCrossFilteringVirtualFilter, retargetAttributeFilterItem, targetAcceptsAttributeFilterValue, } from "../../../store/tabs/filterContext/filterSync.js";
|
|
4
4
|
import { tabsActions } from "../../../store/tabs/index.js";
|
|
5
5
|
function defineRule(actionCreator, rule) {
|
|
6
6
|
return defineActionsRule(actionCreator, (payload, target, ctx) => {
|
|
@@ -37,6 +37,24 @@ function findCounterpart(ctx, target, sourceLocalId) {
|
|
|
37
37
|
const sourceFilter = findFilterByLocalId(ctx.source, sourceLocalId);
|
|
38
38
|
return sourceFilter ? findCounterpartOf(ctx, ctx.source, sourceFilter, target) : undefined;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Attribute-filter counterpart of a replacement.
|
|
42
|
+
*
|
|
43
|
+
* The first lookup uses the filter before the action. A value the target cannot store, such as a
|
|
44
|
+
* text value on a list-only filter, leaves the tabs on different kinds, so the next value is matched
|
|
45
|
+
* from the filter after the action. A reset does the same: the restored source value is a list again,
|
|
46
|
+
* and the target restores its own original.
|
|
47
|
+
*/
|
|
48
|
+
function findReplacedAttributeCounterpart(ctx, target, sourceFilter, sourceLocalId) {
|
|
49
|
+
const counterpart = findCounterpartOf(ctx, ctx.source, sourceFilter, target);
|
|
50
|
+
if (isDashboardAttributeFilterItem(counterpart)) {
|
|
51
|
+
return counterpart;
|
|
52
|
+
}
|
|
53
|
+
const sourceFilterAfter = findFilterByLocalId(ctx.sourceAfter, sourceLocalId);
|
|
54
|
+
return isDashboardAttributeFilterItem(sourceFilterAfter)
|
|
55
|
+
? findCounterpartOf(ctx, ctx.sourceAfter, sourceFilterAfter, target)
|
|
56
|
+
: undefined;
|
|
57
|
+
}
|
|
40
58
|
function counterpartLocalId(ctx, target, sourceLocalId) {
|
|
41
59
|
const counterpart = findCounterpart(ctx, target, sourceLocalId);
|
|
42
60
|
return counterpart ? dashboardFilterLocalIdentifier(counterpart) : undefined;
|
|
@@ -57,6 +75,22 @@ function findSelectionCounterpart(ctx, target, sourceLocalId) {
|
|
|
57
75
|
? counterpart
|
|
58
76
|
: undefined;
|
|
59
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The list filter on `target` that stores a list selection from `sourceLocalId`.
|
|
80
|
+
* A list value is written onto a list filter and onto a list-or-text filter, and is not written
|
|
81
|
+
* onto a text-only filter. A reset still resolves the counterpart, so the tab restores its own value.
|
|
82
|
+
*/
|
|
83
|
+
function mirroredListSelection(ctx, target, sourceLocalId, restoreTargetOriginal) {
|
|
84
|
+
const counterpart = findSelectionCounterpart(ctx, target, sourceLocalId);
|
|
85
|
+
if (!counterpart || restoreTargetOriginal) {
|
|
86
|
+
return counterpart;
|
|
87
|
+
}
|
|
88
|
+
const sourceFilter = findFilterByLocalId(ctx.source, sourceLocalId);
|
|
89
|
+
return isDashboardAttributeFilter(sourceFilter) &&
|
|
90
|
+
targetAcceptsAttributeFilterValue(target, counterpart, sourceFilter)
|
|
91
|
+
? counterpart
|
|
92
|
+
: undefined;
|
|
93
|
+
}
|
|
60
94
|
function findMeasureValueCounterpart(ctx, target, sourceLocalId) {
|
|
61
95
|
const sourceFilter = findFilterByLocalId(ctx.source, sourceLocalId);
|
|
62
96
|
if (!isDashboardMeasureValueFilter(sourceFilter)) {
|
|
@@ -110,6 +144,11 @@ function committedFilterValues(ctx, target) {
|
|
|
110
144
|
}
|
|
111
145
|
const counterpart = findCounterpartOf(ctx, ctx.sourceAfter, committed, target);
|
|
112
146
|
if (counterpart) {
|
|
147
|
+
if (isDashboardAttributeFilterItem(committed) &&
|
|
148
|
+
isDashboardAttributeFilterItem(counterpart) &&
|
|
149
|
+
!targetAcceptsAttributeFilterValue(target, counterpart, committed)) {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
113
152
|
return [applyMirroredFilterValue(committed, counterpart)];
|
|
114
153
|
}
|
|
115
154
|
// A tab without a common date filter is all time, so it receives the committed value
|
|
@@ -144,6 +183,12 @@ const filterContextRules = [
|
|
|
144
183
|
if (!isDashboardAttributeFilter(counterpart)) {
|
|
145
184
|
return [];
|
|
146
185
|
}
|
|
186
|
+
const sourceFilter = findFilterByLocalId(ctx.source, payload.filterLocalId);
|
|
187
|
+
if (!payload.restoreTargetOriginal &&
|
|
188
|
+
(!isDashboardAttributeFilter(sourceFilter) ||
|
|
189
|
+
!targetAcceptsAttributeFilterValue(target, counterpart, sourceFilter))) {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
147
192
|
const filterLocalId = dashboardFilterLocalIdentifier(counterpart);
|
|
148
193
|
if (!payload.restoreTargetOriginal) {
|
|
149
194
|
const changeDisplayForm = tabsActions.changeAttributeDisplayForm({ ...payload, filterLocalId });
|
|
@@ -201,7 +246,7 @@ const selectionRules = [
|
|
|
201
246
|
if (payload.isWorkingSelectionChange || payload.isResultOfMigration) {
|
|
202
247
|
return undefined;
|
|
203
248
|
}
|
|
204
|
-
const counterpart =
|
|
249
|
+
const counterpart = mirroredListSelection(ctx, target, payload.filterLocalId, payload.restoreTargetOriginal);
|
|
205
250
|
if (!counterpart) {
|
|
206
251
|
return undefined;
|
|
207
252
|
}
|
|
@@ -230,7 +275,7 @@ const selectionRules = [
|
|
|
230
275
|
if (!isDashboardAttributeFilterItem(sourceFilter)) {
|
|
231
276
|
return undefined;
|
|
232
277
|
}
|
|
233
|
-
const counterpart =
|
|
278
|
+
const counterpart = findReplacedAttributeCounterpart(ctx, target, sourceFilter, payload.filterLocalId);
|
|
234
279
|
if (!isDashboardAttributeFilterItem(counterpart)) {
|
|
235
280
|
return undefined;
|
|
236
281
|
}
|
|
@@ -243,11 +288,15 @@ const selectionRules = [
|
|
|
243
288
|
return undefined;
|
|
244
289
|
}
|
|
245
290
|
const replacement = isDashboardAttributeFilterItem(original) ? original : payload.filter;
|
|
291
|
+
if (!payload.restoreTargetOriginal &&
|
|
292
|
+
!targetAcceptsAttributeFilterValue(target, counterpart, replacement)) {
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
246
295
|
return { ...payload, filterLocalId, filter: retargetAttributeFilterItem(replacement, filterLocalId) };
|
|
247
296
|
}),
|
|
248
297
|
defineRule(tabsActions.clearAttributeFiltersSelection, (payload, target, ctx) => {
|
|
249
298
|
const filterLocalIds = payload.filterLocalIds.flatMap((filterLocalId) => {
|
|
250
|
-
const counterpart =
|
|
299
|
+
const counterpart = mirroredListSelection(ctx, target, filterLocalId, payload.restoreTargetOriginal);
|
|
251
300
|
return counterpart ? [counterpart.attributeFilter.localIdentifier] : [];
|
|
252
301
|
});
|
|
253
302
|
if (filterLocalIds.length === 0) {
|
|
@@ -28,10 +28,11 @@ export type CrossFilteringLocalIdsByTab = Readonly<Record<string, readonly strin
|
|
|
28
28
|
export declare function isCrossFilteringVirtualFilter(tab: ITabState, localIdentifier: string | undefined, crossFilteringLocalIdsByTab: CrossFilteringLocalIdsByTab | undefined): boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Finds the filter on `targetTab` that is the same logical filter as `sourceFilter`.
|
|
31
|
-
* An attribute filter is a counterpart
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* An attribute filter is a counterpart when it is of the same type (list or text), shows the same
|
|
32
|
+
* label, and selects either a single value or multiple values. Selection type is not part of that
|
|
33
|
+
* identity: it only limits how a value can be entered on a tab. Whether the value itself can be
|
|
34
|
+
* stored on the counterpart is decided by {@link targetAcceptsAttributeFilterValue}.
|
|
35
|
+
* A missing counterpart is a no-op for the caller.
|
|
35
36
|
*
|
|
36
37
|
* Assumes at most one filter per display form, date data set, and measure with a given
|
|
37
38
|
* dimensionality on a tab.
|
|
@@ -119,5 +120,16 @@ export interface ISyncedTabSeed {
|
|
|
119
120
|
* @internal
|
|
120
121
|
*/
|
|
121
122
|
export declare function seedSyncedTabFilters(sourceTab: ITabState, base: IFilterContextDefinition, crossFilteringLocalIdsByTab?: CrossFilteringLocalIdsByTab): ISyncedTabSeed;
|
|
123
|
+
/**
|
|
124
|
+
* Whether `value` can be stored on `targetFilter`.
|
|
125
|
+
*
|
|
126
|
+
* A list selection is valid on a list filter and on a list-or-text filter, so it syncs in both
|
|
127
|
+
* directions. A text value, such as a "contains" match, is valid on a text filter and on a
|
|
128
|
+
* list-or-text filter, and cannot be applied to a list-only filter. An omitted selection type
|
|
129
|
+
* means list-or-text, except a single-value list filter, which means list.
|
|
130
|
+
*
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
export declare function targetAcceptsAttributeFilterValue(targetTab: ITabState, targetFilter: DashboardAttributeFilterItem, value: DashboardAttributeFilterItem): boolean;
|
|
122
134
|
export {};
|
|
123
135
|
//# sourceMappingURL=filterSync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterSync.d.ts","sourceRoot":"","sources":["../../../../../src/model/store/tabs/filterContext/filterSync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EACH,KAAK,4BAA4B,
|
|
1
|
+
{"version":3,"file":"filterSync.d.ts","sourceRoot":"","sources":["../../../../../src/model/store/tabs/filterContext/filterSync.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemFilterElementsBy, dashboardAttributeFilterItemFilterElementsByDate, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemValidateElementsBy, dashboardFilterLocalIdentifier, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, isSingleSelectionFilter, } from "@gooddata/sdk-model";
|
|
3
3
|
import { displayFormsEquivalent, findAttributeFilterCounterpart, } from "../../../utils/attributeFilterMatching.js";
|
|
4
|
-
import {
|
|
4
|
+
import { canApplyFilterTypeToTarget } from "../../../utils/attributeFilterSelectionTypeCompatibility.js";
|
|
5
5
|
/**
|
|
6
6
|
* True when `localIdentifier` belongs to a cross-filtering virtual filter on `tab`.
|
|
7
7
|
* Those filters are applied on their own tab only and are not mirrored to or from other tabs.
|
|
@@ -16,10 +16,11 @@ export function isCrossFilteringVirtualFilter(tab, localIdentifier, crossFilteri
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Finds the filter on `targetTab` that is the same logical filter as `sourceFilter`.
|
|
19
|
-
* An attribute filter is a counterpart
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* An attribute filter is a counterpart when it is of the same type (list or text), shows the same
|
|
20
|
+
* label, and selects either a single value or multiple values. Selection type is not part of that
|
|
21
|
+
* identity: it only limits how a value can be entered on a tab. Whether the value itself can be
|
|
22
|
+
* stored on the counterpart is decided by {@link targetAcceptsAttributeFilterValue}.
|
|
23
|
+
* A missing counterpart is a no-op for the caller.
|
|
23
24
|
*
|
|
24
25
|
* Assumes at most one filter per display form, date data set, and measure with a given
|
|
25
26
|
* dimensionality on a tab.
|
|
@@ -339,17 +340,33 @@ function attributeFilterPresentation(tab, filter) {
|
|
|
339
340
|
: undefined;
|
|
340
341
|
return {
|
|
341
342
|
displayAsLabel: config?.displayAsLabel ?? dashboardAttributeFilterItemDisplayForm(filter),
|
|
342
|
-
selectionType: effectiveSelectionTypeOf(config?.selectionType, filter),
|
|
343
343
|
isSingleSelection: isDashboardAttributeFilter(filter) && isSingleSelectionFilter(filter),
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
346
|
/**
|
|
347
|
-
*
|
|
348
|
-
*
|
|
347
|
+
* Whether `value` can be stored on `targetFilter`.
|
|
348
|
+
*
|
|
349
|
+
* A list selection is valid on a list filter and on a list-or-text filter, so it syncs in both
|
|
350
|
+
* directions. A text value, such as a "contains" match, is valid on a text filter and on a
|
|
351
|
+
* list-or-text filter, and cannot be applied to a list-only filter. An omitted selection type
|
|
352
|
+
* means list-or-text, except a single-value list filter, which means list.
|
|
353
|
+
*
|
|
354
|
+
* @internal
|
|
355
|
+
*/
|
|
356
|
+
export function targetAcceptsAttributeFilterValue(targetTab, targetFilter, value) {
|
|
357
|
+
const localIdentifier = dashboardAttributeFilterItemLocalIdentifier(targetFilter);
|
|
358
|
+
const selectionType = localIdentifier
|
|
359
|
+
? targetTab.attributeFilterConfigs?.attributeFilterConfigs?.find((config) => config.localIdentifier === localIdentifier)?.selectionType
|
|
360
|
+
: undefined;
|
|
361
|
+
const valueType = isDashboardAttributeFilter(value) ? "list" : "text";
|
|
362
|
+
return canApplyFilterTypeToTarget(valueType, selectionType, targetFilter);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Attribute filters are the same filter when they show the same label and both select either a
|
|
366
|
+
* single value or multiple values.
|
|
349
367
|
*/
|
|
350
368
|
function samePresentation(left, right, displayForms) {
|
|
351
|
-
return (left.
|
|
352
|
-
left.isSingleSelection === right.isSingleSelection &&
|
|
369
|
+
return (left.isSingleSelection === right.isSingleSelection &&
|
|
353
370
|
displayFormsEquivalent(left.displayAsLabel, right.displayAsLabel, displayForms));
|
|
354
371
|
}
|
|
355
372
|
function findDateCounterpart(sourceFilter, targets) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IAttributeDescriptor, type ICatalogAttribute, type ICatalogDateAttribute, type IDrillDownReference, type ObjRef } from "@gooddata/sdk-model";
|
|
1
|
+
import { type IAttributeDescriptor, type ICatalogAttribute, type ICatalogDateAttribute, type IDrillDownReference, type IInsight, type ObjRef } from "@gooddata/sdk-model";
|
|
2
2
|
import { type ExplicitDrill, type IAvailableDrillTargets, type IHeaderPredicate } from "@gooddata/sdk-ui";
|
|
3
3
|
import { type ObjRefMap } from "../../../_staging/metadata/objRefMap.js";
|
|
4
4
|
import { type DashboardDrillDefinition, type IDrillToUrlAttributeDefinition, type IGlobalDrillDownAttributeHierarchyDefinition } from "../../../types.js";
|
|
@@ -83,4 +83,5 @@ export declare const selectImplicitDrillsByAvailableDrillTargets: (availableDril
|
|
|
83
83
|
* @internal
|
|
84
84
|
*/
|
|
85
85
|
export declare const selectDrillableItemsByAvailableDrillTargets: (availableDrillTargets: IAvailableDrillTargets | undefined, ignoredDrillDownHierarchies: IDrillDownReference[] | undefined, disableDrillIntoURL: boolean | undefined, disableDrillDown?: boolean) => DashboardSelector<IHeaderPredicate[]>;
|
|
86
|
+
export declare function getMetricDisabled(insight: IInsight | undefined | null, localIdentifier: string): boolean;
|
|
86
87
|
//# sourceMappingURL=widgetDrillSelectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetDrillSelectors.d.ts","sourceRoot":"","sources":["../../../../src/model/store/widgetDrills/widgetDrillSelectors.ts"],"names":[],"mappings":"AAMA,OAAO,EAIH,KAAK,oBAAoB,EAEzB,KAAK,iBAAiB,EAEtB,KAAK,qBAAqB,EAE1B,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"widgetDrillSelectors.d.ts","sourceRoot":"","sources":["../../../../src/model/store/widgetDrills/widgetDrillSelectors.ts"],"names":[],"mappings":"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"}
|
|
@@ -515,6 +515,6 @@ export const selectDrillableItemsByAvailableDrillTargets = createMemoizedSelecto
|
|
|
515
515
|
...restrictedDrillDownPredicates(restrictedDrillDowns),
|
|
516
516
|
];
|
|
517
517
|
}));
|
|
518
|
-
function getMetricDisabled(insight, localIdentifier) {
|
|
518
|
+
export function getMetricDisabled(insight, localIdentifier) {
|
|
519
519
|
return (insight?.insight.properties?.["controls"]?.["disableKeyDriveAnalysisOn"]?.[localIdentifier] ?? false);
|
|
520
520
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrillSelectDropdown.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/DrillSelect/DrillSelectDropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,YAAY,CAAC;AAGrD,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"DrillSelectDropdown.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/DrillSelect/DrillSelectDropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,YAAY,CAAC;AAGrD,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,OAAO,EAgBf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AAIxE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAazE,OAAO,EAAE,KAAK,wBAAwB,EAAyB,MAAM,mBAAmB,CAAC;AAazF,OAAO,EAEH,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAExB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IAClE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxE;AAED,wBAAgB,mBAAmB,CAAC,EAChC,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,GACb,EAAE,yBAAyB,kDA+K3B;AAgGD,eAAO,MAAM,sBAAsB,kKAWhC;IACC,iBAAiB,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC;IAChE,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;IAC7C,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9B,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,mCAAmC,CAAC,CAAC;IAC3E,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,KAAG,gBAAgB,EA2JnB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import stringify from "json-stable-stringify";
|
|
|
5
5
|
import { compact, groupBy, uniqBy } from "lodash-es";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
7
|
import { invariant } from "ts-invariant";
|
|
8
|
-
import { areObjRefsEqual, insightTitle, isAttributeDescriptor, isCrossFiltering, isDrillFromAttribute, isDrillToAttributeUrl, isDrillToCustomUrl, isDrillToDashboard, isDrillToInsight, isDrillToLegacyDashboard, isIdentifierRef, isKeyDriveAnalysis, objRefToString, } from "@gooddata/sdk-model";
|
|
8
|
+
import { areObjRefsEqual, insightTitle, isAttributeDescriptor, isCrossFiltering, isDrillFromAttribute, isDrillToAttributeUrl, isDrillToCustomUrl, isDrillToDashboard, isDrillToInsight, isDrillToLegacyDashboard, isIdentifierRef, isInsightWidget, isKeyDriveAnalysis, objRefToString, } from "@gooddata/sdk-model";
|
|
9
9
|
import { UnexpectedSdkError } from "@gooddata/sdk-ui";
|
|
10
10
|
import { Overlay, UiFocusManager, UiMenu } from "@gooddata/sdk-ui-kit";
|
|
11
11
|
import { getDrillOriginLocalIdentifier } from "../../../_staging/drills/drillingUtils.js";
|
|
@@ -17,6 +17,7 @@ import { selectInsightsMap } from "../../../model/store/insights/insightsSelecto
|
|
|
17
17
|
import { selectDashboardTitle } from "../../../model/store/meta/metaSelectors.js";
|
|
18
18
|
import { selectWidgetByRef } from "../../../model/store/tabs/layout/layoutSelectors.js";
|
|
19
19
|
import { selectIsDrillRestricted } from "../../../model/store/widgetDrills/drillRestrictionSelectors.js";
|
|
20
|
+
import { getMetricDisabled, } from "../../../model/store/widgetDrills/widgetDrillSelectors.js";
|
|
20
21
|
import { isDrillDownDefinition } from "../../../types.js";
|
|
21
22
|
import { useDrillSelectDropdownMenuItems } from "../hooks/useDrillSelectDropdownMenuItems.js";
|
|
22
23
|
import { isDrillToUrl } from "../types.js";
|
|
@@ -325,7 +326,8 @@ export const createDrillSelectItems = ({ drillDefinitions, drillEvent, insights,
|
|
|
325
326
|
};
|
|
326
327
|
}
|
|
327
328
|
if (isKeyDriveAnalysis(drillDefinition)) {
|
|
328
|
-
const
|
|
329
|
+
const widgetInsight = isInsightWidget(widget) ? insights.get(widget.insight) : undefined;
|
|
330
|
+
const items = getKdaKeyDriverCombinations(drillDefinition, drillEvent, enableSecondGranularities, (localIdentifier) => getMetricDisabled(widgetInsight, localIdentifier));
|
|
329
331
|
return items.map((item) => {
|
|
330
332
|
return {
|
|
331
333
|
name: getKeyDriverCombinationItemTitle(intl, item),
|
|
@@ -5,7 +5,7 @@ import type { IDashboardKeyDriverCombinationItem } from "../../../model/events/d
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export declare function getKdaKeyDriverCombinations(drillDefinition: IKeyDriveAnalysis, drillEvent: IDrillEvent, enableSecondGranularities?: boolean): IDashboardKeyDriverCombinationItem[];
|
|
8
|
+
export declare function getKdaKeyDriverCombinations(drillDefinition: IKeyDriveAnalysis, drillEvent: IDrillEvent, enableSecondGranularities?: boolean, isMeasureDisabled?: (localIdentifier: string) => boolean): IDashboardKeyDriverCombinationItem[];
|
|
9
9
|
/**
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kdaUtils.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/utils/kdaUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAEH,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"kdaUtils.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/utils/kdaUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAEH,KAAK,iBAAiB,EASzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGH,KAAK,WAAW,EAgBnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AAGzF;;GAEG;AACH,wBAAgB,2BAA2B,CACvC,eAAe,EAAE,iBAAiB,EAClC,UAAU,EAAE,WAAW,EACvB,yBAAyB,UAAQ,EACjC,iBAAiB,GAAE,CAAC,eAAe,EAAE,MAAM,KAAK,OAAqB,GACtE,kCAAkC,EAAE,CAkEtC;AA2UD;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,kCAAkC,UAsCzG"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
|
-
import { isAttributeDescriptor, isMeasureDescriptor, isMeasureGroupDescriptor, isYearGranularity, } from "@gooddata/sdk-model";
|
|
3
|
-
import { DataViewFacade, isAttributeScope, isDrillIntersectionAttributeItem, isDrillIntersectionDateAttributeItem, isMeasureScope, isTableMeasureValue, isValueColumnDefinition, isValueRowDefinition, } from "@gooddata/sdk-ui";
|
|
2
|
+
import { bucketMeasures, bucketsFind, isAttributeDescriptor, isMeasureDescriptor, isMeasureGroupDescriptor, isYearGranularity, measureLocalId, } from "@gooddata/sdk-model";
|
|
3
|
+
import { BucketNames, DataViewFacade, isAttributeScope, isDrillIntersectionAttributeItem, isDrillIntersectionDateAttributeItem, isMeasureScope, isTableMeasureValue, isValueColumnDefinition, isValueRowDefinition, } from "@gooddata/sdk-ui";
|
|
4
4
|
import { getKeyDriverAnalysisSupportedStringGranularities } from "../../../model/store/keyDriverAnalysis/const.js";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export function getKdaKeyDriverCombinations(drillDefinition, drillEvent, enableSecondGranularities = false) {
|
|
8
|
+
export function getKdaKeyDriverCombinations(drillDefinition, drillEvent, enableSecondGranularities = false, isMeasureDisabled = () => false) {
|
|
9
9
|
//TODO: Special implementation for headline
|
|
10
10
|
const dv = DataViewFacade.for(drillEvent.dataView);
|
|
11
|
-
const combinations = findHeadersCombinations(dv, drillDefinition, drillEvent);
|
|
11
|
+
const combinations = findHeadersCombinations(dv, drillDefinition, drillEvent, isMeasureDisabled);
|
|
12
12
|
// No relevant headers
|
|
13
13
|
if (!combinations.dateHeader || !combinations.metricHeader) {
|
|
14
14
|
return [];
|
|
@@ -26,13 +26,10 @@ export function getKdaKeyDriverCombinations(drillDefinition, drillEvent, enableS
|
|
|
26
26
|
const filteredRows = filterRows(table.rowDefinitions, dimScopedValues[0], dateId);
|
|
27
27
|
const exactColumn = filterExactColumn(filteredColumns, dimScopedValues[1]);
|
|
28
28
|
const exactRow = filterExactRow(filteredRows, dimScopedValues[0]);
|
|
29
|
-
const isFirstColumn = exactColumn === filteredColumns[0];
|
|
30
|
-
const isFirstRow = exactRow === filteredRows[0];
|
|
31
|
-
const isLastColumn = exactColumn === filteredColumns[filteredColumns.length - 1];
|
|
32
|
-
const isLastRow = exactRow === filteredRows[filteredRows.length - 1];
|
|
33
29
|
const current = getCurrentValue(table.data, dateId, exactRow, exactColumn);
|
|
34
|
-
const
|
|
35
|
-
const
|
|
30
|
+
const getNeighbourValue = (direction) => getDirectionValue(table.data, dateId, current, direction, filteredRows, filteredColumns, exactRow, exactColumn);
|
|
31
|
+
const previous = getNeighbourValue(-1);
|
|
32
|
+
const next = getNeighbourValue(1);
|
|
36
33
|
const res = [];
|
|
37
34
|
// There is a previous value in graph
|
|
38
35
|
const before = createBefore(combinations, current, previous);
|
|
@@ -174,23 +171,15 @@ function getCurrentValue(data, dateId, row, column) {
|
|
|
174
171
|
const res = data[row.rowIndex]?.[column.columnIndex];
|
|
175
172
|
return mapToCurrentValue(res, dateId, row.rowIndex, column.columnIndex);
|
|
176
173
|
}
|
|
177
|
-
function getDirectionValue(data, dateId, current, direction,
|
|
178
|
-
if (!current) {
|
|
174
|
+
function getDirectionValue(data, dateId, current, direction, rows, columns, row, column) {
|
|
175
|
+
if (!current || !row || !column) {
|
|
179
176
|
return null;
|
|
180
177
|
}
|
|
181
178
|
if (current.direction === "row") {
|
|
182
|
-
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
const res = data[current.row + direction]?.[current.column];
|
|
186
|
-
return mapToCurrentValue(res, dateId, current.row + direction, current.column);
|
|
179
|
+
return getCurrentValue(data, dateId, rows[rows.indexOf(row) + direction], column);
|
|
187
180
|
}
|
|
188
181
|
if (current.direction === "column") {
|
|
189
|
-
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
const res = data[current.row]?.[current.column + direction];
|
|
193
|
-
return mapToCurrentValue(res, dateId, current.row, current.column + direction);
|
|
182
|
+
return getCurrentValue(data, dateId, row, columns[columns.indexOf(column) + direction]);
|
|
194
183
|
}
|
|
195
184
|
return null;
|
|
196
185
|
}
|
|
@@ -331,7 +320,7 @@ export function getKeyDriverCombinationItemTitle(intl, item) {
|
|
|
331
320
|
return intl.formatMessage({ id: "drill.kda.year_to_year" });
|
|
332
321
|
}
|
|
333
322
|
}
|
|
334
|
-
function findHeadersCombinations(dv, drillDefinition, drillEvent) {
|
|
323
|
+
function findHeadersCombinations(dv, drillDefinition, drillEvent, isMeasureDisabled) {
|
|
335
324
|
if (drillDefinition.transition !== "in-place") {
|
|
336
325
|
return {
|
|
337
326
|
dateHeader: undefined,
|
|
@@ -344,9 +333,12 @@ function findHeadersCombinations(dv, drillDefinition, drillEvent) {
|
|
|
344
333
|
const dateHeader = intersections
|
|
345
334
|
.map((intersectionElement) => intersectionElement.header)
|
|
346
335
|
.filter(isDrillIntersectionDateAttributeItem)[0];
|
|
347
|
-
const
|
|
336
|
+
const measureHeaders = intersections
|
|
348
337
|
.map((intersectionElement) => intersectionElement.header)
|
|
349
|
-
.filter(isMeasureDescriptor)
|
|
338
|
+
.filter(isMeasureDescriptor)
|
|
339
|
+
.filter((header) => !isMeasureDisabled(header.measureHeaderItem.localIdentifier));
|
|
340
|
+
const preferredMeasureIds = getPreferredMeasureIds(drillEvent);
|
|
341
|
+
const metricHeader = measureHeaders.find((header) => preferredMeasureIds.includes(header.measureHeaderItem.localIdentifier)) ?? measureHeaders[0];
|
|
350
342
|
const attributeHeaders = intersections
|
|
351
343
|
.map((intersectionElement) => intersectionElement.header)
|
|
352
344
|
.filter(isDrillIntersectionAttributeItem)
|
|
@@ -366,7 +358,7 @@ function findHeadersCombinations(dv, drillDefinition, drillEvent) {
|
|
|
366
358
|
});
|
|
367
359
|
}
|
|
368
360
|
if (isMeasureGroupDescriptor(h)) {
|
|
369
|
-
return intersections.find((i) =>
|
|
361
|
+
return intersections.find((i) => i.header === metricHeader);
|
|
370
362
|
}
|
|
371
363
|
return undefined;
|
|
372
364
|
})
|
|
@@ -378,6 +370,13 @@ function findHeadersCombinations(dv, drillDefinition, drillEvent) {
|
|
|
378
370
|
attributeHeaders,
|
|
379
371
|
};
|
|
380
372
|
}
|
|
373
|
+
function getPreferredMeasureIds(drillEvent) {
|
|
374
|
+
if (drillEvent.drillContext.type !== "mekko") {
|
|
375
|
+
return [];
|
|
376
|
+
}
|
|
377
|
+
const heightBucket = bucketsFind(drillEvent.dataView.definition.buckets, BucketNames.SECONDARY_MEASURES);
|
|
378
|
+
return heightBucket ? bucketMeasures(heightBucket).map(measureLocalId) : [];
|
|
379
|
+
}
|
|
381
380
|
function getPreviousYear(currentYear) {
|
|
382
381
|
const split = currentYear.uri.split("-");
|
|
383
382
|
split[0] = (parseInt(split[0]) - 1).toString();
|
|
@@ -6341,7 +6341,7 @@ export declare function getFilterIdentifier(filter: FilterContextItem): string;
|
|
|
6341
6341
|
/**
|
|
6342
6342
|
* @internal
|
|
6343
6343
|
*/
|
|
6344
|
-
export declare function getKdaKeyDriverCombinations(drillDefinition: IKeyDriveAnalysis, drillEvent: IDrillEvent, enableSecondGranularities?: boolean): IDashboardKeyDriverCombinationItem[];
|
|
6344
|
+
export declare function getKdaKeyDriverCombinations(drillDefinition: IKeyDriveAnalysis, drillEvent: IDrillEvent, enableSecondGranularities?: boolean, isMeasureDisabled?: (localIdentifier: string) => boolean): IDashboardKeyDriverCombinationItem[];
|
|
6345
6345
|
|
|
6346
6346
|
/**
|
|
6347
6347
|
* Returns KDA-supported date granularities, including second when the feature flag is on.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-dashboard",
|
|
3
|
-
"version": "11.65.1",
|
|
3
|
+
"version": "11.65.2-alpha.1",
|
|
4
4
|
"description": "GoodData SDK - Dashboard Component",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -60,22 +60,22 @@
|
|
|
60
60
|
"ts-invariant": "0.10.3",
|
|
61
61
|
"tslib": "2.8.1",
|
|
62
62
|
"uuid": "11.1.1",
|
|
63
|
-
"@gooddata/sdk-backend-base": "11.65.1",
|
|
64
|
-
"@gooddata/sdk-backend-spi": "11.65.1",
|
|
65
|
-
"@gooddata/sdk-embedding": "11.65.1",
|
|
66
|
-
"@gooddata/sdk-model": "11.65.1",
|
|
67
|
-
"@gooddata/sdk-ui": "11.65.1",
|
|
68
|
-
"@gooddata/sdk-ui-analytical-designer": "11.65.1",
|
|
69
|
-
"@gooddata/sdk-ui-charts": "11.65.1",
|
|
70
|
-
"@gooddata/sdk-ui-ext": "11.65.1",
|
|
71
|
-
"@gooddata/sdk-ui-filters": "11.65.1",
|
|
72
|
-
"@gooddata/sdk-ui-geo": "11.65.1",
|
|
73
|
-
"@gooddata/sdk-ui-
|
|
74
|
-
"@gooddata/sdk-ui-
|
|
75
|
-
"@gooddata/sdk-ui-
|
|
76
|
-
"@gooddata/sdk-ui-theme-provider": "11.65.1",
|
|
77
|
-
"@gooddata/sdk-ui-vis-commons": "11.65.1",
|
|
78
|
-
"@gooddata/util": "11.65.1"
|
|
63
|
+
"@gooddata/sdk-backend-base": "11.65.2-alpha.1",
|
|
64
|
+
"@gooddata/sdk-backend-spi": "11.65.2-alpha.1",
|
|
65
|
+
"@gooddata/sdk-embedding": "11.65.2-alpha.1",
|
|
66
|
+
"@gooddata/sdk-model": "11.65.2-alpha.1",
|
|
67
|
+
"@gooddata/sdk-ui": "11.65.2-alpha.1",
|
|
68
|
+
"@gooddata/sdk-ui-analytical-designer": "11.65.2-alpha.1",
|
|
69
|
+
"@gooddata/sdk-ui-charts": "11.65.2-alpha.1",
|
|
70
|
+
"@gooddata/sdk-ui-ext": "11.65.2-alpha.1",
|
|
71
|
+
"@gooddata/sdk-ui-filters": "11.65.2-alpha.1",
|
|
72
|
+
"@gooddata/sdk-ui-geo": "11.65.2-alpha.1",
|
|
73
|
+
"@gooddata/sdk-ui-kit": "11.65.2-alpha.1",
|
|
74
|
+
"@gooddata/sdk-ui-semantic-search": "11.65.2-alpha.1",
|
|
75
|
+
"@gooddata/sdk-ui-pivot": "11.65.2-alpha.1",
|
|
76
|
+
"@gooddata/sdk-ui-theme-provider": "11.65.2-alpha.1",
|
|
77
|
+
"@gooddata/sdk-ui-vis-commons": "11.65.2-alpha.1",
|
|
78
|
+
"@gooddata/util": "11.65.2-alpha.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@microsoft/api-documenter": "7.30.16",
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"svgo": "2.8.4",
|
|
118
118
|
"typescript": "7.0.2",
|
|
119
119
|
"vitest": "5.0.4",
|
|
120
|
-
"@gooddata/
|
|
121
|
-
"@gooddata/
|
|
122
|
-
"@gooddata/
|
|
123
|
-
"@gooddata/reference-workspace": "11.65.1",
|
|
124
|
-
"@gooddata/
|
|
125
|
-
"@gooddata/
|
|
120
|
+
"@gooddata/eslint-config": "11.65.2-alpha.1",
|
|
121
|
+
"@gooddata/oxlint-config": "11.65.2-alpha.1",
|
|
122
|
+
"@gooddata/i18n-toolkit": "11.65.2-alpha.1",
|
|
123
|
+
"@gooddata/reference-workspace": "11.65.2-alpha.1",
|
|
124
|
+
"@gooddata/stylelint-config": "11.65.2-alpha.1",
|
|
125
|
+
"@gooddata/sdk-backend-mockingbird": "11.65.2-alpha.1"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
128
|
"react": "^18.0.0 || ^19.0.0",
|