@gooddata/sdk-ui-dashboard 11.35.0-alpha.5 → 11.35.0-alpha.7
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 +8 -8
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/_staging/dashboard/dashboardFilterContext.js +18 -1
- package/esm/_staging/sharedHooks/useFiltersNamings.d.ts +1 -1
- package/esm/_staging/sharedHooks/useFiltersNamings.js +32 -5
- package/esm/index.d.ts +4 -5
- package/esm/index.js +2 -3
- package/esm/kdaDialog/dialog/hooks/useChangeAnalysis.js +21 -5
- package/esm/kdaDialog/internalTypes.d.ts +6 -1
- package/esm/kdaDialog/providers/Kda.js +4 -1
- package/esm/kdaDialog/providers/KdaState.js +1 -0
- package/esm/kdaDialog/types.d.ts +13 -2
- package/esm/model/commandHandlers/dashboard/common/parameterHydration.d.ts +11 -2
- package/esm/model/commandHandlers/dashboard/common/parameterHydration.js +21 -0
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.js +44 -79
- package/esm/model/commandHandlers/dashboard/saveAsDashboardHandler.js +10 -5
- package/esm/model/commandHandlers/dashboard/saveDashboardHandler.js +11 -7
- package/esm/model/commandHandlers/drill/keyDriverAnalysisHandler.js +8 -3
- package/esm/model/store/_infra/generators.d.ts +1 -0
- package/esm/model/store/_infra/generators.js +4 -1
- package/esm/model/store/dashboardStore.d.ts +0 -2
- package/esm/model/store/dashboardStore.js +0 -2
- package/esm/model/store/filtering/dashboardFilterSelectors.d.ts +1 -1
- package/esm/model/store/filtering/dashboardFilterSelectors.js +8 -5
- package/esm/model/store/meta/metaSelectors.js +4 -3
- package/esm/model/store/tabs/filterContext/filterContextReducers.js +2 -2
- package/esm/model/store/tabs/index.d.ts +12 -0
- package/esm/model/store/tabs/index.js +2 -0
- package/esm/model/store/{parameters → tabs/parameters}/parametersReducers.d.ts +3 -7
- package/esm/model/store/tabs/parameters/parametersReducers.js +46 -0
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +72 -0
- package/esm/model/store/tabs/parameters/parametersSelectors.js +228 -0
- package/esm/model/store/{parameters → tabs/parameters}/parametersState.d.ts +11 -1
- package/esm/model/store/tabs/parameters/parametersState.js +20 -0
- package/esm/model/store/tabs/tabsState.d.ts +2 -0
- package/esm/model/store/types.d.ts +0 -6
- package/esm/model/utils/widgetFilters.d.ts +1 -1
- package/esm/model/utils/widgetFilters.js +1 -1
- package/esm/presentation/automationFilters/components/AutomationFiltersSelect.js +8 -2
- package/esm/presentation/automationFilters/components/AutomationMeasureValueFilter.d.ts +10 -0
- package/esm/presentation/automationFilters/components/AutomationMeasureValueFilter.js +66 -0
- package/esm/presentation/automationFilters/components/AutomationMeasureValueFilterContext.d.ts +25 -0
- package/esm/presentation/automationFilters/components/AutomationMeasureValueFilterContext.js +28 -0
- package/esm/presentation/automationFilters/useAutomationFilters.d.ts +4 -1
- package/esm/presentation/automationFilters/useAutomationFilters.js +35 -4
- package/esm/presentation/automationFilters/utils.d.ts +2 -1
- package/esm/presentation/automationFilters/utils.js +34 -5
- package/esm/presentation/dragAndDrop/draggableParameterFilter/DefaultParameterDraggingComponent.js +1 -1
- package/esm/presentation/dragAndDrop/useFilterDeleteDrop.js +2 -2
- package/esm/presentation/filterBar/filterBar/DefaultFilterBar.js +1 -1
- package/esm/presentation/filterBar/measureValueFilter/DefaultDashboardMeasureValueFilter.js +8 -42
- package/esm/presentation/filterBar/measureValueFilter/useDashboardMeasureValueFilterData.d.ts +86 -0
- package/esm/presentation/filterBar/measureValueFilter/useDashboardMeasureValueFilterData.js +105 -0
- package/esm/presentation/filterBar/parameterFilter/DashboardParameterFilter.js +3 -3
- package/esm/presentation/filterBar/parameterFilter/DashboardParameterPicker.js +3 -3
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/Insight/DashboardInsight.js +1 -1
- package/esm/sdk-ui-dashboard.d.ts +44 -32
- package/package.json +21 -21
- package/esm/model/store/parameters/index.d.ts +0 -12
- package/esm/model/store/parameters/index.js +0 -14
- package/esm/model/store/parameters/parametersReducers.js +0 -36
- package/esm/model/store/parameters/parametersSelectors.d.ts +0 -67
- package/esm/model/store/parameters/parametersSelectors.js +0 -122
- package/esm/model/store/parameters/parametersState.js +0 -4
|
@@ -3,8 +3,8 @@ import { DashboardParameterModeValues, isIdentifierRef } from "@gooddata/sdk-mod
|
|
|
3
3
|
import { ParameterPicker } from "@gooddata/sdk-ui-kit";
|
|
4
4
|
import { useDashboardDispatch, useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
5
5
|
import { selectCatalogParameters, selectCatalogParametersStatus, } from "../../../model/store/catalog/catalogSelectors.js";
|
|
6
|
-
import {
|
|
7
|
-
import { selectActiveParameterRefKeys } from "../../../model/store/parameters/parametersSelectors.js";
|
|
6
|
+
import { tabsActions } from "../../../model/store/tabs/index.js";
|
|
7
|
+
import { selectActiveParameterRefKeys } from "../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
8
8
|
const PICKER_MAX_LIST_HEIGHT = 320;
|
|
9
9
|
/**
|
|
10
10
|
* Connected wrapper around sdk-ui-kit's `ParameterPicker`.
|
|
@@ -22,7 +22,7 @@ export function DashboardParameterPicker({ onAdd, onCancel }) {
|
|
|
22
22
|
if (!isIdentifierRef(ref)) {
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
|
-
dispatch(
|
|
25
|
+
dispatch(tabsActions.addParameter({
|
|
26
26
|
parameter: {
|
|
27
27
|
ref,
|
|
28
28
|
parameterType: "NUMBER",
|
package/esm/presentation/widget/insight/ViewModeDashboardInsight/Insight/DashboardInsight.js
CHANGED
|
@@ -14,9 +14,9 @@ import { useWidgetExecutionsHandler } from "../../../../../model/react/useWidget
|
|
|
14
14
|
import { useWidgetFilters } from "../../../../../model/react/useWidgetFilters.js";
|
|
15
15
|
import { selectAgGridToken, selectColorPalette, selectEnableExecutionCancelling, selectEnableSnapshotExportAccessibility, selectIsExport, selectLocale, selectMapboxToken, selectMaxZoomLevel, selectSeparators, selectSettings, } from "../../../../../model/store/config/configSelectors.js";
|
|
16
16
|
import { selectCrossFilteringSelectedPointsByWidgetRef, selectDrillableItems, } from "../../../../../model/store/drill/drillSelectors.js";
|
|
17
|
-
import { selectEffectiveParameterValuesForWidget } from "../../../../../model/store/parameters/parametersSelectors.js";
|
|
18
17
|
import { selectPermissions } from "../../../../../model/store/permissions/permissionsSelectors.js";
|
|
19
18
|
import { selectIsInEditMode, selectIsInExportMode, } from "../../../../../model/store/renderMode/renderModeSelectors.js";
|
|
19
|
+
import { selectEffectiveParameterValuesForWidget } from "../../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
20
20
|
import { selectExecutionTimestamp } from "../../../../../model/store/ui/uiSelectors.js";
|
|
21
21
|
import { useDashboardComponentsContext } from "../../../../dashboardContexts/DashboardComponentsContext.js";
|
|
22
22
|
import { useMinimalSizeValidation } from "../../../../export/hooks/useMinimalSizeValidation.js";
|
|
@@ -3215,11 +3215,6 @@ export declare type DashboardState = {
|
|
|
3215
3215
|
users: IUsersState;
|
|
3216
3216
|
/** @alpha */
|
|
3217
3217
|
notificationChannels: INotificationChannelsState;
|
|
3218
|
-
/**
|
|
3219
|
-
* Dashboard-level parameter overrides slice.
|
|
3220
|
-
* @alpha
|
|
3221
|
-
*/
|
|
3222
|
-
parameters: IParametersState;
|
|
3223
3218
|
/**
|
|
3224
3219
|
* Internal state for dashboard summary AI workflow.
|
|
3225
3220
|
*
|
|
@@ -4971,6 +4966,11 @@ export declare type FluidLayoutCustomizationFn = (layout: IDashboardLayout<Exten
|
|
|
4971
4966
|
*/
|
|
4972
4967
|
export declare function formatKeyDriverAnalysisDateRange(range: DeepReadonly<[IKdaDataPoint, IKdaDataPoint]> | undefined, splitter: string): string;
|
|
4973
4968
|
|
|
4969
|
+
/**
|
|
4970
|
+
* @internal
|
|
4971
|
+
*/
|
|
4972
|
+
export declare function getAttributeFilters(filters: FilterContextItem[]): DashboardAttributeFilterItem[];
|
|
4973
|
+
|
|
4974
4974
|
/**
|
|
4975
4975
|
* @internal
|
|
4976
4976
|
* Gets author from capabilities and user
|
|
@@ -5352,7 +5352,7 @@ export declare interface IAddMeasureValueFilterPayload {
|
|
|
5352
5352
|
}
|
|
5353
5353
|
|
|
5354
5354
|
/**
|
|
5355
|
-
* Add a parameter to the
|
|
5355
|
+
* Add a parameter to the active tab. Initial `runtimeOverride` is `parameter.value`
|
|
5356
5356
|
* (when pinned) otherwise the workspace default supplied by the caller.
|
|
5357
5357
|
*
|
|
5358
5358
|
* @alpha
|
|
@@ -13950,9 +13950,20 @@ export declare interface IKdaDefinition {
|
|
|
13950
13950
|
*/
|
|
13951
13951
|
metrics?: IMeasure[];
|
|
13952
13952
|
/**
|
|
13953
|
-
*
|
|
13953
|
+
* Attribute filters to apply.
|
|
13954
|
+
*
|
|
13955
|
+
* Attribute filters drive both the KDA "segment-by attribute" UI in the dialog and the
|
|
13956
|
+
* scope of the change analysis computation.
|
|
13954
13957
|
*/
|
|
13955
13958
|
filters?: DashboardAttributeFilterItem[];
|
|
13959
|
+
/**
|
|
13960
|
+
* Measure value filters to apply to the change analysis computation.
|
|
13961
|
+
*
|
|
13962
|
+
* They are not editable in the dialog UI (KDA segments by attribute, not by metric value),
|
|
13963
|
+
* but the dashboard MVFs are propagated to the backend so the computation respects the
|
|
13964
|
+
* same metric-driven scope as the rest of the dashboard.
|
|
13965
|
+
*/
|
|
13966
|
+
measureValueFilters?: IDashboardMeasureValueFilter[];
|
|
13956
13967
|
/**
|
|
13957
13968
|
* Date attribute
|
|
13958
13969
|
*/
|
|
@@ -18847,6 +18858,7 @@ export declare interface ITabState {
|
|
|
18847
18858
|
filterContext?: FilterContextState;
|
|
18848
18859
|
filterGroupsConfig?: IDashboardFilterGroupsConfig;
|
|
18849
18860
|
layout?: ILayoutState;
|
|
18861
|
+
parameters?: IParametersState;
|
|
18850
18862
|
/**
|
|
18851
18863
|
* UI-only flag indicating the tab is currently being renamed.
|
|
18852
18864
|
* @internal
|
|
@@ -20875,16 +20887,6 @@ export declare type ParameterDraggableItem = {
|
|
|
20875
20887
|
ref: ObjRef;
|
|
20876
20888
|
};
|
|
20877
20889
|
|
|
20878
|
-
/**
|
|
20879
|
-
* @internal
|
|
20880
|
-
*/
|
|
20881
|
-
export declare const parametersActions: {
|
|
20882
|
-
addParameter: ActionCreatorWithPayload<IAddParameterPayload, "parameters/addParameter">;
|
|
20883
|
-
setParameterRuntimeValue: ActionCreatorWithPayload<ISetParameterRuntimeValuePayload, "parameters/setParameterRuntimeValue">;
|
|
20884
|
-
removeParameter: ActionCreatorWithPayload<IRemoveParameterPayload, "parameters/removeParameter">;
|
|
20885
|
-
setParameterEntries: ActionCreatorWithPayload<IDashboardParameterEntry[], "parameters/setParameterEntries">;
|
|
20886
|
-
};
|
|
20887
|
-
|
|
20888
20890
|
/**
|
|
20889
20891
|
* @beta
|
|
20890
20892
|
*/
|
|
@@ -21323,11 +21325,6 @@ export declare function removeAttributeFilters(filterLocalIds: string[], correla
|
|
|
21323
21325
|
*/
|
|
21324
21326
|
export declare function removeDateFilter(dataSet: ObjRef, correlationId?: string): IRemoveDateFilters;
|
|
21325
21327
|
|
|
21326
|
-
/**
|
|
21327
|
-
* @internal
|
|
21328
|
-
*/
|
|
21329
|
-
export declare function removeDateFilters(filters: FilterContextItem[]): DashboardAttributeFilterItem[];
|
|
21330
|
-
|
|
21331
21328
|
/**
|
|
21332
21329
|
* Creates the RemoveDrillDownForInsightWidget command. Dispatching the created command will remove insight widget's
|
|
21333
21330
|
* drill definition for the provided measure.
|
|
@@ -23146,14 +23143,15 @@ export declare const selectDashboardLockedFilters: DashboardSelector<FilterConte
|
|
|
23146
23143
|
export declare const selectDashboardLockStatus: DashboardSelector<boolean>;
|
|
23147
23144
|
|
|
23148
23145
|
/**
|
|
23149
|
-
* Returns the full per-parameter entries (persisted shape + ephemeral `runtimeOverride`)
|
|
23146
|
+
* Returns the full per-parameter entries (persisted shape + ephemeral `runtimeOverride`) for the
|
|
23147
|
+
* active tab.
|
|
23150
23148
|
*
|
|
23151
23149
|
* @internal
|
|
23152
23150
|
*/
|
|
23153
23151
|
export declare const selectDashboardParameterEntries: DashboardSelector<IDashboardParameterEntry[]>;
|
|
23154
23152
|
|
|
23155
23153
|
/**
|
|
23156
|
-
* Returns the persisted-shape parameter entries currently held by the
|
|
23154
|
+
* Returns the persisted-shape parameter entries currently held by the active tab.
|
|
23157
23155
|
*
|
|
23158
23156
|
* @alpha
|
|
23159
23157
|
*/
|
|
@@ -23624,11 +23622,12 @@ export declare const selectEffectiveDateFilterTitle: DashboardSelector<string |
|
|
|
23624
23622
|
* Returns the parameter values to inject into the widget's `IExecutionConfig.parameterValues`.
|
|
23625
23623
|
*
|
|
23626
23624
|
* @remarks
|
|
23627
|
-
* The
|
|
23628
|
-
*
|
|
23629
|
-
*
|
|
23630
|
-
*
|
|
23631
|
-
*
|
|
23625
|
+
* The widget's owning tab is resolved from layout, then the result is the intersection of that
|
|
23626
|
+
* tab's parameter entries and the parameters referenced by the widget's insight (per
|
|
23627
|
+
* `insightParameters`). Dashboard parameters not referenced by the widget's insight are excluded
|
|
23628
|
+
* so that adding/removing unrelated parameters does not invalidate the widget's `defFingerprint`.
|
|
23629
|
+
* Returns an empty array when `enableParameters` is off so persisted parameter values cannot
|
|
23630
|
+
* silently affect execution while the UI is hidden.
|
|
23632
23631
|
*
|
|
23633
23632
|
* @alpha
|
|
23634
23633
|
*/
|
|
@@ -25008,7 +25007,8 @@ export declare const selectIsNewDashboard: DashboardSelector<boolean>;
|
|
|
25008
25007
|
export declare const selectIsNewDashboardWithContent: DashboardSelector<boolean>;
|
|
25009
25008
|
|
|
25010
25009
|
/**
|
|
25011
|
-
* Returns true if the dashboard parameters that would be persisted differ from the persisted
|
|
25010
|
+
* Returns true if the dashboard parameters that would be persisted differ from the persisted
|
|
25011
|
+
* version on any tab.
|
|
25012
25012
|
*
|
|
25013
25013
|
* @alpha
|
|
25014
25014
|
*/
|
|
@@ -25399,8 +25399,8 @@ export declare const selectOtherContextAttributeFilterItems: (ref?: ObjRef) => D
|
|
|
25399
25399
|
export declare const selectOtherContextAttributeFilters: (ref?: ObjRef) => DashboardSelector<IDashboardAttributeFilter[]>;
|
|
25400
25400
|
|
|
25401
25401
|
/**
|
|
25402
|
-
* Returns a selector that yields the current `runtimeOverride` for a given parameter ref
|
|
25403
|
-
* or `undefined` if the
|
|
25402
|
+
* Returns a selector that yields the current `runtimeOverride` for a given parameter ref on the
|
|
25403
|
+
* active tab, or `undefined` if the active tab does not hold an entry for that ref.
|
|
25404
25404
|
*
|
|
25405
25405
|
* @alpha
|
|
25406
25406
|
*/
|
|
@@ -27004,6 +27004,18 @@ readonly removeMeasureValueFilterConfig: (state: WritableDraft<ITabsState>, acti
|
|
|
27004
27004
|
payload: string;
|
|
27005
27005
|
type: string;
|
|
27006
27006
|
}) => void | ITabsState | WritableDraft<ITabsState>;
|
|
27007
|
+
readonly addParameter: (state: WritableDraft<ITabsState>, action: {
|
|
27008
|
+
payload: IAddParameterPayload;
|
|
27009
|
+
type: string;
|
|
27010
|
+
}) => void | ITabsState | WritableDraft<ITabsState>;
|
|
27011
|
+
readonly setParameterRuntimeValue: (state: WritableDraft<ITabsState>, action: {
|
|
27012
|
+
payload: ISetParameterRuntimeValuePayload;
|
|
27013
|
+
type: string;
|
|
27014
|
+
}) => void | ITabsState | WritableDraft<ITabsState>;
|
|
27015
|
+
readonly removeParameter: (state: WritableDraft<ITabsState>, action: {
|
|
27016
|
+
payload: IRemoveParameterPayload;
|
|
27017
|
+
type: string;
|
|
27018
|
+
}) => void | ITabsState | WritableDraft<ITabsState>;
|
|
27007
27019
|
}, "tabs">;
|
|
27008
27020
|
|
|
27009
27021
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-dashboard",
|
|
3
|
-
"version": "11.35.0-alpha.
|
|
3
|
+
"version": "11.35.0-alpha.7",
|
|
4
4
|
"description": "GoodData SDK - Dashboard Component",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -60,19 +60,19 @@
|
|
|
60
60
|
"ts-invariant": "0.10.3",
|
|
61
61
|
"tslib": "2.8.1",
|
|
62
62
|
"uuid": "11.1.0",
|
|
63
|
-
"@gooddata/sdk-backend-base": "11.35.0-alpha.
|
|
64
|
-
"@gooddata/sdk-backend-spi": "11.35.0-alpha.
|
|
65
|
-
"@gooddata/sdk-model": "11.35.0-alpha.
|
|
66
|
-
"@gooddata/sdk-ui": "11.35.0-alpha.
|
|
67
|
-
"@gooddata/sdk-ui-charts": "11.35.0-alpha.
|
|
68
|
-
"@gooddata/sdk-ui-ext": "11.35.0-alpha.
|
|
69
|
-
"@gooddata/sdk-ui-
|
|
70
|
-
"@gooddata/sdk-ui-
|
|
71
|
-
"@gooddata/sdk-ui-
|
|
72
|
-
"@gooddata/sdk-ui-
|
|
73
|
-
"@gooddata/sdk-ui-
|
|
74
|
-
"@gooddata/sdk-ui-vis-commons": "11.35.0-alpha.
|
|
75
|
-
"@gooddata/util": "11.35.0-alpha.
|
|
63
|
+
"@gooddata/sdk-backend-base": "11.35.0-alpha.7",
|
|
64
|
+
"@gooddata/sdk-backend-spi": "11.35.0-alpha.7",
|
|
65
|
+
"@gooddata/sdk-model": "11.35.0-alpha.7",
|
|
66
|
+
"@gooddata/sdk-ui": "11.35.0-alpha.7",
|
|
67
|
+
"@gooddata/sdk-ui-charts": "11.35.0-alpha.7",
|
|
68
|
+
"@gooddata/sdk-ui-ext": "11.35.0-alpha.7",
|
|
69
|
+
"@gooddata/sdk-ui-filters": "11.35.0-alpha.7",
|
|
70
|
+
"@gooddata/sdk-ui-geo": "11.35.0-alpha.7",
|
|
71
|
+
"@gooddata/sdk-ui-pivot": "11.35.0-alpha.7",
|
|
72
|
+
"@gooddata/sdk-ui-kit": "11.35.0-alpha.7",
|
|
73
|
+
"@gooddata/sdk-ui-theme-provider": "11.35.0-alpha.7",
|
|
74
|
+
"@gooddata/sdk-ui-vis-commons": "11.35.0-alpha.7",
|
|
75
|
+
"@gooddata/util": "11.35.0-alpha.7"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -118,12 +118,12 @@
|
|
|
118
118
|
"typescript": "5.9.3",
|
|
119
119
|
"vitest": "4.1.0",
|
|
120
120
|
"vitest-dom": "0.1.1",
|
|
121
|
-
"@gooddata/
|
|
122
|
-
"@gooddata/
|
|
123
|
-
"@gooddata/
|
|
124
|
-
"@gooddata/reference-workspace": "11.35.0-alpha.
|
|
125
|
-
"@gooddata/
|
|
126
|
-
"@gooddata/
|
|
121
|
+
"@gooddata/i18n-toolkit": "11.35.0-alpha.7",
|
|
122
|
+
"@gooddata/oxlint-config": "11.35.0-alpha.7",
|
|
123
|
+
"@gooddata/eslint-config": "11.35.0-alpha.7",
|
|
124
|
+
"@gooddata/reference-workspace": "11.35.0-alpha.7",
|
|
125
|
+
"@gooddata/stylelint-config": "11.35.0-alpha.7",
|
|
126
|
+
"@gooddata/sdk-backend-mockingbird": "11.35.0-alpha.7"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
129
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"build-check": "tsgo",
|
|
139
139
|
"build-dynamic-files": "bash scripts/build.sh --genFilesOnly",
|
|
140
140
|
"build-ts": "tsgo -p tsconfig.build.json",
|
|
141
|
-
"clean": "../../common/scripts/clean-command-state.sh && rm -rf ci dist esm coverage *.log styles/css tsconfig.tsbuildinfo",
|
|
141
|
+
"clean": "../../common/scripts/clean-command-state.sh && rm -rf ci dist esm coverage temp *.log styles/css tsconfig.tsbuildinfo",
|
|
142
142
|
"dep-cruiser": "depcruise --validate .dependency-cruiser.js --output-type err-long src/",
|
|
143
143
|
"format-check": "oxfmt --check .",
|
|
144
144
|
"format-write": "oxfmt .",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import { type IParametersState } from "./parametersState.js";
|
|
3
|
-
export declare const parametersSliceReducer: Reducer<IParametersState>;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare const parametersActions: {
|
|
8
|
-
addParameter: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./parametersReducers.js").IAddParameterPayload, "parameters/addParameter">;
|
|
9
|
-
setParameterRuntimeValue: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./parametersReducers.js").ISetParameterRuntimeValuePayload, "parameters/setParameterRuntimeValue">;
|
|
10
|
-
removeParameter: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./parametersReducers.js").IRemoveParameterPayload, "parameters/removeParameter">;
|
|
11
|
-
setParameterEntries: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./parametersState.js").IDashboardParameterEntry[], "parameters/setParameterEntries">;
|
|
12
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { createSlice } from "@reduxjs/toolkit";
|
|
3
|
-
import { parametersReducers } from "./parametersReducers.js";
|
|
4
|
-
import { parametersInitialState } from "./parametersState.js";
|
|
5
|
-
const parametersSlice = createSlice({
|
|
6
|
-
name: "parameters",
|
|
7
|
-
initialState: parametersInitialState,
|
|
8
|
-
reducers: parametersReducers,
|
|
9
|
-
});
|
|
10
|
-
export const parametersSliceReducer = parametersSlice.reducer;
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export const parametersActions = { ...parametersSlice.actions };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { areObjRefsEqual } from "@gooddata/sdk-model";
|
|
3
|
-
const addParameter = (state, action) => {
|
|
4
|
-
const { parameter, workspaceDefault } = action.payload;
|
|
5
|
-
if (state.parameters.some((entry) => areObjRefsEqual(entry.parameter.ref, parameter.ref))) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
state.parameters.push({
|
|
9
|
-
parameter,
|
|
10
|
-
runtimeOverride: parameter.value ?? workspaceDefault,
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
const setParameterRuntimeValue = (state, action) => {
|
|
14
|
-
const { ref, value } = action.payload;
|
|
15
|
-
const entry = state.parameters.find((item) => areObjRefsEqual(item.parameter.ref, ref));
|
|
16
|
-
if (entry) {
|
|
17
|
-
entry.runtimeOverride = value;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const removeParameter = (state, action) => {
|
|
21
|
-
state.parameters = state.parameters.filter((entry) => !areObjRefsEqual(entry.parameter.ref, action.payload.ref));
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Replace the entire entry list. Used when (re-)loading a persisted dashboard.
|
|
25
|
-
*
|
|
26
|
-
* @alpha
|
|
27
|
-
*/
|
|
28
|
-
const setParameterEntries = (state, action) => {
|
|
29
|
-
state.parameters = action.payload;
|
|
30
|
-
};
|
|
31
|
-
export const parametersReducers = {
|
|
32
|
-
addParameter,
|
|
33
|
-
setParameterRuntimeValue,
|
|
34
|
-
removeParameter,
|
|
35
|
-
setParameterEntries,
|
|
36
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { type IDashboardParameter, type IInsightParameterValue, type ObjRef } from "@gooddata/sdk-model";
|
|
2
|
-
import { type DashboardSelector } from "../types.js";
|
|
3
|
-
import { type IDashboardParameterEntry } from "./parametersState.js";
|
|
4
|
-
/**
|
|
5
|
-
* Returns the persisted-shape parameter entries currently held by the dashboard.
|
|
6
|
-
*
|
|
7
|
-
* @alpha
|
|
8
|
-
*/
|
|
9
|
-
export declare const selectDashboardParameters: DashboardSelector<IDashboardParameter[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Returns currently active parameter references.
|
|
12
|
-
*
|
|
13
|
-
* @alpha
|
|
14
|
-
*/
|
|
15
|
-
export declare const selectActiveParameterRefKeys: DashboardSelector<ReadonlySet<string>>;
|
|
16
|
-
/**
|
|
17
|
-
* Returns the full per-parameter entries (persisted shape + ephemeral `runtimeOverride`).
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export declare const selectDashboardParameterEntries: DashboardSelector<IDashboardParameterEntry[]>;
|
|
22
|
-
/**
|
|
23
|
-
* Returns a selector that yields the entry held by the dashboard for a given parameter ref,
|
|
24
|
-
* or `undefined` if no such entry exists.
|
|
25
|
-
*
|
|
26
|
-
* @alpha
|
|
27
|
-
*/
|
|
28
|
-
export declare const selectDashboardParameterEntryByRef: (ref: ObjRef) => DashboardSelector<IDashboardParameterEntry | undefined>;
|
|
29
|
-
/**
|
|
30
|
-
* Returns a selector that yields the current `runtimeOverride` for a given parameter ref,
|
|
31
|
-
* or `undefined` if the dashboard does not hold an entry for that ref.
|
|
32
|
-
*
|
|
33
|
-
* @alpha
|
|
34
|
-
*/
|
|
35
|
-
export declare const selectParameterRuntimeOverrideByRef: (ref: ObjRef) => DashboardSelector<number | undefined>;
|
|
36
|
-
/**
|
|
37
|
-
* Computes the dashboard parameters in the shape that would be persisted on save right now.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* For resolved entries (catalog parameters loaded AND ref present), applies smart persistence:
|
|
41
|
-
* `value` is dropped when equal to the workspace default and `label` is dropped when equal
|
|
42
|
-
* to the parameter title. For non-resolved entries (catalog not loaded, gated off, or ref
|
|
43
|
-
* missing), the persisted entry is passed through verbatim so we never compare against an
|
|
44
|
-
* unknown workspace default.
|
|
45
|
-
*
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
export declare const selectSmartPersistedDashboardParameters: DashboardSelector<IDashboardParameter[]>;
|
|
49
|
-
/**
|
|
50
|
-
* Returns true if the dashboard parameters that would be persisted differ from the persisted version.
|
|
51
|
-
*
|
|
52
|
-
* @alpha
|
|
53
|
-
*/
|
|
54
|
-
export declare const selectIsParametersChanged: DashboardSelector<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Returns the parameter values to inject into the widget's `IExecutionConfig.parameterValues`.
|
|
57
|
-
*
|
|
58
|
-
* @remarks
|
|
59
|
-
* The result is the intersection of dashboard parameter entries and the parameters referenced
|
|
60
|
-
* by the widget's insight (per `insightParameters`). Dashboard parameters not referenced by the
|
|
61
|
-
* widget's insight are excluded so that adding/removing unrelated parameters does not invalidate
|
|
62
|
-
* the widget's `defFingerprint`. Returns an empty array when `enableParameters` is off so
|
|
63
|
-
* persisted parameter values cannot silently affect execution while the UI is hidden.
|
|
64
|
-
*
|
|
65
|
-
* @alpha
|
|
66
|
-
*/
|
|
67
|
-
export declare const selectEffectiveParameterValuesForWidget: (ref: ObjRef | undefined) => DashboardSelector<IInsightParameterValue[]>;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { createSelector } from "@reduxjs/toolkit";
|
|
3
|
-
import { isEqual } from "lodash-es";
|
|
4
|
-
import { areObjRefsEqual, insightParameters, isNumberParameterDefinition, objRefToString, } from "@gooddata/sdk-model";
|
|
5
|
-
import { createMemoizedSelector } from "../_infra/selectors.js";
|
|
6
|
-
import { selectCatalogParameters, selectCatalogParametersIsLoaded } from "../catalog/catalogSelectors.js";
|
|
7
|
-
import { selectEnableParameters } from "../config/configSelectors.js";
|
|
8
|
-
import { selectInsightByWidgetRef } from "../insights/insightsSelectors.js";
|
|
9
|
-
const selectSelf = (state) => state.parameters;
|
|
10
|
-
const EMPTY_PARAMETERS = [];
|
|
11
|
-
const selectPersistedParametersFromMeta = (state) => state.meta?.persistedDashboard?.parameters ?? EMPTY_PARAMETERS;
|
|
12
|
-
/**
|
|
13
|
-
* Returns the persisted-shape parameter entries currently held by the dashboard.
|
|
14
|
-
*
|
|
15
|
-
* @alpha
|
|
16
|
-
*/
|
|
17
|
-
export const selectDashboardParameters = createSelector(selectSelf, (state) => state.parameters.map((entry) => entry.parameter));
|
|
18
|
-
/**
|
|
19
|
-
* Returns currently active parameter references.
|
|
20
|
-
*
|
|
21
|
-
* @alpha
|
|
22
|
-
*/
|
|
23
|
-
export const selectActiveParameterRefKeys = createSelector(selectDashboardParameters, (parameters) => new Set(parameters.map((parameter) => objRefToString(parameter.ref))));
|
|
24
|
-
/**
|
|
25
|
-
* Returns the full per-parameter entries (persisted shape + ephemeral `runtimeOverride`).
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export const selectDashboardParameterEntries = createSelector(selectSelf, (state) => state.parameters);
|
|
30
|
-
/**
|
|
31
|
-
* Returns a selector that yields the entry held by the dashboard for a given parameter ref,
|
|
32
|
-
* or `undefined` if no such entry exists.
|
|
33
|
-
*
|
|
34
|
-
* @alpha
|
|
35
|
-
*/
|
|
36
|
-
export const selectDashboardParameterEntryByRef = createMemoizedSelector((ref) => createSelector(selectSelf, (state) => state.parameters.find((item) => areObjRefsEqual(item.parameter.ref, ref))));
|
|
37
|
-
/**
|
|
38
|
-
* Returns a selector that yields the current `runtimeOverride` for a given parameter ref,
|
|
39
|
-
* or `undefined` if the dashboard does not hold an entry for that ref.
|
|
40
|
-
*
|
|
41
|
-
* @alpha
|
|
42
|
-
*/
|
|
43
|
-
export const selectParameterRuntimeOverrideByRef = createMemoizedSelector((ref) => createSelector(selectDashboardParameterEntryByRef(ref), (entry) => entry?.runtimeOverride));
|
|
44
|
-
/**
|
|
45
|
-
* Computes the dashboard parameters in the shape that would be persisted on save right now.
|
|
46
|
-
*
|
|
47
|
-
* @remarks
|
|
48
|
-
* For resolved entries (catalog parameters loaded AND ref present), applies smart persistence:
|
|
49
|
-
* `value` is dropped when equal to the workspace default and `label` is dropped when equal
|
|
50
|
-
* to the parameter title. For non-resolved entries (catalog not loaded, gated off, or ref
|
|
51
|
-
* missing), the persisted entry is passed through verbatim so we never compare against an
|
|
52
|
-
* unknown workspace default.
|
|
53
|
-
*
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
export const selectSmartPersistedDashboardParameters = createSelector(selectDashboardParameterEntries, selectCatalogParameters, selectCatalogParametersIsLoaded, selectPersistedParametersFromMeta, (entries, workspaceParameters, isCatalogLoaded, persistedParameters) => {
|
|
57
|
-
const persistedByRef = new Map(persistedParameters.map((parameter) => [objRefToString(parameter.ref), parameter]));
|
|
58
|
-
const workspaceByRef = new Map(workspaceParameters.map((wp) => [objRefToString(wp.ref), wp]));
|
|
59
|
-
return entries.map((entry) => {
|
|
60
|
-
const refKey = objRefToString(entry.parameter.ref);
|
|
61
|
-
const workspaceParameter = isCatalogLoaded ? workspaceByRef.get(refKey) : undefined;
|
|
62
|
-
if (!workspaceParameter) {
|
|
63
|
-
return persistedByRef.get(refKey) ?? entry.parameter;
|
|
64
|
-
}
|
|
65
|
-
return smartPersistResolvedEntry(entry, workspaceParameter);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
/**
|
|
69
|
-
* Returns true if the dashboard parameters that would be persisted differ from the persisted version.
|
|
70
|
-
*
|
|
71
|
-
* @alpha
|
|
72
|
-
*/
|
|
73
|
-
export const selectIsParametersChanged = createSelector(selectSmartPersistedDashboardParameters, selectPersistedParametersFromMeta, (smartPersisted, persisted) => !isEqual(smartPersisted, persisted));
|
|
74
|
-
/**
|
|
75
|
-
* Returns the parameter values to inject into the widget's `IExecutionConfig.parameterValues`.
|
|
76
|
-
*
|
|
77
|
-
* @remarks
|
|
78
|
-
* The result is the intersection of dashboard parameter entries and the parameters referenced
|
|
79
|
-
* by the widget's insight (per `insightParameters`). Dashboard parameters not referenced by the
|
|
80
|
-
* widget's insight are excluded so that adding/removing unrelated parameters does not invalidate
|
|
81
|
-
* the widget's `defFingerprint`. Returns an empty array when `enableParameters` is off so
|
|
82
|
-
* persisted parameter values cannot silently affect execution while the UI is hidden.
|
|
83
|
-
*
|
|
84
|
-
* @alpha
|
|
85
|
-
*/
|
|
86
|
-
export const selectEffectiveParameterValuesForWidget = createMemoizedSelector((ref) => createSelector(selectDashboardParameterEntries, selectInsightByWidgetRef(ref), selectEnableParameters, (entries, insight, isEnabled) => {
|
|
87
|
-
if (!isEnabled || !insight) {
|
|
88
|
-
return [];
|
|
89
|
-
}
|
|
90
|
-
const referencedRefs = new Set(insightParameters(insight).map((parameter) => objRefToString(parameter.ref)));
|
|
91
|
-
const result = [];
|
|
92
|
-
for (const entry of entries) {
|
|
93
|
-
if (entry.runtimeOverride === undefined) {
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
if (referencedRefs.has(objRefToString(entry.parameter.ref))) {
|
|
97
|
-
result.push({ ref: entry.parameter.ref, value: entry.runtimeOverride });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return result;
|
|
101
|
-
}));
|
|
102
|
-
function smartPersistResolvedEntry(entry, workspaceParameter) {
|
|
103
|
-
const workspaceDefault = isNumberParameterDefinition(workspaceParameter.definition)
|
|
104
|
-
? workspaceParameter.definition.defaultValue
|
|
105
|
-
: undefined;
|
|
106
|
-
const result = {
|
|
107
|
-
ref: entry.parameter.ref,
|
|
108
|
-
parameterType: entry.parameter.parameterType,
|
|
109
|
-
mode: entry.parameter.mode,
|
|
110
|
-
...labelOverride(entry, workspaceParameter),
|
|
111
|
-
};
|
|
112
|
-
if (entry.runtimeOverride === undefined || entry.runtimeOverride === workspaceDefault) {
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
return { ...result, value: entry.runtimeOverride };
|
|
116
|
-
}
|
|
117
|
-
function labelOverride(entry, workspaceParameter) {
|
|
118
|
-
if (entry.parameter.label && entry.parameter.label !== workspaceParameter.title) {
|
|
119
|
-
return { label: entry.parameter.label };
|
|
120
|
-
}
|
|
121
|
-
return {};
|
|
122
|
-
}
|