@gooddata/sdk-ui-dashboard 11.40.0-alpha.0 → 11.40.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.js +3 -3
- package/esm/model/commandHandlers/dashboard/exportToTabularHandler.js +5 -2
- package/esm/model/commandHandlers/dashboard/saveAsDashboardHandler.js +6 -0
- package/esm/model/commandHandlers/dashboard/saveDashboardHandler.js +65 -30
- package/esm/model/commandHandlers/index.js +0 -2
- package/esm/model/commandHandlers/tabs/createDashboardTabHandler.js +2 -2
- package/esm/model/commands/base.d.ts +1 -1
- package/esm/model/commands/index.d.ts +2 -2
- package/esm/model/commands/tabs.d.ts +0 -35
- package/esm/model/commands/tabs.js +0 -16
- package/esm/model/events/base.d.ts +1 -1
- package/esm/model/events/index.d.ts +2 -2
- package/esm/model/events/tabs.d.ts +0 -44
- package/esm/model/events/tabs.js +0 -28
- package/esm/model/react/useDashboardCommand.d.ts +0 -1
- package/esm/model/react/useDashboardCommandProcessing.d.ts +0 -4
- package/esm/model/store/tabs/index.d.ts +6 -0
- package/esm/model/store/tabs/layout/layoutSelectors.d.ts +41 -1
- package/esm/model/store/tabs/layout/layoutSelectors.js +38 -0
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts +86 -0
- package/esm/model/store/tabs/parameters/parametersHelpers.js +208 -0
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +21 -16
- package/esm/model/store/tabs/parameters/parametersSelectors.js +45 -127
- package/esm/model/store/tabs/tabsReducers.d.ts +6 -0
- package/esm/model/store/tabs/tabsReducers.js +16 -0
- package/esm/model/utils/tabLocalIdentifier.d.ts +4 -0
- package/esm/model/utils/tabLocalIdentifier.js +12 -0
- package/esm/presentation/dashboard/DashboardHeader/DashboardTabs.js +2 -10
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +1 -0
- package/esm/sdk-ui-dashboard.d.ts +35 -94
- package/package.json +20 -20
- package/esm/model/commandHandlers/tabs/convertDashboardTabFromDefaultHandler.d.ts +0 -4
- package/esm/model/commandHandlers/tabs/convertDashboardTabFromDefaultHandler.js +0 -40
|
@@ -15,7 +15,7 @@ import { type IDashboardRenderModeChanged } from "./renderMode.js";
|
|
|
15
15
|
import { type IDashboardRichTextWidgetContentChanged, type IDashboardRichTextWidgetFilterSettingsChanged } from "./richText.js";
|
|
16
16
|
import { type IDashboardAutomationsRefreshed, type IDashboardScheduledEmailCreated, type IDashboardScheduledEmailSaved } from "./scheduledEmail.js";
|
|
17
17
|
import { type IShowWidgetAsTableSet } from "./showWidgetAsTable.js";
|
|
18
|
-
import { type
|
|
18
|
+
import { type IDashboardTabCreated, type IDashboardTabDeleted, type IDashboardTabRenamed, type IDashboardTabRenamingCanceled, type IDashboardTabRenamingStarted, type IDashboardTabSwitched } from "./tabs.js";
|
|
19
19
|
import { type IDashboardUserInteractionTriggered } from "./userInteraction.js";
|
|
20
20
|
import { type IDashboardVisualizationSwitcherWidgetVisualizationAdded, type IDashboardVisualizationSwitcherWidgetVisualizationsUpdated } from "./visualizationSwitcher.js";
|
|
21
21
|
import { type IDashboardWidgetExecutionFailed, type IDashboardWidgetExecutionStarted, type IDashboardWidgetExecutionSucceeded } from "./widget.js";
|
|
@@ -29,7 +29,7 @@ import { type IDashboardWidgetExecutionFailed, type IDashboardWidgetExecutionSta
|
|
|
29
29
|
*
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
|
-
export type DashboardEvents = DashboardInitialized | DashboardDeinitialized | DateFilterValidationFailed | DashboardSaved | DashboardCopySaved | DashboardRenderRequested | DashboardAsyncRenderRequested | DashboardAsyncRenderResolved | DashboardRenderResolved | DashboardSharingChanged | IDashboardRenderModeChanged | IDashboardCommandStarted<any> | IDashboardCommandFailed<any> | IDashboardCommandRejected | IDashboardQueryFailed | IDashboardQueryRejected | IDashboardQueryStarted | IDashboardQueryCompleted<any, any> | IDashboardRenamed | IDashboardWasReset | IDashboardExportToPdfRequested | IDashboardExportToPdfResolved | IDashboardExportToExcelRequested | IDashboardExportToExcelResolved | IDashboardExportToPdfPresentationRequested | IDashboardExportToPdfPresentationResolved | IDashboardExportToPptPresentationResolved | IDashboardExportToPptPresentationRequested | IDashboardExportToImageRequested | IDashboardExportToImageResolved | IDashboardUserInteractionTriggered | DashboardDateFilterSelectionChanged | IDashboardAttributeFilterAdded | IDashboardAttributeFilterRemoved | IDashboardAttributeFilterMoved | DashboardAttributeFilterSelectionChanged | DashboardAttributeFilterItemSelectionReplaced | IDashboardAttributeTitleChanged | IDashboardAttributeSelectionModeChanged | IDashboardAttributeFilterParentChanged | IDashboardMeasureValueFilterAdded | IDashboardMeasureValueFilterMoved | IDashboardMeasureValueFilterRemoved | IDashboardMeasureValueFilterConditionChanged | IDashboardMeasureValueFilterDimensionalityChanged | IDashboardMeasureValueFilterTitleChanged | IDashboardMeasureValueFilterConfigModeChanged | DashboardFilterContextChanged | IDashboardLayoutSectionAdded | IDashboardLayoutSectionMoved | IDashboardLayoutSectionRemoved | IDashboardLayoutSectionHeaderChanged | IDashboardLayoutSectionItemsAdded | IDashboardLayoutSectionItemReplaced | IDashboardLayoutSectionItemMoved | IDashboardLayoutSectionItemRemoved | IDashboardLayoutSectionItemMovedToNewSection | IDashboardLayoutChanged | IDashboardKpiWidgetHeaderChanged | IDashboardKpiWidgetDescriptionChanged | IDashboardKpiWidgetConfigurationChanged | IDashboardKpiWidgetMeasureChanged | IDashboardKpiWidgetFilterSettingsChanged | IDashboardKpiWidgetComparisonChanged | IDashboardKpiWidgetDrillRemoved | IDashboardKpiWidgetDrillSet | IDashboardKpiWidgetChanged | IDashboardInsightWidgetHeaderChanged | IDashboardInsightWidgetDescriptionChanged | IDashboardInsightWidgetFilterSettingsChanged | IDashboardInsightWidgetVisPropertiesChanged | IDashboardInsightWidgetVisConfigurationChanged | IDashboardInsightWidgetInsightSwitched | IDashboardInsightWidgetDrillsModified | IDashboardInsightWidgetDrillsRemoved | IDashboardInsightWidgetChanged | IDashboardInsightWidgetExportRequested | IDashboardInsightWidgetExportResolved | IDashboardInsightWidgetRefreshed | IDashboardRichTextWidgetContentChanged | IDashboardRichTextWidgetFilterSettingsChanged | IDashboardVisualizationSwitcherWidgetVisualizationAdded | IDashboardVisualizationSwitcherWidgetVisualizationsUpdated | IDashboardWidgetExecutionStarted | IDashboardWidgetExecutionSucceeded | IDashboardWidgetExecutionFailed | IDashboardAlertCreated | IDashboardAlertSaved | IDashboardScheduledEmailCreated | IDashboardScheduledEmailSaved | IDashboardAutomationsRefreshed | IShowWidgetAsTableSet | IDashboardDrillDownResolved | IDashboardDrillToAttributeUrlResolved | IDashboardDrillToCustomUrlResolved | IDashboardDrillToDashboardResolved | IDashboardDrillToInsightResolved | IDashboardDrillToLegacyDashboardResolved | IDashboardKeyDriverAnalysisResolved | IDashboardKeyDriverAnalysisRequested | IDashboardDrillResolved | IDashboardDrillDownRequested | IDashboardDrillToAttributeUrlRequested | IDashboardDrillToCustomUrlRequested | IDashboardDrillToDashboardRequested | IDashboardDrillToInsightRequested | IDashboardDrillToLegacyDashboardRequested | IDashboardDrillRequested | IDashboardDrillableItemsChanged | IDashboardIgnoreExecutionTimestampChanged | IDashboardTabSwitched |
|
|
32
|
+
export type DashboardEvents = DashboardInitialized | DashboardDeinitialized | DateFilterValidationFailed | DashboardSaved | DashboardCopySaved | DashboardRenderRequested | DashboardAsyncRenderRequested | DashboardAsyncRenderResolved | DashboardRenderResolved | DashboardSharingChanged | IDashboardRenderModeChanged | IDashboardCommandStarted<any> | IDashboardCommandFailed<any> | IDashboardCommandRejected | IDashboardQueryFailed | IDashboardQueryRejected | IDashboardQueryStarted | IDashboardQueryCompleted<any, any> | IDashboardRenamed | IDashboardWasReset | IDashboardExportToPdfRequested | IDashboardExportToPdfResolved | IDashboardExportToExcelRequested | IDashboardExportToExcelResolved | IDashboardExportToPdfPresentationRequested | IDashboardExportToPdfPresentationResolved | IDashboardExportToPptPresentationResolved | IDashboardExportToPptPresentationRequested | IDashboardExportToImageRequested | IDashboardExportToImageResolved | IDashboardUserInteractionTriggered | DashboardDateFilterSelectionChanged | IDashboardAttributeFilterAdded | IDashboardAttributeFilterRemoved | IDashboardAttributeFilterMoved | DashboardAttributeFilterSelectionChanged | DashboardAttributeFilterItemSelectionReplaced | IDashboardAttributeTitleChanged | IDashboardAttributeSelectionModeChanged | IDashboardAttributeFilterParentChanged | IDashboardMeasureValueFilterAdded | IDashboardMeasureValueFilterMoved | IDashboardMeasureValueFilterRemoved | IDashboardMeasureValueFilterConditionChanged | IDashboardMeasureValueFilterDimensionalityChanged | IDashboardMeasureValueFilterTitleChanged | IDashboardMeasureValueFilterConfigModeChanged | DashboardFilterContextChanged | IDashboardLayoutSectionAdded | IDashboardLayoutSectionMoved | IDashboardLayoutSectionRemoved | IDashboardLayoutSectionHeaderChanged | IDashboardLayoutSectionItemsAdded | IDashboardLayoutSectionItemReplaced | IDashboardLayoutSectionItemMoved | IDashboardLayoutSectionItemRemoved | IDashboardLayoutSectionItemMovedToNewSection | IDashboardLayoutChanged | IDashboardKpiWidgetHeaderChanged | IDashboardKpiWidgetDescriptionChanged | IDashboardKpiWidgetConfigurationChanged | IDashboardKpiWidgetMeasureChanged | IDashboardKpiWidgetFilterSettingsChanged | IDashboardKpiWidgetComparisonChanged | IDashboardKpiWidgetDrillRemoved | IDashboardKpiWidgetDrillSet | IDashboardKpiWidgetChanged | IDashboardInsightWidgetHeaderChanged | IDashboardInsightWidgetDescriptionChanged | IDashboardInsightWidgetFilterSettingsChanged | IDashboardInsightWidgetVisPropertiesChanged | IDashboardInsightWidgetVisConfigurationChanged | IDashboardInsightWidgetInsightSwitched | IDashboardInsightWidgetDrillsModified | IDashboardInsightWidgetDrillsRemoved | IDashboardInsightWidgetChanged | IDashboardInsightWidgetExportRequested | IDashboardInsightWidgetExportResolved | IDashboardInsightWidgetRefreshed | IDashboardRichTextWidgetContentChanged | IDashboardRichTextWidgetFilterSettingsChanged | IDashboardVisualizationSwitcherWidgetVisualizationAdded | IDashboardVisualizationSwitcherWidgetVisualizationsUpdated | IDashboardWidgetExecutionStarted | IDashboardWidgetExecutionSucceeded | IDashboardWidgetExecutionFailed | IDashboardAlertCreated | IDashboardAlertSaved | IDashboardScheduledEmailCreated | IDashboardScheduledEmailSaved | IDashboardAutomationsRefreshed | IShowWidgetAsTableSet | IDashboardDrillDownResolved | IDashboardDrillToAttributeUrlResolved | IDashboardDrillToCustomUrlResolved | IDashboardDrillToDashboardResolved | IDashboardDrillToInsightResolved | IDashboardDrillToLegacyDashboardResolved | IDashboardKeyDriverAnalysisResolved | IDashboardKeyDriverAnalysisRequested | IDashboardDrillResolved | IDashboardDrillDownRequested | IDashboardDrillToAttributeUrlRequested | IDashboardDrillToCustomUrlRequested | IDashboardDrillToDashboardRequested | IDashboardDrillToInsightRequested | IDashboardDrillToLegacyDashboardRequested | IDashboardDrillRequested | IDashboardDrillableItemsChanged | IDashboardIgnoreExecutionTimestampChanged | IDashboardTabSwitched | IDashboardTabCreated | IDashboardTabDeleted | IDashboardTabRenamingStarted | IDashboardTabRenamingCanceled | IDashboardTabRenamed | IDashboardParametersSelectionReset | ICreateInsightRequested | ICreateAttributeHierarchyRequested | IDeleteAttributeHierarchyRequested;
|
|
33
33
|
/**
|
|
34
34
|
* Creates DashboardEvent predicate that test whether the provided event matches it.
|
|
35
35
|
*
|
|
@@ -129,50 +129,6 @@ export declare function dashboardTabCreated(ctx: DashboardContext, newTabId: str
|
|
|
129
129
|
* @alpha
|
|
130
130
|
*/
|
|
131
131
|
export declare const isDashboardTabCreated: (event: any) => event is IDashboardTabCreated;
|
|
132
|
-
/**
|
|
133
|
-
* Payload of the {@link IDashboardTabConvertedFromDefault} event.
|
|
134
|
-
* @alpha
|
|
135
|
-
*/
|
|
136
|
-
export interface IDashboardTabConvertedFromDefaultPayload {
|
|
137
|
-
/**
|
|
138
|
-
* Identifier of the newly created tab.
|
|
139
|
-
*/
|
|
140
|
-
readonly newTabId: string;
|
|
141
|
-
/**
|
|
142
|
-
* Index at which the new tab was inserted.
|
|
143
|
-
*/
|
|
144
|
-
readonly index: number;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* This event is emitted when a default dashboard tab is converted to a regular tab.
|
|
148
|
-
*
|
|
149
|
-
* @alpha
|
|
150
|
-
*/
|
|
151
|
-
export interface IDashboardTabConvertedFromDefault extends IDashboardEvent {
|
|
152
|
-
readonly type: "GDC.DASH/EVT.TAB.CONVERTED_FROM_DEFAULT";
|
|
153
|
-
readonly payload: IDashboardTabConvertedFromDefaultPayload;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Creates the DashboardTabConvertedFromDefault event.
|
|
157
|
-
*
|
|
158
|
-
* @param ctx - dashboard context
|
|
159
|
-
* @param newTabId - identifier of the newly created tab
|
|
160
|
-
* @param index - index at which the new tab was inserted
|
|
161
|
-
* @param correlationId - correlation id to use for this event
|
|
162
|
-
* @returns dashboard tab converted from default event
|
|
163
|
-
*
|
|
164
|
-
* @alpha
|
|
165
|
-
*/
|
|
166
|
-
export declare function dashboardTabConvertedFromDefault(ctx: DashboardContext, newTabId: string, index: number, correlationId?: string): IDashboardTabConvertedFromDefault;
|
|
167
|
-
/**
|
|
168
|
-
* Type guard that checks if an event is a DashboardTabConvertedFromDefault event.
|
|
169
|
-
*
|
|
170
|
-
* @param event - event to check
|
|
171
|
-
* @returns true if the event is a DashboardTabConvertedFromDefault event
|
|
172
|
-
*
|
|
173
|
-
* @alpha
|
|
174
|
-
*/
|
|
175
|
-
export declare const isDashboardTabConvertedFromDefault: (event: any) => event is IDashboardTabConvertedFromDefault;
|
|
176
132
|
/**
|
|
177
133
|
* Payload of the {@link IDashboardTabDeleted} event.
|
|
178
134
|
* @alpha
|
package/esm/model/events/tabs.js
CHANGED
|
@@ -89,34 +89,6 @@ export function dashboardTabCreated(ctx, newTabId, index, correlationId) {
|
|
|
89
89
|
* @alpha
|
|
90
90
|
*/
|
|
91
91
|
export const isDashboardTabCreated = (event) => event.type === "GDC.DASH/EVT.TAB.CREATED";
|
|
92
|
-
/**
|
|
93
|
-
* Creates the DashboardTabConvertedFromDefault event.
|
|
94
|
-
*
|
|
95
|
-
* @param ctx - dashboard context
|
|
96
|
-
* @param newTabId - identifier of the newly created tab
|
|
97
|
-
* @param index - index at which the new tab was inserted
|
|
98
|
-
* @param correlationId - correlation id to use for this event
|
|
99
|
-
* @returns dashboard tab converted from default event
|
|
100
|
-
*
|
|
101
|
-
* @alpha
|
|
102
|
-
*/
|
|
103
|
-
export function dashboardTabConvertedFromDefault(ctx, newTabId, index, correlationId) {
|
|
104
|
-
return {
|
|
105
|
-
type: "GDC.DASH/EVT.TAB.CONVERTED_FROM_DEFAULT",
|
|
106
|
-
ctx,
|
|
107
|
-
correlationId,
|
|
108
|
-
payload: { newTabId, index },
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Type guard that checks if an event is a DashboardTabConvertedFromDefault event.
|
|
113
|
-
*
|
|
114
|
-
* @param event - event to check
|
|
115
|
-
* @returns true if the event is a DashboardTabConvertedFromDefault event
|
|
116
|
-
*
|
|
117
|
-
* @alpha
|
|
118
|
-
*/
|
|
119
|
-
export const isDashboardTabConvertedFromDefault = (event) => event.type === "GDC.DASH/EVT.TAB.CONVERTED_FROM_DEFAULT";
|
|
120
92
|
/**
|
|
121
93
|
* Creates the DashboardTabDeleted event.
|
|
122
94
|
*
|
|
@@ -156,7 +156,6 @@ export declare const useDashboardCommand: <TCommand extends DashboardCommands, T
|
|
|
156
156
|
"GDC.DASH/EVT.SCHEDULED_EMAIL.SAVED"?: ((event: import("../events/scheduledEmail.js").IDashboardScheduledEmailSaved) => void) | undefined;
|
|
157
157
|
"GDC.DASH/EVT.SHARING.CHANGED"?: ((event: import("../events/dashboard.js").DashboardSharingChanged) => void) | undefined;
|
|
158
158
|
"GDC.DASH/EVT.SHOW_WIDGET_AS_TABLE.SET"?: ((event: import("../events/showWidgetAsTable.js").IShowWidgetAsTableSet) => void) | undefined;
|
|
159
|
-
"GDC.DASH/EVT.TAB.CONVERTED_FROM_DEFAULT"?: ((event: import("../events/tabs.js").IDashboardTabConvertedFromDefault) => void) | undefined;
|
|
160
159
|
"GDC.DASH/EVT.TAB.CREATED"?: ((event: import("../events/tabs.js").IDashboardTabCreated) => void) | undefined;
|
|
161
160
|
"GDC.DASH/EVT.TAB.DELETED"?: ((event: import("../events/tabs.js").IDashboardTabDeleted) => void) | undefined;
|
|
162
161
|
"GDC.DASH/EVT.TAB.RENAMED"?: ((event: import("../events/tabs.js").IDashboardTabRenamed) => void) | undefined;
|
|
@@ -193,8 +193,6 @@ export declare const useDashboardCommandProcessing: <TCommand extends DashboardC
|
|
|
193
193
|
type: TSuccessEventType;
|
|
194
194
|
}> | Extract<import("../events/scheduledEmail.js").IDashboardScheduledEmailSaved, {
|
|
195
195
|
type: TSuccessEventType;
|
|
196
|
-
}> | Extract<import("../events/tabs.js").IDashboardTabConvertedFromDefault, {
|
|
197
|
-
type: TSuccessEventType;
|
|
198
196
|
}> | Extract<import("../events/tabs.js").IDashboardTabCreated, {
|
|
199
197
|
type: TSuccessEventType;
|
|
200
198
|
}> | Extract<import("../events/tabs.js").IDashboardTabDeleted, {
|
|
@@ -436,8 +434,6 @@ export declare const useDashboardCommandProcessing: <TCommand extends DashboardC
|
|
|
436
434
|
type: TErrorEventType;
|
|
437
435
|
}> | Extract<import("../events/scheduledEmail.js").IDashboardScheduledEmailSaved, {
|
|
438
436
|
type: TErrorEventType;
|
|
439
|
-
}> | Extract<import("../events/tabs.js").IDashboardTabConvertedFromDefault, {
|
|
440
|
-
type: TErrorEventType;
|
|
441
437
|
}> | Extract<import("../events/tabs.js").IDashboardTabCreated, {
|
|
442
438
|
type: TErrorEventType;
|
|
443
439
|
}> | Extract<import("../events/tabs.js").IDashboardTabDeleted, {
|
|
@@ -40,6 +40,12 @@ export declare const tabsActions: import("@reduxjs/toolkit").CaseReducerActions<
|
|
|
40
40
|
};
|
|
41
41
|
type: string;
|
|
42
42
|
}>;
|
|
43
|
+
readonly resolveDefaultTab: import("./tabsReducers.js").TabsReducer<{
|
|
44
|
+
payload: {
|
|
45
|
+
newLocalIdentifier: string;
|
|
46
|
+
};
|
|
47
|
+
type: string;
|
|
48
|
+
}>;
|
|
43
49
|
readonly changeAttributeFilterConfigMode: (state: import("immer").WritableDraft<import("./tabsState.js").ITabsState>, action: {
|
|
44
50
|
payload: import("../../commands/dashboard.js").ISetDashboardAttributeFilterConfigModePayload;
|
|
45
51
|
type: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type DrillDefinition, type IDashboardLayout, type IDrillDownReference, type IDrillToLegacyDashboard, type IKpiWidget, type IWidget, type InsightDrillDefinition, type ObjRef, type ScreenSize } from "@gooddata/sdk-model";
|
|
1
|
+
import { type DrillDefinition, type IDashboardLayout, type IDrillDownReference, type IDrillToLegacyDashboard, type IInsightWidget, type IKpiWidget, type IWidget, type InsightDrillDefinition, type ObjRef, type ScreenSize } from "@gooddata/sdk-model";
|
|
2
2
|
import { type ObjRefMap } from "../../../../_staging/metadata/objRefMap.js";
|
|
3
3
|
import { type IDashboardFilter, type ILayoutCoordinates, type ILayoutItemPath } from "../../../../types.js";
|
|
4
4
|
import { type DashboardLayoutCommands } from "../../../commands/layout.js";
|
|
5
5
|
import { type ExtendedDashboardWidget, type ICustomWidget } from "../../../types/layoutTypes.js";
|
|
6
6
|
import { type IUndoableCommand } from "../../_infra/undoEnhancer.js";
|
|
7
7
|
import { type DashboardSelector } from "../../types.js";
|
|
8
|
+
import { type ITabState } from "../tabsState.js";
|
|
8
9
|
import { type LayoutStash } from "./layoutState.js";
|
|
9
10
|
/**
|
|
10
11
|
* Returns layout keyed by tab identifier.
|
|
@@ -248,6 +249,45 @@ export declare const selectKpiWidgetPlaceholderCoordinates: DashboardSelector<IL
|
|
|
248
249
|
* @alpha
|
|
249
250
|
*/
|
|
250
251
|
export declare const selectWidgetIgnoreCrossFiltering: (ref: ObjRef) => DashboardSelector<boolean>;
|
|
252
|
+
/**
|
|
253
|
+
* Per-tab widget contexts. Each entry pairs a widget with its owning tab; nested layout widgets
|
|
254
|
+
* and visualization switcher children are flattened in. Used by cross-tab widget lookups.
|
|
255
|
+
*
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
export interface IWidgetTabContext {
|
|
259
|
+
tab: ITabState;
|
|
260
|
+
widget: ExtendedDashboardWidget;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* `IWidgetTabContext` narrowed to its insight-widget shape.
|
|
264
|
+
*
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
export interface IInsightWidgetTabContext extends IWidgetTabContext {
|
|
268
|
+
widget: IInsightWidget;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Cross-tab widget contexts. Walks every tab's layout (including nested layouts and visualization
|
|
272
|
+
* switcher children) once and pairs each widget with its owning tab. Consumers needing to resolve
|
|
273
|
+
* a widget's owning tab by ref or identifier should `.find()` against this array.
|
|
274
|
+
*
|
|
275
|
+
* @internal
|
|
276
|
+
*/
|
|
277
|
+
export declare const selectAllTabsWidgetContexts: DashboardSelector<IWidgetTabContext[]>;
|
|
278
|
+
/**
|
|
279
|
+
* `selectAllTabsWidgetContexts` pre-filtered to insight-widget contexts so consumers can `.find()`
|
|
280
|
+
* against an already-narrowed array.
|
|
281
|
+
*
|
|
282
|
+
* @internal
|
|
283
|
+
*/
|
|
284
|
+
export declare const selectAllTabsInsightWidgetContexts: DashboardSelector<IInsightWidgetTabContext[]>;
|
|
285
|
+
/**
|
|
286
|
+
* Type guard for narrowing an `IWidgetTabContext` to `IInsightWidgetTabContext`.
|
|
287
|
+
*
|
|
288
|
+
* @internal
|
|
289
|
+
*/
|
|
290
|
+
export declare function isInsightWidgetTabContext(context: IWidgetTabContext): context is IInsightWidgetTabContext;
|
|
251
291
|
/**
|
|
252
292
|
* Selects the local identifier of the tab that contains the specified widget.
|
|
253
293
|
* Returns undefined if the widget is not found in any tab.
|
|
@@ -452,6 +452,44 @@ export const selectKpiWidgetPlaceholderCoordinates = createSelector(selectKpiWid
|
|
|
452
452
|
export const selectWidgetIgnoreCrossFiltering = createMemoizedSelector((ref) => createSelector(selectAnalyticalWidgetByRef(ref), (widget) => {
|
|
453
453
|
return widget?.ignoreCrossFiltering ?? false;
|
|
454
454
|
}));
|
|
455
|
+
/**
|
|
456
|
+
* Cross-tab widget contexts. Walks every tab's layout (including nested layouts and visualization
|
|
457
|
+
* switcher children) once and pairs each widget with its owning tab. Consumers needing to resolve
|
|
458
|
+
* a widget's owning tab by ref or identifier should `.find()` against this array.
|
|
459
|
+
*
|
|
460
|
+
* @internal
|
|
461
|
+
*/
|
|
462
|
+
export const selectAllTabsWidgetContexts = createSelector(selectTabs, (tabs) => {
|
|
463
|
+
if (!tabs) {
|
|
464
|
+
return [];
|
|
465
|
+
}
|
|
466
|
+
const result = [];
|
|
467
|
+
for (const tab of tabs) {
|
|
468
|
+
const layout = tab.layout?.layout;
|
|
469
|
+
if (!layout) {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
for (const widget of getLayoutWidgets(layout)) {
|
|
473
|
+
result.push({ tab, widget });
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return result;
|
|
477
|
+
});
|
|
478
|
+
/**
|
|
479
|
+
* `selectAllTabsWidgetContexts` pre-filtered to insight-widget contexts so consumers can `.find()`
|
|
480
|
+
* against an already-narrowed array.
|
|
481
|
+
*
|
|
482
|
+
* @internal
|
|
483
|
+
*/
|
|
484
|
+
export const selectAllTabsInsightWidgetContexts = createSelector(selectAllTabsWidgetContexts, (contexts) => contexts.filter(isInsightWidgetTabContext));
|
|
485
|
+
/**
|
|
486
|
+
* Type guard for narrowing an `IWidgetTabContext` to `IInsightWidgetTabContext`.
|
|
487
|
+
*
|
|
488
|
+
* @internal
|
|
489
|
+
*/
|
|
490
|
+
export function isInsightWidgetTabContext(context) {
|
|
491
|
+
return isInsightWidget(context.widget);
|
|
492
|
+
}
|
|
455
493
|
/**
|
|
456
494
|
* Selects the local identifier of the tab that contains the specified widget.
|
|
457
495
|
* Returns undefined if the widget is not found in any tab.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type IDashboardParameterValueOverride } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type IDashboardParameter, type IDashboardTab, type IInsight, type IInsightDefinition, type IParameterMetadataObject, type IdentifierRef } from "@gooddata/sdk-model";
|
|
3
|
+
import { type ObjRefMap } from "../../../../_staging/metadata/objRefMap.js";
|
|
4
|
+
import { type IInsightWidgetTabContext } from "../layout/layoutSelectors.js";
|
|
5
|
+
import { type ITabState } from "../tabsState.js";
|
|
6
|
+
import { type IDashboardParameterEntry } from "./parametersState.js";
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const EMPTY_EXPORT_PARAMETERS: Record<string, IDashboardParameterValueOverride[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Walks the insight's metric buckets and returns the parameter refs they reference,
|
|
13
|
+
* deduped by ref string. The order matches the first occurrence in the measure traversal.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function collectReferencedParameterRefs(insight: IInsightDefinition, measureParameters: Record<string, IdentifierRef[]>): IdentifierRef[];
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a single parameter entry to the export wire shape. Returns `undefined` for entries with
|
|
20
|
+
* no `runtimeOverride` — the dashboard's persisted parameter state and the workspace default are
|
|
21
|
+
* applied by the backend on its own, and insight-level `insight.parameters` are applied per-insight
|
|
22
|
+
* by the backend; sending a row in those cases would override the backend's resolution with a stale
|
|
23
|
+
* FE snapshot (matches the live-render path in `selectEffectiveParameterValuesForWidget`).
|
|
24
|
+
*
|
|
25
|
+
* Title precedence (when a row is emitted): `parameter.label` → workspace title → `ref.identifier`.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatDashboardParameter(entry: IDashboardParameterEntry, workspaceParameter: IParameterMetadataObject | undefined): IDashboardParameterValueOverride | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves the persisted shape of a parameter entry against its workspace catalog parameter.
|
|
32
|
+
* Drops `value` when it equals the workspace default; drops `label` when it equals the workspace title.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function smartPersistResolvedEntry(entry: IDashboardParameterEntry, workspaceParameter: IParameterMetadataObject): IDashboardParameter;
|
|
37
|
+
/**
|
|
38
|
+
* Builds the persisted-parameter lookup keyed by tab and then by ref string. Honors V1 → per-tab
|
|
39
|
+
* migration: when no tab in the persisted dashboard carries `parameters`, the persisted root
|
|
40
|
+
* `parameters` is used as fallback for every tab.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildPersistedByTabAndRef(persistedTabs: ReadonlyArray<IDashboardTab>, rootPersistedParameters: IDashboardParameter[]): Map<string, Map<string, IDashboardParameter>>;
|
|
45
|
+
/**
|
|
46
|
+
* Returns `undefined` when reset would be a no-op: missing/non-number workspace parameter, or
|
|
47
|
+
* in edit mode when `parameter.value` is unset / already equals the workspace default.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
export declare function computeParameterResetValue(entry: IDashboardParameterEntry, workspaceParameter: IParameterMetadataObject | undefined, isInEditMode: boolean): number | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Only `mode: "active"` entries with a defined `runtimeOverride` are considered resettable;
|
|
54
|
+
* HIDDEN and READONLY entries are skipped, and entries with `runtimeOverride === undefined`
|
|
55
|
+
* (chip hidden, execution falls back to `insight.parameters`) are preserved as-is — symmetric
|
|
56
|
+
* with per-chip behavior in `DashboardParameterFilter`.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export declare function computeParameterResetTargets(entries: IDashboardParameterEntry[], workspaceParameters: IParameterMetadataObject[], isInEditMode: boolean): {
|
|
61
|
+
ref: IDashboardParameterEntry["parameter"]["ref"];
|
|
62
|
+
value: number | undefined;
|
|
63
|
+
}[];
|
|
64
|
+
/**
|
|
65
|
+
* Folds per-tab ref selections into the wire shape, dropping entries without a
|
|
66
|
+
* `runtimeOverride`. Each selection pairs a tab with an optional ref restriction:
|
|
67
|
+
* `allowedRefs === undefined` selects all refs (whole-dashboard scope); a defined set restricts
|
|
68
|
+
* entries to those refs (widget scope). Tabs that yield no rows are omitted from the result.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
export declare function collectExportOverrides(tabRefSelections: ReadonlyArray<{
|
|
73
|
+
tab: ITabState;
|
|
74
|
+
allowedRefs?: Set<string>;
|
|
75
|
+
}>, workspaceByRef: Map<string, IParameterMetadataObject>): Record<string, IDashboardParameterValueOverride[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Builds per-tab ref selections for a widget-scope export: each widget's owning tab is restricted
|
|
78
|
+
* to refs referenced by the widget's insight metrics. Multiple widgets on the same tab union their
|
|
79
|
+
* refs.
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
export declare function buildWidgetScopeTabRefSelections(widgetContexts: ReadonlyArray<IInsightWidgetTabContext>, widgetIds: ReadonlyArray<string>, insights: ObjRefMap<IInsight>, measureParameters: Record<string, IdentifierRef[]>): {
|
|
84
|
+
tab: ITabState;
|
|
85
|
+
allowedRefs: Set<string>;
|
|
86
|
+
}[];
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { DashboardParameterModeValues, insightMeasures, isMeasureDefinition, isNumberParameterDefinition, objRefToString, } from "@gooddata/sdk-model";
|
|
3
|
+
import { parametersInitialState, pickTabParametersSource, } from "./parametersState.js";
|
|
4
|
+
const EMPTY_PARAMETERS = [];
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export const EMPTY_EXPORT_PARAMETERS = {};
|
|
9
|
+
/**
|
|
10
|
+
* Walks the insight's metric buckets and returns the parameter refs they reference,
|
|
11
|
+
* deduped by ref string. The order matches the first occurrence in the measure traversal.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export function collectReferencedParameterRefs(insight, measureParameters) {
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
const result = [];
|
|
18
|
+
for (const measure of insightMeasures(insight)) {
|
|
19
|
+
const def = measure.measure.definition;
|
|
20
|
+
if (!isMeasureDefinition(def)) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const refs = measureParameters[objRefToString(def.measureDefinition.item)] ?? [];
|
|
24
|
+
for (const ref of refs) {
|
|
25
|
+
const key = objRefToString(ref);
|
|
26
|
+
if (seen.has(key)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
seen.add(key);
|
|
30
|
+
result.push(ref);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolves a single parameter entry to the export wire shape. Returns `undefined` for entries with
|
|
37
|
+
* no `runtimeOverride` — the dashboard's persisted parameter state and the workspace default are
|
|
38
|
+
* applied by the backend on its own, and insight-level `insight.parameters` are applied per-insight
|
|
39
|
+
* by the backend; sending a row in those cases would override the backend's resolution with a stale
|
|
40
|
+
* FE snapshot (matches the live-render path in `selectEffectiveParameterValuesForWidget`).
|
|
41
|
+
*
|
|
42
|
+
* Title precedence (when a row is emitted): `parameter.label` → workspace title → `ref.identifier`.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export function formatDashboardParameter(entry, workspaceParameter) {
|
|
47
|
+
if (entry.runtimeOverride === undefined) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const ref = entry.parameter.ref;
|
|
51
|
+
return {
|
|
52
|
+
id: ref.identifier,
|
|
53
|
+
value: String(entry.runtimeOverride),
|
|
54
|
+
title: entry.parameter.label || workspaceParameter?.title || ref.identifier,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolves the persisted shape of a parameter entry against its workspace catalog parameter.
|
|
59
|
+
* Drops `value` when it equals the workspace default; drops `label` when it equals the workspace title.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export function smartPersistResolvedEntry(entry, workspaceParameter) {
|
|
64
|
+
const workspaceDefault = isNumberParameterDefinition(workspaceParameter.definition)
|
|
65
|
+
? workspaceParameter.definition.defaultValue
|
|
66
|
+
: undefined;
|
|
67
|
+
const result = {
|
|
68
|
+
ref: entry.parameter.ref,
|
|
69
|
+
parameterType: entry.parameter.parameterType,
|
|
70
|
+
mode: entry.parameter.mode,
|
|
71
|
+
...labelOverride(entry, workspaceParameter),
|
|
72
|
+
};
|
|
73
|
+
if (entry.runtimeOverride === undefined || entry.runtimeOverride === workspaceDefault) {
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
return { ...result, value: entry.runtimeOverride };
|
|
77
|
+
}
|
|
78
|
+
function labelOverride(entry, workspaceParameter) {
|
|
79
|
+
if (entry.parameter.label && entry.parameter.label !== workspaceParameter.title) {
|
|
80
|
+
return { label: entry.parameter.label };
|
|
81
|
+
}
|
|
82
|
+
return {};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Builds the persisted-parameter lookup keyed by tab and then by ref string. Honors V1 → per-tab
|
|
86
|
+
* migration: when no tab in the persisted dashboard carries `parameters`, the persisted root
|
|
87
|
+
* `parameters` is used as fallback for every tab.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export function buildPersistedByTabAndRef(persistedTabs, rootPersistedParameters) {
|
|
92
|
+
const result = new Map();
|
|
93
|
+
for (const tab of persistedTabs) {
|
|
94
|
+
const sourceParameters = pickTabParametersSource(tab, persistedTabs, rootPersistedParameters) ?? EMPTY_PARAMETERS;
|
|
95
|
+
result.set(tab.localIdentifier, new Map(sourceParameters.map((parameter) => [objRefToString(parameter.ref), parameter])));
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns `undefined` when reset would be a no-op: missing/non-number workspace parameter, or
|
|
101
|
+
* in edit mode when `parameter.value` is unset / already equals the workspace default.
|
|
102
|
+
*
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
export function computeParameterResetValue(entry, workspaceParameter, isInEditMode) {
|
|
106
|
+
if (!workspaceParameter || !isNumberParameterDefinition(workspaceParameter.definition)) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
const workspaceDefault = workspaceParameter.definition.defaultValue;
|
|
110
|
+
const dashboardOverride = entry.parameter.value;
|
|
111
|
+
if (isInEditMode) {
|
|
112
|
+
if (dashboardOverride === undefined || dashboardOverride === workspaceDefault) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
return workspaceDefault;
|
|
116
|
+
}
|
|
117
|
+
return dashboardOverride ?? workspaceDefault;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Only `mode: "active"` entries with a defined `runtimeOverride` are considered resettable;
|
|
121
|
+
* HIDDEN and READONLY entries are skipped, and entries with `runtimeOverride === undefined`
|
|
122
|
+
* (chip hidden, execution falls back to `insight.parameters`) are preserved as-is — symmetric
|
|
123
|
+
* with per-chip behavior in `DashboardParameterFilter`.
|
|
124
|
+
*
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
export function computeParameterResetTargets(entries, workspaceParameters, isInEditMode) {
|
|
128
|
+
const workspaceByRef = new Map(workspaceParameters.map((wp) => [objRefToString(wp.ref), wp]));
|
|
129
|
+
const result = [];
|
|
130
|
+
for (const entry of entries) {
|
|
131
|
+
if (entry.parameter.mode !== DashboardParameterModeValues.ACTIVE) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (entry.runtimeOverride === undefined) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const workspaceParameter = workspaceByRef.get(objRefToString(entry.parameter.ref));
|
|
138
|
+
const resetValue = computeParameterResetValue(entry, workspaceParameter, isInEditMode);
|
|
139
|
+
if (resetValue !== undefined && resetValue !== entry.runtimeOverride) {
|
|
140
|
+
result.push({ ref: entry.parameter.ref, value: resetValue });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Folds per-tab ref selections into the wire shape, dropping entries without a
|
|
147
|
+
* `runtimeOverride`. Each selection pairs a tab with an optional ref restriction:
|
|
148
|
+
* `allowedRefs === undefined` selects all refs (whole-dashboard scope); a defined set restricts
|
|
149
|
+
* entries to those refs (widget scope). Tabs that yield no rows are omitted from the result.
|
|
150
|
+
*
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
export function collectExportOverrides(tabRefSelections, workspaceByRef) {
|
|
154
|
+
const result = {};
|
|
155
|
+
for (const { tab, allowedRefs } of tabRefSelections) {
|
|
156
|
+
const entries = tab.parameters?.parameters ?? parametersInitialState.parameters;
|
|
157
|
+
const scoped = allowedRefs
|
|
158
|
+
? entries.filter((entry) => allowedRefs.has(objRefToString(entry.parameter.ref)))
|
|
159
|
+
: entries;
|
|
160
|
+
const rows = formatEntries(scoped, workspaceByRef);
|
|
161
|
+
if (rows.length > 0) {
|
|
162
|
+
result[tab.localIdentifier] = rows;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return Object.keys(result).length === 0 ? EMPTY_EXPORT_PARAMETERS : result;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Builds per-tab ref selections for a widget-scope export: each widget's owning tab is restricted
|
|
169
|
+
* to refs referenced by the widget's insight metrics. Multiple widgets on the same tab union their
|
|
170
|
+
* refs.
|
|
171
|
+
*
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
export function buildWidgetScopeTabRefSelections(widgetContexts, widgetIds, insights, measureParameters) {
|
|
175
|
+
const byTab = new Map();
|
|
176
|
+
for (const widgetId of widgetIds) {
|
|
177
|
+
const context = widgetContexts.find((ctx) => ctx.widget.identifier === widgetId);
|
|
178
|
+
if (!context) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const insight = insights.get(context.widget.insight);
|
|
182
|
+
if (!insight) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const referencedRefs = collectReferencedParameterRefs(insight, measureParameters);
|
|
186
|
+
if (referencedRefs.length === 0) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const tabId = context.tab.localIdentifier;
|
|
190
|
+
const existing = byTab.get(tabId) ?? { tab: context.tab, allowedRefs: new Set() };
|
|
191
|
+
for (const ref of referencedRefs) {
|
|
192
|
+
existing.allowedRefs.add(objRefToString(ref));
|
|
193
|
+
}
|
|
194
|
+
byTab.set(tabId, existing);
|
|
195
|
+
}
|
|
196
|
+
return [...byTab.values()];
|
|
197
|
+
}
|
|
198
|
+
function formatEntries(entries, workspaceByRef) {
|
|
199
|
+
const rows = [];
|
|
200
|
+
for (const entry of entries) {
|
|
201
|
+
const workspaceParameter = workspaceByRef.get(objRefToString(entry.parameter.ref));
|
|
202
|
+
const row = formatDashboardParameter(entry, workspaceParameter);
|
|
203
|
+
if (row !== undefined) {
|
|
204
|
+
rows.push(row);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return rows;
|
|
208
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IDashboardParameterValueOverride } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type IDashboardParameter, type IInsightParameterValue, type ObjRef } from "@gooddata/sdk-model";
|
|
2
3
|
import { type DashboardSelector } from "../../types.js";
|
|
3
4
|
import { type IDashboardParameterEntry } from "./parametersState.js";
|
|
4
5
|
/**
|
|
@@ -108,21 +109,25 @@ export declare const selectHasAnyResettableParameterOnActiveTab: DashboardSelect
|
|
|
108
109
|
*/
|
|
109
110
|
export declare const selectEffectiveParameterValuesForWidget: (ref: ObjRef | undefined) => DashboardSelector<IInsightParameterValue[]>;
|
|
110
111
|
/**
|
|
111
|
-
* Returns
|
|
112
|
-
*
|
|
112
|
+
* Returns the per-tab parameter overrides to send on dashboard tabular export, keyed by
|
|
113
|
+
* tab `localIdentifier`. The shape matches the backend's `dashboardTabsParametersOverrides`
|
|
114
|
+
* field directly.
|
|
113
115
|
*
|
|
114
|
-
* @
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* Scope rules:
|
|
118
|
+
* - When `widgetIds` is empty/undefined (whole-dashboard export), every tab in scope contributes
|
|
119
|
+
* parameter entries with a `runtimeOverride`.
|
|
120
|
+
* - When `widgetIds` is non-empty, each widget's owning tab contributes only entries with a
|
|
121
|
+
* `runtimeOverride` whose ref is referenced by the widget's insight metrics via the dashboard-wide
|
|
122
|
+
* metric → parameter dependency map. Multi-widget across distinct owning tabs yields one
|
|
123
|
+
* map entry per owning tab; entries for the same tab are unioned and deduplicated by ref.
|
|
124
|
+
*
|
|
125
|
+
* Returns `{}` (signalling "omit the field on the wire") when:
|
|
126
|
+
* - `enableParameters` is off,
|
|
127
|
+
* - the workspace catalog parameters are not loaded,
|
|
128
|
+
* - (widget scope only) the `measureParameters` dependency map is not loaded,
|
|
129
|
+
* - or no in-scope parameter has a `runtimeOverride`.
|
|
122
130
|
*
|
|
123
|
-
* @
|
|
131
|
+
* @alpha
|
|
124
132
|
*/
|
|
125
|
-
export declare
|
|
126
|
-
ref: ObjRef;
|
|
127
|
-
value: number | undefined;
|
|
128
|
-
}[];
|
|
133
|
+
export declare const selectExportEffectiveParameters: (widgetIds: string[] | undefined) => DashboardSelector<Record<string, IDashboardParameterValueOverride[]>>;
|