@gooddata/sdk-ui-dashboard 11.48.0-alpha.1 → 11.48.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/_staging/automation/index.d.ts +7 -9
- package/esm/_staging/automation/index.d.ts.map +1 -1
- package/esm/_staging/automation/index.js +22 -12
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts +10 -3
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.js +5 -4
- package/esm/model/commandHandlers/scheduledEmail/createScheduledEmailHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/createScheduledEmailHandler.js +11 -2
- package/esm/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.d.ts +9 -1
- package/esm/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.js +4 -4
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.js +9 -2
- package/esm/model/commandHandlers/scheduledEmail/saveScheduledEmailHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/saveScheduledEmailHandler.js +11 -2
- package/esm/model/commandHandlers/widgets/exportInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/exportInsightWidgetHandler.js +47 -13
- package/esm/model/react/useExportTemplates.d.ts +7 -2
- package/esm/model/react/useExportTemplates.d.ts.map +1 -1
- package/esm/model/react/useExportTemplates.js +50 -6
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.js +10 -11
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +0 -20
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersSelectors.js +8 -34
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.js +2 -2
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.test.js +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js +2 -2
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js +1 -1
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts +20 -17
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/automationParameters.js +57 -40
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts +3 -3
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.js +3 -3
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.js +9 -5
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.js +13 -5
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts +3 -3
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.js +18 -10
- package/esm/presentation/automations/shared/automationFilters/useParameterAnnouncements.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/useParameterAnnouncements.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +1 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +1 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +1 -0
- package/esm/presentation/topBar/buttonBar/button/settingButton/DefaultSettingButton.d.ts +1 -1
- package/esm/presentation/topBar/buttonBar/button/settingButton/DefaultSettingButton.d.ts.map +1 -1
- package/esm/presentation/topBar/buttonBar/button/settingButton/DefaultSettingButton.js +6 -7
- package/esm/sdk-ui-dashboard.d.ts +1 -1
- package/package.json +21 -21
- package/styles/css/main.css +3 -13
- package/styles/css/main.css.map +1 -1
- package/styles/css/topBar.css +3 -13
- package/styles/css/topBar.css.map +1 -1
- package/styles/scss/topBar.scss +3 -15
package/esm/__version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.48.0-alpha.
|
|
1
|
+
export declare const LIB_VERSION = "11.48.0-alpha.2";
|
|
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.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.48.0-alpha.
|
|
3
|
+
export const LIB_VERSION = "11.48.0-alpha.2";
|
|
4
4
|
export const LIB_DESCRIPTION = "GoodData SDK - Dashboard Component";
|
|
5
5
|
export const LIB_NAME = "@gooddata/sdk-ui-dashboard";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationRecipient, type IDashboardExportParameter, type IExportDefinitionMetadataObject, type IExportDefinitionMetadataObjectDefinition, type IFilter, type IInsightParameterValue, type IUser, type IWorkspaceUser
|
|
1
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationRecipient, type IDashboardExportParameter, type IExportDefinitionMetadataObject, type IExportDefinitionMetadataObjectDefinition, type IFilter, type IInsightParameterValue, type IUser, type IWorkspaceUser } from "@gooddata/sdk-model";
|
|
2
2
|
export declare const isDashboardAutomation: (automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | undefined) => boolean | undefined;
|
|
3
3
|
export declare const isVisualisationAutomation: (automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | undefined) => boolean | undefined;
|
|
4
4
|
export declare const isCsvVisualizationAutomation: (automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | undefined) => boolean | undefined;
|
|
@@ -26,15 +26,13 @@ export declare const getAutomationExportParametersByTab: (automation: IAutomatio
|
|
|
26
26
|
export declare function setExportParametersByTab(automation: IAutomationMetadataObjectDefinition, parametersByTab: Record<string, IDashboardExportParameter[]> | undefined): IAutomationMetadataObjectDefinition;
|
|
27
27
|
/**
|
|
28
28
|
* Converts stored export parameter overrides ({@link IDashboardExportParameter}, value carried as a
|
|
29
|
-
* string) to {@link IInsightParameterValue} runtime values.
|
|
29
|
+
* string) to {@link IInsightParameterValue} runtime values. Each row carries its own type tag:
|
|
30
|
+
* NUMBER values are parsed (non-finite ones dropped), STRING values stay strings. STRING rows are
|
|
31
|
+
* dropped while `enableStringParameters` is off (a row persisted before the flag was turned off).
|
|
32
|
+
* Untagged rows predate the tag and are decoded as NUMBER; rows tagged with a type this version
|
|
33
|
+
* does not know (persisted by a newer one) are dropped.
|
|
30
34
|
*/
|
|
31
|
-
export declare function exportParametersToValues(stored: IDashboardExportParameter[]): IInsightParameterValue[];
|
|
32
|
-
/**
|
|
33
|
-
* The parameter values the automation dialogs can carry: NUMBER only, until the interactions
|
|
34
|
-
* slice (F1-2636…F1-2641) widens the automation model. The single home of that policy — delete
|
|
35
|
-
* together with the automation seeding gates when the slice lands.
|
|
36
|
-
*/
|
|
37
|
-
export declare function isAutomationSupportedParameterValue(value: ParameterValue): value is number;
|
|
35
|
+
export declare function exportParametersToValues(stored: IDashboardExportParameter[], isStringParametersEnabled: boolean): IInsightParameterValue[];
|
|
38
36
|
export declare const getAutomationVisualizationFilters: (automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | undefined) => {
|
|
39
37
|
executionFilters: IFilter[] | undefined;
|
|
40
38
|
filterContextItems: FilterContextItem[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_staging/automation/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAE9B,KAAK,+BAA+B,EACpC,KAAK,yCAAyC,EAE9C,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,KAAK,EACV,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_staging/automation/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAE9B,KAAK,+BAA+B,EACpC,KAAK,yCAAyC,EAE9C,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,KAAK,EACV,KAAK,cAAc,EAStB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,qBAAqB,kHAUjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,kHAUrC,CAAC;AAEF,eAAO,MAAM,4BAA4B,kHAQxC,CAAC;AAEF,eAAO,MAAM,kCAAkC,wHAW9C,CAAC;AAEF,eAAO,MAAM,6BAA6B,kHAQzC,CAAC;AAEF,eAAO,MAAM,mCAAmC,wHAW/C,CAAC;AAEF,eAAO,MAAM,6BAA6B,8HAYzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kCAAkC,8IAY9C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,sJAW9C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,UAAU,EAAE,mCAAmC,EAC/C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,GACzE,mCAAmC,CA+BrC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,yBAAyB,EAAE,EACnC,yBAAyB,EAAE,OAAO,GACnC,sBAAsB,EAAE,CAQ1B;AAqBD,eAAO,MAAM,iCAAiC;;;CAuB7C,CAAC;AAEF,eAAO,MAAM,yBAAyB,oHAQrC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,mIAIxC,CAAC;AAOF,eAAO,MAAM,mBAAmB,8HAqB/B,CAAC;AAEF,eAAO,MAAM,uCAAuC,gEAOnD,CAAC;AAEF,eAAO,MAAM,iCAAiC,0DAe7C,CAAC;AAEF,eAAO,MAAM,gCAAgC,uCAO5C,CAAC;AAEF,eAAO,MAAM,6CAA6C,qDASzD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
2
|
import { isEqual, omit, pick } from "lodash-es";
|
|
3
|
-
import { idRef, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isFilter, isFilterContextItem, } from "@gooddata/sdk-model";
|
|
3
|
+
import { assertNever, idRef, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isFilter, isFilterContextItem, } from "@gooddata/sdk-model";
|
|
4
4
|
export const isDashboardAutomation = (automation) => {
|
|
5
5
|
if (!automation) {
|
|
6
6
|
return false;
|
|
@@ -115,24 +115,34 @@ export function setExportParametersByTab(automation, parametersByTab) {
|
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Converts stored export parameter overrides ({@link IDashboardExportParameter}, value carried as a
|
|
118
|
-
* string) to {@link IInsightParameterValue} runtime values.
|
|
118
|
+
* string) to {@link IInsightParameterValue} runtime values. Each row carries its own type tag:
|
|
119
|
+
* NUMBER values are parsed (non-finite ones dropped), STRING values stay strings. STRING rows are
|
|
120
|
+
* dropped while `enableStringParameters` is off (a row persisted before the flag was turned off).
|
|
121
|
+
* Untagged rows predate the tag and are decoded as NUMBER; rows tagged with a type this version
|
|
122
|
+
* does not know (persisted by a newer one) are dropped.
|
|
119
123
|
*/
|
|
120
|
-
export function exportParametersToValues(stored) {
|
|
124
|
+
export function exportParametersToValues(stored, isStringParametersEnabled) {
|
|
121
125
|
return stored.reduce((acc, row) => {
|
|
122
|
-
const value =
|
|
123
|
-
if (
|
|
126
|
+
const value = decodeExportParameterValue(row.parameterType, row.value, isStringParametersEnabled);
|
|
127
|
+
if (value !== undefined) {
|
|
124
128
|
acc.push({ ref: idRef(row.id, "parameter"), value });
|
|
125
129
|
}
|
|
126
130
|
return acc;
|
|
127
131
|
}, []);
|
|
128
132
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
function decodeExportParameterValue(parameterType, wireValue, isStringParametersEnabled) {
|
|
134
|
+
const tag = parameterType ?? "NUMBER";
|
|
135
|
+
switch (tag) {
|
|
136
|
+
case "NUMBER": {
|
|
137
|
+
const parsed = Number(wireValue);
|
|
138
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
139
|
+
}
|
|
140
|
+
case "STRING":
|
|
141
|
+
return isStringParametersEnabled ? wireValue : undefined;
|
|
142
|
+
default:
|
|
143
|
+
assertNever(tag);
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
136
146
|
}
|
|
137
147
|
export const getAutomationVisualizationFilters = (automation) => {
|
|
138
148
|
if (!automation) {
|
|
@@ -3,10 +3,17 @@ import { type ChangeParameterValuesParams } from "../../commands/parameters.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Pure decision logic for restoring an automation's stored parameter overrides on dashboard load.
|
|
5
5
|
* Returns the {@link changeParameterValues} command params to dispatch: alert params target the
|
|
6
|
-
* active tab, export params target their own tab.
|
|
7
|
-
* the saga reads the raw pieces off the
|
|
6
|
+
* active tab, export params target their own tab. Each export wire row carries its own type tag.
|
|
7
|
+
* Mirrors the filter-side `extractRelevantFilters` — the saga reads the raw pieces off the
|
|
8
|
+
* automation and dispatches each result.
|
|
8
9
|
*
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
export declare function extractAutomationParameterChanges(enableParameters
|
|
12
|
+
export declare function extractAutomationParameterChanges({ enableParameters, enableStringParameters, alertParameters, exportParametersByTab, correlationId }: {
|
|
13
|
+
enableParameters: boolean;
|
|
14
|
+
enableStringParameters: boolean;
|
|
15
|
+
alertParameters: IInsightParameterValue[] | undefined;
|
|
16
|
+
exportParametersByTab: Record<string, IDashboardExportParameter[]> | undefined;
|
|
17
|
+
correlationId: string;
|
|
18
|
+
}): ChangeParameterValuesParams[];
|
|
12
19
|
//# sourceMappingURL=automationParametersRestore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automationParametersRestore.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/automationParametersRestore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlG,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAEhF
|
|
1
|
+
{"version":3,"file":"automationParametersRestore.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/automationParametersRestore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlG,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAEhF;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,EAC9C,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,aAAa,EAChB,EAAE;IACC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sBAAsB,EAAE,OAAO,CAAC;IAChC,eAAe,EAAE,sBAAsB,EAAE,GAAG,SAAS,CAAC;IACtD,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,CAAC;IAC/E,aAAa,EAAE,MAAM,CAAC;CACzB,GAAG,2BAA2B,EAAE,CAehC"}
|
|
@@ -3,12 +3,13 @@ import { exportParametersToValues } from "../../../_staging/automation/index.js"
|
|
|
3
3
|
/**
|
|
4
4
|
* Pure decision logic for restoring an automation's stored parameter overrides on dashboard load.
|
|
5
5
|
* Returns the {@link changeParameterValues} command params to dispatch: alert params target the
|
|
6
|
-
* active tab, export params target their own tab.
|
|
7
|
-
* the saga reads the raw pieces off the
|
|
6
|
+
* active tab, export params target their own tab. Each export wire row carries its own type tag.
|
|
7
|
+
* Mirrors the filter-side `extractRelevantFilters` — the saga reads the raw pieces off the
|
|
8
|
+
* automation and dispatches each result.
|
|
8
9
|
*
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
export function extractAutomationParameterChanges(enableParameters, alertParameters, exportParametersByTab, correlationId) {
|
|
12
|
+
export function extractAutomationParameterChanges({ enableParameters, enableStringParameters, alertParameters, exportParametersByTab, correlationId, }) {
|
|
12
13
|
if (!enableParameters) {
|
|
13
14
|
return [];
|
|
14
15
|
}
|
|
@@ -17,7 +18,7 @@ export function extractAutomationParameterChanges(enableParameters, alertParamet
|
|
|
17
18
|
changes.push({ parameters: alertParameters, correlationId });
|
|
18
19
|
}
|
|
19
20
|
for (const [tabLocalIdentifier, exportParameters] of Object.entries(exportParametersByTab ?? {})) {
|
|
20
|
-
const parameters = exportParametersToValues(exportParameters);
|
|
21
|
+
const parameters = exportParametersToValues(exportParameters, enableStringParameters);
|
|
21
22
|
if (parameters.length) {
|
|
22
23
|
changes.push({ parameters, tabLocalIdentifier, correlationId });
|
|
23
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createScheduledEmailHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/createScheduledEmailHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAwB/C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,KAAK,+BAA+B,EAAyB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"createScheduledEmailHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/createScheduledEmailHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAwB/C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,KAAK,+BAA+B,EAAyB,MAAM,gCAAgC,CAAC;AAkB7G,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAoBnE,wBAAiB,2BAA2B,CACxC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,qBAAqB,GAC3B,YAAY,CAAC,+BAA+B,CAAC,CAiG/C"}
|
|
@@ -5,7 +5,7 @@ import { fillMissingTitles, resolveDefaultDisplayFormRefForDisplayForm, resolveM
|
|
|
5
5
|
import { scheduledEmailCreated } from "../../events/scheduledEmail.js";
|
|
6
6
|
import { queryWithInsight } from "../../queryServices/queryWidgetFilters.js";
|
|
7
7
|
import { selectCatalogAttributes } from "../../store/catalog/catalogSelectors.js";
|
|
8
|
-
import { selectLocale, selectSettings } from "../../store/config/configSelectors.js";
|
|
8
|
+
import { selectEnableStringParameters, selectLocale, selectSettings, } from "../../store/config/configSelectors.js";
|
|
9
9
|
import { selectExecutionResultByRef } from "../../store/executionResults/executionResultsSelectors.js";
|
|
10
10
|
import { selectAutomationCommonDateFilterId } from "../../store/filtering/dashboardFilterSelectors.js";
|
|
11
11
|
import { selectInsightByRef, selectInsightByWidgetRef, selectRawExportOverridesForInsight, } from "../../store/insights/insightsSelectors.js";
|
|
@@ -31,6 +31,7 @@ export function* createScheduledEmailHandler(ctx, cmd) {
|
|
|
31
31
|
const commonDateFilterId = yield select(selectAutomationCommonDateFilterId);
|
|
32
32
|
const insight = yield select(selectInsightByWidgetRef(ref));
|
|
33
33
|
const insightParameterValues = yield select(selectReferencedInsightParameterValuesForWidget(ref));
|
|
34
|
+
const enableStringParameters = yield select(selectEnableStringParameters);
|
|
34
35
|
const locale = yield select(selectLocale);
|
|
35
36
|
const messages = yield call(resolveMessages, locale);
|
|
36
37
|
const lookupInsight = insight ? yield select(selectInsightByRef(insightRef(insight))) : undefined;
|
|
@@ -52,7 +53,15 @@ export function* createScheduledEmailHandler(ctx, cmd) {
|
|
|
52
53
|
throw new Error("CSV raw widget attachment requires an available widget.");
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
const preparedExecutionDefinitionWithFilters = prepareCsvRawExecutionDefinition(
|
|
56
|
+
const preparedExecutionDefinitionWithFilters = prepareCsvRawExecutionDefinition({
|
|
57
|
+
executionDefinition: preparedExecutionDefinition,
|
|
58
|
+
csvRawRequest,
|
|
59
|
+
insight,
|
|
60
|
+
insightParameterValues,
|
|
61
|
+
enableStringParameters,
|
|
62
|
+
widget,
|
|
63
|
+
commonDateFilterId,
|
|
64
|
+
});
|
|
56
65
|
const settings = yield select(selectSettings);
|
|
57
66
|
const catalogAttributes = yield select(selectCatalogAttributes);
|
|
58
67
|
const preloadedAttributesWithReferences = yield select(selectPreloadedAttributesWithReferences);
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { type IExecutionDefinition, type IExportDefinitionVisualizationObjectRequestPayload, type IInsight, type IInsightParameterValue } from "@gooddata/sdk-model";
|
|
2
2
|
import { type ExtendedDashboardWidget } from "../../types/layoutTypes.js";
|
|
3
|
-
export declare function prepareCsvRawExecutionDefinition(executionDefinition
|
|
3
|
+
export declare function prepareCsvRawExecutionDefinition({ executionDefinition, csvRawRequest, insight, insightParameterValues, enableStringParameters, widget, commonDateFilterId }: {
|
|
4
|
+
executionDefinition: IExecutionDefinition | undefined;
|
|
5
|
+
csvRawRequest: IExportDefinitionVisualizationObjectRequestPayload;
|
|
6
|
+
insight: IInsight | undefined;
|
|
7
|
+
insightParameterValues: IInsightParameterValue[];
|
|
8
|
+
enableStringParameters: boolean;
|
|
9
|
+
widget: ExtendedDashboardWidget | undefined;
|
|
10
|
+
commonDateFilterId: string | undefined;
|
|
11
|
+
}): IExecutionDefinition | undefined;
|
|
4
12
|
//# sourceMappingURL=csvRawExecutionDefinition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csvRawExecutionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,kDAAkD,EAEvD,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAM9B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,wBAAgB,gCAAgC,
|
|
1
|
+
{"version":3,"file":"csvRawExecutionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,kDAAkD,EAEvD,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAM9B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,wBAAgB,gCAAgC,CAAC,EAC7C,mBAAmB,EACnB,aAAa,EACb,OAAO,EACP,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,EACN,kBAAkB,EACrB,EAAE;IACC,mBAAmB,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACtD,aAAa,EAAE,kDAAkD,CAAC;IAClE,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;IACjD,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC5C,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C,GAAG,oBAAoB,GAAG,SAAS,CAanC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { isFilter, isFilterContextItem, isWidget, mergeFilters, objRefToString, } from "@gooddata/sdk-model";
|
|
3
3
|
import { exportParametersToValues } from "../../../_staging/automation/index.js";
|
|
4
4
|
import { filterContextItemsToDashboardFiltersByWidget } from "../../../converters/filterConverters.js";
|
|
5
|
-
export function prepareCsvRawExecutionDefinition(executionDefinition, csvRawRequest, insight, insightParameterValues, widget, commonDateFilterId) {
|
|
5
|
+
export function prepareCsvRawExecutionDefinition({ executionDefinition, csvRawRequest, insight, insightParameterValues, enableStringParameters, widget, commonDateFilterId, }) {
|
|
6
6
|
if (!executionDefinition) {
|
|
7
7
|
return executionDefinition;
|
|
8
8
|
}
|
|
9
9
|
const withFilters = applyExportFilters(executionDefinition, csvRawRequest, insight, widget, commonDateFilterId);
|
|
10
|
-
return applyExportParameters(withFilters, csvRawRequest, insightParameterValues);
|
|
10
|
+
return applyExportParameters(withFilters, csvRawRequest, insightParameterValues, enableStringParameters);
|
|
11
11
|
}
|
|
12
12
|
function applyExportFilters(executionDefinition, csvRawRequest, insight, widget, commonDateFilterId) {
|
|
13
13
|
const filters = csvRawRequest?.content?.filters;
|
|
@@ -27,9 +27,9 @@ function applyExportFilters(executionDefinition, csvRawRequest, insight, widget,
|
|
|
27
27
|
}
|
|
28
28
|
// Dialog overrides (`parametersByTab`) on top of the caller-resolved insight base. The base comes
|
|
29
29
|
// from a selector, not the live execution, whose no-data fallback (`newDefForInsight`) has no params.
|
|
30
|
-
function applyExportParameters(executionDefinition, csvRawRequest, insightParameterValues) {
|
|
30
|
+
function applyExportParameters(executionDefinition, csvRawRequest, insightParameterValues, enableStringParameters) {
|
|
31
31
|
const stored = Object.values(csvRawRequest?.content?.parametersByTab ?? {}).flat();
|
|
32
|
-
const parameterValues = mergeParameterValues(insightParameterValues, exportParametersToValues(stored));
|
|
32
|
+
const parameterValues = mergeParameterValues(insightParameterValues, exportParametersToValues(stored, enableStringParameters));
|
|
33
33
|
if (parameterValues.length === 0) {
|
|
34
34
|
return executionDefinition;
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeAutomationsHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAgD/C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"initializeAutomationsHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAgD/C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAqC/E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAWnE,wBAAiB,4BAA4B,CACzC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,sBAAsB,GAC7B,YAAY,CA+Sd"}
|
|
@@ -14,7 +14,7 @@ import { switchDashboardTab } from "../../commands/tabs.js";
|
|
|
14
14
|
import { dispatchDashboardEvent } from "../../store/_infra/eventDispatcher.js";
|
|
15
15
|
import { selectAutomationsIsInitialized, selectAutomationsIsLoading, } from "../../store/automations/automationsSelectors.js";
|
|
16
16
|
import { automationsActions } from "../../store/automations/index.js";
|
|
17
|
-
import { selectEnableArbitraryFilterKD, selectEnableMatchFilterKD, selectEnableNotificationChannelIdentifiers, selectEnableParameters, selectExternalRecipient, selectFocusObject, selectIsExport, selectIsReadOnly, selectOpenAutomationOnLoad, } from "../../store/config/configSelectors.js";
|
|
17
|
+
import { selectEnableArbitraryFilterKD, selectEnableMatchFilterKD, selectEnableNotificationChannelIdentifiers, selectEnableParameters, selectEnableStringParameters, selectExternalRecipient, selectFocusObject, selectIsExport, selectIsReadOnly, selectOpenAutomationOnLoad, } from "../../store/config/configSelectors.js";
|
|
18
18
|
import { selectInsightByWidgetRef } from "../../store/insights/insightsSelectors.js";
|
|
19
19
|
import { selectDashboardId } from "../../store/meta/metaSelectors.js";
|
|
20
20
|
import { notificationChannelsActions } from "../../store/notificationChannels/index.js";
|
|
@@ -164,7 +164,14 @@ export function* initializeAutomationsHandler(ctx, _cmd) {
|
|
|
164
164
|
// Restore the automation's stored parameter overrides, mirroring the filter restoration
|
|
165
165
|
// above: alert params apply to the active tab, export params apply per tab.
|
|
166
166
|
const enableParameters = yield select(selectEnableParameters);
|
|
167
|
-
const
|
|
167
|
+
const enableStringParameters = yield select(selectEnableStringParameters);
|
|
168
|
+
const parameterChanges = extractAutomationParameterChanges({
|
|
169
|
+
enableParameters,
|
|
170
|
+
enableStringParameters,
|
|
171
|
+
alertParameters: getAutomationAlertParameters(targetAutomation),
|
|
172
|
+
exportParametersByTab: getAutomationExportParametersByTab(targetAutomation),
|
|
173
|
+
correlationId: automationId,
|
|
174
|
+
});
|
|
168
175
|
for (const change of parameterChanges) {
|
|
169
176
|
yield call(changeParameterValuesHandler, ctx, changeParameterValues(change));
|
|
170
177
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveScheduledEmailHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/saveScheduledEmailHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAwB/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,KAAK,6BAA6B,EAAuB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"saveScheduledEmailHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/scheduledEmail/saveScheduledEmailHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAwB/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,KAAK,6BAA6B,EAAuB,MAAM,gCAAgC,CAAC;AAkBzG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAqBnE,wBAAiB,yBAAyB,CACtC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,mBAAmB,GACzB,YAAY,CAAC,6BAA6B,CAAC,CAkG7C"}
|
|
@@ -5,7 +5,7 @@ import { fillMissingTitles, resolveDefaultDisplayFormRefForDisplayForm, resolveM
|
|
|
5
5
|
import { scheduledEmailSaved } from "../../events/scheduledEmail.js";
|
|
6
6
|
import { queryWithInsight } from "../../queryServices/queryWidgetFilters.js";
|
|
7
7
|
import { selectCatalogAttributes } from "../../store/catalog/catalogSelectors.js";
|
|
8
|
-
import { selectLocale, selectSettings } from "../../store/config/configSelectors.js";
|
|
8
|
+
import { selectEnableStringParameters, selectLocale, selectSettings, } from "../../store/config/configSelectors.js";
|
|
9
9
|
import { selectExecutionResultByRef } from "../../store/executionResults/executionResultsSelectors.js";
|
|
10
10
|
import { selectAutomationCommonDateFilterId } from "../../store/filtering/dashboardFilterSelectors.js";
|
|
11
11
|
import { selectInsightByRef, selectInsightByWidgetRef, selectRawExportOverridesForInsight, } from "../../store/insights/insightsSelectors.js";
|
|
@@ -35,6 +35,7 @@ export function* saveScheduledEmailHandler(ctx, cmd) {
|
|
|
35
35
|
const commonDateFilterId = yield select(selectAutomationCommonDateFilterId);
|
|
36
36
|
const insight = yield select(selectInsightByWidgetRef(ref));
|
|
37
37
|
const insightParameterValues = yield select(selectReferencedInsightParameterValuesForWidget(ref));
|
|
38
|
+
const enableStringParameters = yield select(selectEnableStringParameters);
|
|
38
39
|
const locale = yield select(selectLocale);
|
|
39
40
|
const messages = yield call(resolveMessages, locale);
|
|
40
41
|
const lookupInsight = insight ? yield select(selectInsightByRef(insightRef(insight))) : undefined;
|
|
@@ -56,7 +57,15 @@ export function* saveScheduledEmailHandler(ctx, cmd) {
|
|
|
56
57
|
throw new Error("CSV raw widget attachment requires an available widget.");
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
const preparedExecutionDefinitionWithFilters = prepareCsvRawExecutionDefinition(
|
|
60
|
+
const preparedExecutionDefinitionWithFilters = prepareCsvRawExecutionDefinition({
|
|
61
|
+
executionDefinition: preparedExecutionDefinition,
|
|
62
|
+
csvRawRequest,
|
|
63
|
+
insight,
|
|
64
|
+
insightParameterValues,
|
|
65
|
+
enableStringParameters,
|
|
66
|
+
widget,
|
|
67
|
+
commonDateFilterId,
|
|
68
|
+
});
|
|
60
69
|
const settings = yield select(selectSettings);
|
|
61
70
|
const catalogAttributes = yield select(selectCatalogAttributes);
|
|
62
71
|
const preloadedAttributesWithReferences = yield select(selectPreloadedAttributesWithReferences);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportInsightWidgetHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/widgets/exportInsightWidgetHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"exportInsightWidgetHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/widgets/exportInsightWidgetHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAsB/C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EACH,KAAK,qCAAqC,EAG7C,MAAM,yBAAyB,CAAC;AAYjC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAsFnE,wBAAiB,0BAA0B,CACvC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,oBAAoB,GAC1B,YAAY,CAAC,qCAAqC,CAAC,CA2FrD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { call, put, select } from "redux-saga/effects";
|
|
3
3
|
import { invariant } from "ts-invariant";
|
|
4
|
-
import { serializeObjRef } from "@gooddata/sdk-model";
|
|
5
|
-
import { createExportFunction, prepareGeoInsightForDataExport, } from "@gooddata/sdk-ui";
|
|
6
|
-
import { createExportExecutionDefinition } from "@gooddata/sdk-ui/internal";
|
|
4
|
+
import { serializeObjRef, } from "@gooddata/sdk-model";
|
|
5
|
+
import { createExportFunction, prepareGeoInsightForDataExport, prepareGeoLayerInsightsForDataExport, } from "@gooddata/sdk-ui";
|
|
6
|
+
import { createExportExecutionDefinition, } from "@gooddata/sdk-ui/internal";
|
|
7
7
|
import { invalidArgumentsProvided } from "../../events/general.js";
|
|
8
8
|
import { insightWidgetExportRequested, insightWidgetExportResolved, } from "../../events/insight.js";
|
|
9
9
|
import { selectCatalogAttributes } from "../../store/catalog/catalogSelectors.js";
|
|
@@ -18,6 +18,18 @@ async function performExport(ctx, executionResult, config, exportDefinition) {
|
|
|
18
18
|
const exporter = createExportFunction(exportExecutionResult);
|
|
19
19
|
return exporter(config);
|
|
20
20
|
}
|
|
21
|
+
async function performMultiLayerExport(ctx, layers, config) {
|
|
22
|
+
const results = await Promise.all(layers.map(({ definition }) => ctx.backend.workspace(ctx.workspace).execution().forDefinition(definition).execute()));
|
|
23
|
+
const [primaryResult, ...additionalResults] = results;
|
|
24
|
+
const exporter = createExportFunction(primaryResult);
|
|
25
|
+
return exporter({
|
|
26
|
+
...config,
|
|
27
|
+
additionalExecutions: additionalResults.map((executionResult, index) => ({
|
|
28
|
+
executionResult,
|
|
29
|
+
title: layers[index + 1].title,
|
|
30
|
+
})),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
21
33
|
function* validateIsExportable(ctx, cmd, ref) {
|
|
22
34
|
const isExportable = yield select(selectIsExecutionResultReadyForExportByRef(ref));
|
|
23
35
|
if (!isExportable) {
|
|
@@ -48,24 +60,46 @@ export function* exportInsightWidgetHandler(ctx, cmd) {
|
|
|
48
60
|
const executionEnvelope = yield select(selectExecutionResultByRef(ref));
|
|
49
61
|
// executionResult must be defined at this point
|
|
50
62
|
invariant(executionEnvelope?.executionResult);
|
|
63
|
+
const executionResult = executionEnvelope.executionResult;
|
|
51
64
|
const insight = payloadInsight ?? (yield select(selectInsightByWidgetRef(ref)));
|
|
52
65
|
const settings = yield select(selectSettings);
|
|
53
66
|
const catalogAttributes = yield select(selectCatalogAttributes);
|
|
54
67
|
const preloadedAttributesWithReferences = yield select(selectPreloadedAttributesWithReferences);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
const buildLayerDefinition = (tableInsight, definitionOptions) => createExportExecutionDefinition(tableInsight, ctx.workspace, executionResult.definition, definitionOptions);
|
|
69
|
+
// Per-layer export is defined for XLSX (sheet per layer) and CSV (zipped file per layer) only;
|
|
70
|
+
// other formats (PDF) keep the original single-execution behavior.
|
|
71
|
+
const isMultiLayerExportFormat = config.format === "xlsx" || config.format === "csv";
|
|
72
|
+
const layerInsights = insight && isMultiLayerExportFormat
|
|
73
|
+
? prepareGeoLayerInsightsForDataExport(insight, {
|
|
58
74
|
settings,
|
|
59
75
|
catalogAttributes,
|
|
60
76
|
preloadedAttributesWithReferences,
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
exportInsight === insight
|
|
64
|
-
? undefined
|
|
65
|
-
: createExportExecutionDefinition(exportInsight, ctx.workspace, executionEnvelope.executionResult.definition);
|
|
66
|
-
}
|
|
77
|
+
})
|
|
78
|
+
: undefined;
|
|
67
79
|
const timeout = yield select(selectExportResultPollingTimeout);
|
|
68
|
-
|
|
80
|
+
let result;
|
|
81
|
+
if (layerInsights && layerInsights.length > 1) {
|
|
82
|
+
result = (yield call(performMultiLayerExport, ctx, layerInsights.map((layer) => ({
|
|
83
|
+
title: layer.layerName,
|
|
84
|
+
// Layer filters live on the converted table insight, not in the base (root)
|
|
85
|
+
// execution — merge them in so each layer exports the data it displays.
|
|
86
|
+
definition: buildLayerDefinition(layer.tableInsight, {
|
|
87
|
+
includeInsightFilters: true,
|
|
88
|
+
attributeLocalIdMapping: layer.attributeLocalIdMapping,
|
|
89
|
+
}),
|
|
90
|
+
})), { ...config, timeout }));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
const exportInsight = insight
|
|
94
|
+
? (prepareGeoInsightForDataExport(insight, {
|
|
95
|
+
settings,
|
|
96
|
+
catalogAttributes,
|
|
97
|
+
preloadedAttributesWithReferences,
|
|
98
|
+
}) ?? insight)
|
|
99
|
+
: undefined;
|
|
100
|
+
const exportDefinition = exportInsight && exportInsight !== insight ? buildLayerDefinition(exportInsight) : undefined;
|
|
101
|
+
result = (yield call(performExport, ctx, executionResult, { ...config, timeout }, exportDefinition));
|
|
102
|
+
}
|
|
69
103
|
// prepend hostname if provided so that the results are downloaded from there, not from where the app is hosted
|
|
70
104
|
const fullUri = ctx.backend.config.hostname
|
|
71
105
|
? new URL(result.uri, ctx.backend.config.hostname).href
|
|
@@ -3,8 +3,13 @@ import { type IExportTemplate } from "@gooddata/sdk-model";
|
|
|
3
3
|
* Fetches export templates when the feature flag is enabled.
|
|
4
4
|
* Returns an empty array when disabled or while loading.
|
|
5
5
|
*
|
|
6
|
-
* Fetches
|
|
7
|
-
*
|
|
6
|
+
* Fetches from both scopes and merges them: workspace-level templates (including any inherited from
|
|
7
|
+
* a parent workspace) and organization-level templates. Templates are deduplicated by ref — on a
|
|
8
|
+
* collision the workspace copy wins, as the more specific scope. Each scope is read independently:
|
|
9
|
+
* if one scope cannot be read (e.g. the user lacks organization-level permissions), the hook
|
|
10
|
+
* degrades to the other scope rather than failing the whole export flow.
|
|
11
|
+
*
|
|
12
|
+
* The backend caching layer deduplicates redundant calls across hook instances for both scopes.
|
|
8
13
|
*
|
|
9
14
|
* @internal
|
|
10
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExportTemplates.d.ts","sourceRoot":"","sources":["../../../src/model/react/useExportTemplates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useExportTemplates.d.ts","sourceRoot":"","sources":["../../../src/model/react/useExportTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,qBAAqB,CAAC;AAO3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,EAAE,CAqBtD"}
|
|
@@ -1,26 +1,70 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { objRefToString } from "@gooddata/sdk-model";
|
|
3
|
+
import { useBackendStrict, useCancelablePromise, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
3
4
|
import { selectEnableExportTemplateSelection } from "../store/config/configSelectors.js";
|
|
4
5
|
import { useDashboardSelector } from "./DashboardStoreProvider.js";
|
|
5
6
|
/**
|
|
6
7
|
* Fetches export templates when the feature flag is enabled.
|
|
7
8
|
* Returns an empty array when disabled or while loading.
|
|
8
9
|
*
|
|
9
|
-
* Fetches
|
|
10
|
-
*
|
|
10
|
+
* Fetches from both scopes and merges them: workspace-level templates (including any inherited from
|
|
11
|
+
* a parent workspace) and organization-level templates. Templates are deduplicated by ref — on a
|
|
12
|
+
* collision the workspace copy wins, as the more specific scope. Each scope is read independently:
|
|
13
|
+
* if one scope cannot be read (e.g. the user lacks organization-level permissions), the hook
|
|
14
|
+
* degrades to the other scope rather than failing the whole export flow.
|
|
15
|
+
*
|
|
16
|
+
* The backend caching layer deduplicates redundant calls across hook instances for both scopes.
|
|
11
17
|
*
|
|
12
18
|
* @internal
|
|
13
19
|
*/
|
|
14
20
|
export function useExportTemplates() {
|
|
15
21
|
const backend = useBackendStrict();
|
|
22
|
+
const workspace = useWorkspaceStrict();
|
|
16
23
|
const isEnabled = useDashboardSelector(selectEnableExportTemplateSelection);
|
|
17
24
|
const { result } = useCancelablePromise({
|
|
18
25
|
promise: isEnabled
|
|
19
26
|
? async () => {
|
|
20
|
-
const
|
|
21
|
-
|
|
27
|
+
const [workspaceTemplates, orgTemplates] = await Promise.all([
|
|
28
|
+
loadWorkspaceTemplates(backend, workspace),
|
|
29
|
+
loadOrgTemplates(backend),
|
|
30
|
+
]);
|
|
31
|
+
return mergeExportTemplates(workspaceTemplates, orgTemplates);
|
|
22
32
|
}
|
|
23
33
|
: () => Promise.resolve([]),
|
|
24
|
-
}, [backend, isEnabled]);
|
|
34
|
+
}, [backend, workspace, isEnabled]);
|
|
25
35
|
return result ?? [];
|
|
26
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Loads workspace-level export templates, degrading to an empty list if the workspace scope cannot
|
|
39
|
+
* be read so that organization templates (loaded in parallel) are still offered.
|
|
40
|
+
*/
|
|
41
|
+
async function loadWorkspaceTemplates(backend, workspace) {
|
|
42
|
+
return backend
|
|
43
|
+
.workspace(workspace)
|
|
44
|
+
.exportTemplates()
|
|
45
|
+
.getExportTemplates()
|
|
46
|
+
.catch(() => []);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Loads organization-level export templates, degrading to an empty list if the organization scope
|
|
50
|
+
* cannot be read (e.g. missing org-level permissions) so that workspace templates (loaded in
|
|
51
|
+
* parallel) are still offered.
|
|
52
|
+
*/
|
|
53
|
+
async function loadOrgTemplates(backend) {
|
|
54
|
+
return backend
|
|
55
|
+
.organizations()
|
|
56
|
+
.getCurrentOrganization()
|
|
57
|
+
.then((org) => org.exportTemplates().getExportTemplates())
|
|
58
|
+
.catch(() => []);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Merges workspace and organization templates into a single list, deduplicated by ref. Workspace
|
|
62
|
+
* templates take precedence and are listed first, as the more specific scope.
|
|
63
|
+
*/
|
|
64
|
+
function mergeExportTemplates(workspaceTemplates, orgTemplates) {
|
|
65
|
+
const seen = new Set(workspaceTemplates.map((template) => objRefToString(template.ref)));
|
|
66
|
+
return [
|
|
67
|
+
...workspaceTemplates,
|
|
68
|
+
...orgTemplates.filter((template) => !seen.has(objRefToString(template.ref))),
|
|
69
|
+
];
|
|
70
|
+
}
|
|
@@ -193,7 +193,7 @@ export declare function computeParameterResetTargets(entries: IDashboardParamete
|
|
|
193
193
|
export declare function collectExportOverrides(tabRefSelections: ReadonlyArray<{
|
|
194
194
|
tab: ITabState;
|
|
195
195
|
allowedRefs?: Set<string>;
|
|
196
|
-
}>, workspaceParameterByRef: Map<string, IParameterMetadataObject>,
|
|
196
|
+
}>, workspaceParameterByRef: Map<string, IParameterMetadataObject>, isStringEnabled: boolean): Record<string, IDashboardExportParameter[]>;
|
|
197
197
|
/**
|
|
198
198
|
* Builds per-tab ref selections for a widget-scope export: each widget's owning tab is restricted
|
|
199
199
|
* to refs referenced by the widget's insight metrics. Multiple widgets on the same tab union their
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parametersHelpers.d.ts","sourceRoot":"","sources":["../../../../../src/model/store/tabs/parameters/parametersHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"parametersHelpers.d.ts","sourceRoot":"","sources":["../../../../../src/model/store/tabs/parameters/parametersHelpers.ts"],"names":[],"mappings":"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"}
|