@gooddata/sdk-ui-dashboard 11.42.0-alpha.2 → 11.42.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +6 -6
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/_staging/automation/index.d.ts +19 -1
- package/esm/_staging/automation/index.d.ts.map +1 -1
- package/esm/_staging/automation/index.js +64 -1
- package/esm/model/commandHandlers/parameters/changeParameterValuesHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/parameters/changeParameterValuesHandler.js +4 -1
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts +12 -0
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts.map +1 -0
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.js +26 -0
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.js +12 -1
- package/esm/model/commands/parameters.d.ts +6 -1
- package/esm/model/commands/parameters.d.ts.map +1 -1
- package/esm/model/commands/parameters.js +2 -1
- package/esm/model/store/tabs/parameters/parametersReducers.d.ts +4 -0
- package/esm/model/store/tabs/parameters/parametersReducers.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersReducers.js +6 -6
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +16 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +2 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +32 -12
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts +33 -1
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/automationParameters.js +52 -0
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts +27 -3
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.js +44 -12
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts +2 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.js +7 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts +23 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.js +93 -2
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts +75 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts.map +1 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.js +143 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts +1 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.js +1 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.js +15 -2
- package/esm/presentation/automations/shared/automationFilters/useParameterAnnouncements.d.ts +15 -0
- package/esm/presentation/automations/shared/automationFilters/useParameterAnnouncements.d.ts.map +1 -0
- package/esm/presentation/automations/shared/automationFilters/useParameterAnnouncements.js +28 -0
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +16 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +16 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +4 -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 +4 -0
- package/esm/presentation/widget/widget/InsightWidget/EditableDashboardInsightWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/EditableDashboardInsightWidget.js +10 -1
- package/esm/presentation/widget/widget/warningPartialResult/InsightWidgetWarningPartialResult.d.ts +5 -4
- package/esm/presentation/widget/widget/warningPartialResult/InsightWidgetWarningPartialResult.d.ts.map +1 -1
- package/esm/presentation/widget/widget/warningPartialResult/InsightWidgetWarningPartialResult.js +3 -3
- package/esm/sdk-ui-dashboard.d.ts +10 -1
- package/package.json +20 -20
- package/styles/css/main.css +1 -1
- package/styles/css/warningPartialResult.css +1 -1
- package/styles/scss/warningPartialResult.scss +1 -1
package/NOTICE
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
The following 3rd-party software packages may be used by or distributed with gooddata-ui-sdk. Any information relevant to third-party vendors listed below are collected using common, reasonable means.
|
|
9
9
|
|
|
10
|
-
Date generated: 2026-6-
|
|
10
|
+
Date generated: 2026-6-15
|
|
11
11
|
|
|
12
|
-
Revision ID:
|
|
12
|
+
Revision ID: a109cf6c2e762b7d0655e4f6da695420f910643f
|
|
13
13
|
|
|
14
14
|
================================================================================
|
|
15
15
|
================================================================================
|
|
@@ -383,7 +383,7 @@ Revision ID: f75738464fd32f3d4e0f874c715181b53a187ef8
|
|
|
383
383
|
- balanced-match (2.0.0) [MIT]
|
|
384
384
|
- balanced-match (4.0.4) [MIT]
|
|
385
385
|
- base64-js (1.5.1) [MIT]
|
|
386
|
-
- baseline-browser-mapping (2.10.
|
|
386
|
+
- baseline-browser-mapping (2.10.37) [Apache-2.0]
|
|
387
387
|
- batch (0.6.1) [MIT]
|
|
388
388
|
- binary-extensions (2.3.0) [MIT]
|
|
389
389
|
- bl (4.1.0) [MIT]
|
|
@@ -5454,9 +5454,9 @@ MIT
|
|
|
5454
5454
|
|
|
5455
5455
|
|
|
5456
5456
|
--------------------------------------------------------------------------------
|
|
5457
|
-
Package Title: baseline-browser-mapping (2.10.
|
|
5457
|
+
Package Title: baseline-browser-mapping (2.10.37)
|
|
5458
5458
|
|
|
5459
|
-
Package Locator: npm+baseline-browser-mapping$2.10.
|
|
5459
|
+
Package Locator: npm+baseline-browser-mapping$2.10.37
|
|
5460
5460
|
|
|
5461
5461
|
Package Depth: Transitive
|
|
5462
5462
|
--------------------------------------------------------------------------------
|
|
@@ -38571,4 +38571,4 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
38571
38571
|
--------------------------------------------------------------------------------
|
|
38572
38572
|
--------------------------------------------------------------------------------
|
|
38573
38573
|
|
|
38574
|
-
Report Generated by FOSSA on 2026-6-
|
|
38574
|
+
Report Generated by FOSSA on 2026-6-15
|
package/esm/__version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.42.0-alpha.
|
|
1
|
+
export declare const LIB_VERSION = "11.42.0-alpha.4";
|
|
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.42.0-alpha.
|
|
3
|
+
export const LIB_VERSION = "11.42.0-alpha.4";
|
|
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 IExportDefinitionMetadataObject, type IExportDefinitionMetadataObjectDefinition, type IFilter, type IUser, type IWorkspaceUser } from "@gooddata/sdk-model";
|
|
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;
|
|
@@ -11,6 +11,24 @@ export declare const getAutomationDashboardFilters: (automation: IAutomationMeta
|
|
|
11
11
|
* Returns filtersByTab from the first dashboard export definition.
|
|
12
12
|
*/
|
|
13
13
|
export declare const getAutomationDashboardFiltersByTab: (automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | undefined) => Record<string, FilterContextItem[]> | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Extracts the per-tab parameter overrides from automation metadata. All export definitions carry
|
|
16
|
+
* the same `content.parametersByTab`, so the first dashboard or visualization-object definition
|
|
17
|
+
* that has them wins.
|
|
18
|
+
*/
|
|
19
|
+
export declare const getAutomationExportParametersByTab: (automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | undefined) => Record<string, IDashboardExportParameter[]> | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Returns a copy of the automation with `content.parametersByTab` replaced on every dashboard and
|
|
22
|
+
* visualization-object export definition. Passing `undefined` clears the field (the store-filters
|
|
23
|
+
* off path). No-op when the automation carries no export definitions. Write-side counterpart of
|
|
24
|
+
* {@link getAutomationExportParametersByTab}.
|
|
25
|
+
*/
|
|
26
|
+
export declare function setExportParametersByTab(automation: IAutomationMetadataObjectDefinition, parametersByTab: Record<string, IDashboardExportParameter[]> | undefined): IAutomationMetadataObjectDefinition;
|
|
27
|
+
/**
|
|
28
|
+
* Converts stored export parameter overrides ({@link IDashboardExportParameter}, value carried as a
|
|
29
|
+
* string) to {@link IInsightParameterValue} runtime values. Non-finite values are dropped.
|
|
30
|
+
*/
|
|
31
|
+
export declare function exportParametersToValues(stored: IDashboardExportParameter[]): IInsightParameterValue[];
|
|
14
32
|
export declare const getAutomationVisualizationFilters: (automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | undefined) => {
|
|
15
33
|
executionFilters: IFilter[] | undefined;
|
|
16
34
|
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,
|
|
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,EAMtB,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;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,yBAAyB,EAAE,GAAG,sBAAsB,EAAE,CAQtG;AAED,eAAO,MAAM,iCAAiC;;;CAuB7C,CAAC;AAEF,eAAO,MAAM,yBAAyB,oHAQrC,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 { isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isFilter, isFilterContextItem, } from "@gooddata/sdk-model";
|
|
3
|
+
import { idRef, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isFilter, isFilterContextItem, } from "@gooddata/sdk-model";
|
|
4
4
|
export const isDashboardAutomation = (automation) => {
|
|
5
5
|
if (!automation) {
|
|
6
6
|
return false;
|
|
@@ -63,6 +63,69 @@ export const getAutomationDashboardFiltersByTab = (automation) => {
|
|
|
63
63
|
return isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload);
|
|
64
64
|
})?.requestPayload?.content.filtersByTab;
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Extracts the per-tab parameter overrides from automation metadata. All export definitions carry
|
|
68
|
+
* the same `content.parametersByTab`, so the first dashboard or visualization-object definition
|
|
69
|
+
* that has them wins.
|
|
70
|
+
*/
|
|
71
|
+
export const getAutomationExportParametersByTab = (automation) => {
|
|
72
|
+
return automation?.exportDefinitions
|
|
73
|
+
?.map((exportDefinition) => exportDefinition.requestPayload)
|
|
74
|
+
.find((requestPayload) => (isExportDefinitionDashboardRequestPayload(requestPayload) ||
|
|
75
|
+
isExportDefinitionVisualizationObjectRequestPayload(requestPayload)) &&
|
|
76
|
+
!!requestPayload.content.parametersByTab)?.content.parametersByTab;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Returns a copy of the automation with `content.parametersByTab` replaced on every dashboard and
|
|
80
|
+
* visualization-object export definition. Passing `undefined` clears the field (the store-filters
|
|
81
|
+
* off path). No-op when the automation carries no export definitions. Write-side counterpart of
|
|
82
|
+
* {@link getAutomationExportParametersByTab}.
|
|
83
|
+
*/
|
|
84
|
+
export function setExportParametersByTab(automation, parametersByTab) {
|
|
85
|
+
if (!automation.exportDefinitions?.length) {
|
|
86
|
+
return automation;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
...automation,
|
|
90
|
+
exportDefinitions: automation.exportDefinitions.map((exportDefinition) => {
|
|
91
|
+
const { requestPayload } = exportDefinition;
|
|
92
|
+
// Both branches are identical on purpose: narrowing to one variant keeps `content`'s exact type.
|
|
93
|
+
// Spreading the raw union widens `dashboard` to `string | undefined`, matching neither.
|
|
94
|
+
if (isExportDefinitionDashboardRequestPayload(requestPayload)) {
|
|
95
|
+
return {
|
|
96
|
+
...exportDefinition,
|
|
97
|
+
requestPayload: {
|
|
98
|
+
...requestPayload,
|
|
99
|
+
content: { ...requestPayload.content, parametersByTab },
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (isExportDefinitionVisualizationObjectRequestPayload(requestPayload)) {
|
|
104
|
+
return {
|
|
105
|
+
...exportDefinition,
|
|
106
|
+
requestPayload: {
|
|
107
|
+
...requestPayload,
|
|
108
|
+
content: { ...requestPayload.content, parametersByTab },
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return exportDefinition;
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Converts stored export parameter overrides ({@link IDashboardExportParameter}, value carried as a
|
|
118
|
+
* string) to {@link IInsightParameterValue} runtime values. Non-finite values are dropped.
|
|
119
|
+
*/
|
|
120
|
+
export function exportParametersToValues(stored) {
|
|
121
|
+
return stored.reduce((acc, row) => {
|
|
122
|
+
const value = Number(row.value);
|
|
123
|
+
if (Number.isFinite(value)) {
|
|
124
|
+
acc.push({ ref: idRef(row.id, "parameter"), value });
|
|
125
|
+
}
|
|
126
|
+
return acc;
|
|
127
|
+
}, []);
|
|
128
|
+
}
|
|
66
129
|
export const getAutomationVisualizationFilters = (automation) => {
|
|
67
130
|
if (!automation) {
|
|
68
131
|
return { executionFilters: undefined, filterContextItems: undefined };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeParameterValuesHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/parameters/changeParameterValuesHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;GAIG;AACH,wBAAiB,4BAA4B,CACzC,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,sBAAsB,GAC5B,YAAY,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"changeParameterValuesHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/parameters/changeParameterValuesHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;GAIG;AACH,wBAAiB,4BAA4B,CACzC,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,sBAAsB,GAC5B,YAAY,CAAC,IAAI,CAAC,CAOpB"}
|
|
@@ -7,5 +7,8 @@ import { tabsActions } from "../../store/tabs/index.js";
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export function* changeParameterValuesHandler(_ctx, cmd) {
|
|
10
|
-
yield put(tabsActions.setParameterRuntimeValues({
|
|
10
|
+
yield put(tabsActions.setParameterRuntimeValues({
|
|
11
|
+
values: cmd.payload.parameters,
|
|
12
|
+
tabLocalIdentifier: cmd.payload.tabLocalIdentifier,
|
|
13
|
+
}));
|
|
11
14
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IDashboardExportParameter, type IInsightParameterValue } from "@gooddata/sdk-model";
|
|
2
|
+
import { type ChangeParameterValuesParams } from "../../commands/parameters.js";
|
|
3
|
+
/**
|
|
4
|
+
* Pure decision logic for restoring an automation's stored parameter overrides on dashboard load.
|
|
5
|
+
* Returns the {@link changeParameterValues} command params to dispatch: alert params target the
|
|
6
|
+
* active tab, export params target their own tab. Mirrors the filter-side `extractRelevantFilters` —
|
|
7
|
+
* the saga reads the raw pieces off the automation and dispatches each result.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractAutomationParameterChanges(enableParameters: boolean, alertParameters: IInsightParameterValue[] | undefined, exportParametersByTab: Record<string, IDashboardExportParameter[]> | undefined, correlationId: string): ChangeParameterValuesParams[];
|
|
12
|
+
//# sourceMappingURL=automationParametersRestore.d.ts.map
|
|
@@ -0,0 +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;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC7C,gBAAgB,EAAE,OAAO,EACzB,eAAe,EAAE,sBAAsB,EAAE,GAAG,SAAS,EACrD,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,EAC9E,aAAa,EAAE,MAAM,GACtB,2BAA2B,EAAE,CAe/B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { exportParametersToValues } from "../../../_staging/automation/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Pure decision logic for restoring an automation's stored parameter overrides on dashboard load.
|
|
5
|
+
* Returns the {@link changeParameterValues} command params to dispatch: alert params target the
|
|
6
|
+
* active tab, export params target their own tab. Mirrors the filter-side `extractRelevantFilters` —
|
|
7
|
+
* the saga reads the raw pieces off the automation and dispatches each result.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function extractAutomationParameterChanges(enableParameters, alertParameters, exportParametersByTab, correlationId) {
|
|
12
|
+
if (!enableParameters) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const changes = [];
|
|
16
|
+
if (alertParameters?.length) {
|
|
17
|
+
changes.push({ parameters: alertParameters, correlationId });
|
|
18
|
+
}
|
|
19
|
+
for (const [tabLocalIdentifier, exportParameters] of Object.entries(exportParametersByTab ?? {})) {
|
|
20
|
+
const parameters = exportParametersToValues(exportParameters);
|
|
21
|
+
if (parameters.length) {
|
|
22
|
+
changes.push({ parameters, tabLocalIdentifier, correlationId });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return changes;
|
|
26
|
+
}
|
|
@@ -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;
|
|
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;AA6C/C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAuC/E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAWnE,wBAAiB,4BAA4B,CACzC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,sBAAsB,GAC7B,YAAY,CAqTd"}
|
|
@@ -5,14 +5,16 @@ import { all, call, put, select } from "redux-saga/effects";
|
|
|
5
5
|
import { generateDateFilterLocalIdentifier } from "@gooddata/sdk-backend-base";
|
|
6
6
|
import { dashboardFilterLocalIdentifier, filterLocalIdentifier, filterObjRef, idRef, insightFilters, isAbsoluteDateFilter, isAttributeFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDateFilter, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isFilterContextItem, isInsightWidget, isMeasureValueFilter, isRankingFilter, isRelativeDateFilter, isSingleSelectionFilter, } from "@gooddata/sdk-model";
|
|
7
7
|
import { convertError } from "@gooddata/sdk-ui";
|
|
8
|
+
import { getAutomationExportParametersByTab } from "../../../_staging/automation/index.js";
|
|
8
9
|
import { dashboardFilterToFilterContextItem } from "../../../_staging/dashboard/dashboardFilterContext.js";
|
|
9
10
|
import { isDashboardFilter } from "../../../types.js";
|
|
10
11
|
import { changeFilterContextSelection, changeFilterContextSelectionByParams, } from "../../commands/filters.js";
|
|
12
|
+
import { changeParameterValues } from "../../commands/parameters.js";
|
|
11
13
|
import { switchDashboardTab } from "../../commands/tabs.js";
|
|
12
14
|
import { dispatchDashboardEvent } from "../../store/_infra/eventDispatcher.js";
|
|
13
15
|
import { selectAutomationsIsInitialized, selectAutomationsIsLoading, } from "../../store/automations/automationsSelectors.js";
|
|
14
16
|
import { automationsActions } from "../../store/automations/index.js";
|
|
15
|
-
import { selectEnableArbitraryFilterKD, selectEnableAutomations, selectEnableInPlatformNotifications, selectEnableMatchFilterKD, selectEnableNotificationChannelIdentifiers, selectExternalRecipient, selectFocusObject, selectIsExport, selectIsReadOnly, selectOpenAutomationOnLoad, } from "../../store/config/configSelectors.js";
|
|
17
|
+
import { selectEnableArbitraryFilterKD, selectEnableAutomations, selectEnableInPlatformNotifications, selectEnableMatchFilterKD, selectEnableNotificationChannelIdentifiers, selectEnableParameters, selectExternalRecipient, selectFocusObject, selectIsExport, selectIsReadOnly, selectOpenAutomationOnLoad, } from "../../store/config/configSelectors.js";
|
|
16
18
|
import { selectInsightByWidgetRef } from "../../store/insights/insightsSelectors.js";
|
|
17
19
|
import { selectDashboardId } from "../../store/meta/metaSelectors.js";
|
|
18
20
|
import { notificationChannelsActions } from "../../store/notificationChannels/index.js";
|
|
@@ -26,7 +28,9 @@ import { uiActions } from "../../store/ui/index.js";
|
|
|
26
28
|
import { selectCurrentUser } from "../../store/user/userSelectors.js";
|
|
27
29
|
import { isFilterTypeCompatibleWithSelectionType } from "../dashboard/common/attributeFilterSelectionTypeCompatibility.js";
|
|
28
30
|
import { changeFilterContextSelectionHandler } from "../filterContext/changeFilterContextSelectionHandler.js";
|
|
31
|
+
import { changeParameterValuesHandler } from "../parameters/changeParameterValuesHandler.js";
|
|
29
32
|
import { switchDashboardTabHandler } from "../tabs/switchDashboardTabHandler.js";
|
|
33
|
+
import { extractAutomationParameterChanges } from "./automationParametersRestore.js";
|
|
30
34
|
import { loadDashboardUserAutomations, loadWorkspaceAutomationsCount } from "./loadAutomations.js";
|
|
31
35
|
import { loadNotificationChannels } from "./loadNotificationChannels.js";
|
|
32
36
|
export function* initializeAutomationsHandler(ctx, _cmd) {
|
|
@@ -160,6 +164,13 @@ export function* initializeAutomationsHandler(ctx, _cmd) {
|
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
}
|
|
167
|
+
// Restore the automation's stored parameter overrides, mirroring the filter restoration
|
|
168
|
+
// above: alert params apply to the active tab, export params apply per tab.
|
|
169
|
+
const enableParameters = yield select(selectEnableParameters);
|
|
170
|
+
const parameterChanges = extractAutomationParameterChanges(enableParameters, targetAutomation?.alert?.execution?.parameters, getAutomationExportParametersByTab(targetAutomation), automationId);
|
|
171
|
+
for (const change of parameterChanges) {
|
|
172
|
+
yield call(changeParameterValuesHandler, ctx, changeParameterValues(change));
|
|
173
|
+
}
|
|
163
174
|
if (targetAutomation && openAutomationOnLoad) {
|
|
164
175
|
const widgetRef = targetWidget && idRef(targetWidget);
|
|
165
176
|
if (targetAutomation.alert) {
|
|
@@ -7,6 +7,10 @@ import { type IDashboardCommand } from "./base.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export type ChangeParameterValuesParams = {
|
|
9
9
|
parameters: IInsightParameterValue[];
|
|
10
|
+
/**
|
|
11
|
+
* Target tab. When omitted, the runtime overrides are applied to the active tab.
|
|
12
|
+
*/
|
|
13
|
+
tabLocalIdentifier?: string;
|
|
10
14
|
correlationId?: string;
|
|
11
15
|
};
|
|
12
16
|
/**
|
|
@@ -16,6 +20,7 @@ export type ChangeParameterValuesParams = {
|
|
|
16
20
|
*/
|
|
17
21
|
export interface IChangeParameterValuesPayload {
|
|
18
22
|
readonly parameters: IInsightParameterValue[];
|
|
23
|
+
readonly tabLocalIdentifier?: string;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Command for setting runtime parameter overrides on the currently active tab.
|
|
@@ -43,5 +48,5 @@ export interface IChangeParameterValues extends IDashboardCommand {
|
|
|
43
48
|
* @param params - params for the command creator
|
|
44
49
|
* @internal
|
|
45
50
|
*/
|
|
46
|
-
export declare function changeParameterValues({ parameters, correlationId }: ChangeParameterValuesParams): IChangeParameterValues;
|
|
51
|
+
export declare function changeParameterValues({ parameters, tabLocalIdentifier, correlationId }: ChangeParameterValuesParams): IChangeParameterValues;
|
|
47
52
|
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/model/commands/parameters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACtC,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC1C,QAAQ,CAAC,UAAU,EAAE,sBAAsB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/model/commands/parameters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACtC,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC1C,QAAQ,CAAC,UAAU,EAAE,sBAAsB,EAAE,CAAC;IAC9C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC7D,QAAQ,CAAC,IAAI,EAAE,uCAAuC,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;CACnD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,UAAU,EACV,kBAAkB,EAClB,aAAa,EAChB,EAAE,2BAA2B,GAAG,sBAAsB,CAStD"}
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
* @param params - params for the command creator
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
export function changeParameterValues({ parameters, correlationId, }) {
|
|
16
|
+
export function changeParameterValues({ parameters, tabLocalIdentifier, correlationId, }) {
|
|
17
17
|
return {
|
|
18
18
|
type: "GDC.DASH/CMD.PARAMETERS.CHANGE_VALUES",
|
|
19
19
|
correlationId,
|
|
20
20
|
payload: {
|
|
21
21
|
parameters,
|
|
22
|
+
tabLocalIdentifier,
|
|
22
23
|
},
|
|
23
24
|
};
|
|
24
25
|
}
|
|
@@ -24,6 +24,10 @@ export interface ISetParameterRuntimeValuePayload {
|
|
|
24
24
|
*/
|
|
25
25
|
export interface ISetParameterRuntimeValuesPayload {
|
|
26
26
|
values: ISetParameterRuntimeValuePayload[];
|
|
27
|
+
/**
|
|
28
|
+
* Target tab. When omitted, the active tab is used.
|
|
29
|
+
*/
|
|
30
|
+
tabLocalIdentifier?: string;
|
|
27
31
|
}
|
|
28
32
|
/**
|
|
29
33
|
* @alpha
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parametersReducers.d.ts","sourceRoot":"","sources":["../../../../../src/model/store/tabs/parameters/parametersReducers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AAErF,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"parametersReducers.d.ts","sourceRoot":"","sources":["../../../../../src/model/store/tabs/parameters/parametersReducers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AAErF,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,KAAK,UAAU,EAAgC,MAAM,iBAAiB,CAAC;AAIhF,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAoBD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AASD;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAC9C,MAAM,EAAE,gCAAgC,EAAE,CAAC;IAC3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAWD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,MAAM,CAAC;CACf;AA6BD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;CAK9B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { areObjRefsEqual } from "@gooddata/sdk-model";
|
|
3
|
-
import { getActiveTab } from "../tabsState.js";
|
|
3
|
+
import { getActiveTab, getTabOrActive } from "../tabsState.js";
|
|
4
4
|
import { parametersInitialState } from "./parametersState.js";
|
|
5
5
|
const addParameter = (state, action) => {
|
|
6
6
|
const activeTab = getActiveTab(state);
|
|
@@ -24,7 +24,7 @@ const setParameterRuntimeValue = (state, action) => {
|
|
|
24
24
|
};
|
|
25
25
|
const setParameterRuntimeValues = (state, action) => {
|
|
26
26
|
for (const entry of action.payload.values) {
|
|
27
|
-
setRuntimeOverride(state, entry);
|
|
27
|
+
setRuntimeOverride(state, entry, action.payload.tabLocalIdentifier);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const removeParameter = (state, action) => {
|
|
@@ -36,12 +36,12 @@ const removeParameter = (state, action) => {
|
|
|
36
36
|
parameters: activeTab.parameters.parameters.filter((entry) => !areObjRefsEqual(entry.parameter.ref, action.payload.ref)),
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
function setRuntimeOverride(state, { ref, value }) {
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
39
|
+
function setRuntimeOverride(state, { ref, value }, tabLocalIdentifier) {
|
|
40
|
+
const tab = getTabOrActive(state, tabLocalIdentifier);
|
|
41
|
+
if (!tab?.parameters) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
const entry =
|
|
44
|
+
const entry = tab.parameters.parameters.find((item) => areObjRefsEqual(item.parameter.ref, ref));
|
|
45
45
|
if (entry && entry.runtimeOverride !== value) {
|
|
46
46
|
entry.runtimeOverride = value;
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultScheduledEmailDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefaultScheduledEmailDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.tsx"],"names":[],"mappings":"AAiEA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAgE9D,wBAAgB,2BAA2B,CAAC,EACxC,qBAAqB,EACrB,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,OAAO,EACP,MAAM,EACN,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACZ,EAAE,0BAA0B,2CA0kB5B;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,0BAA0B,2CAkB5E"}
|
|
@@ -20,6 +20,7 @@ import { IntlWrapper } from "../../../localization/IntlWrapper.js";
|
|
|
20
20
|
import { ApplyCurrentFiltersConfirmDialog } from "../../shared/automationFilters/components/ApplyLatestFiltersConfirmDialog.js";
|
|
21
21
|
import { AutomationFiltersSelect } from "../../shared/automationFilters/components/AutomationFiltersSelect.js";
|
|
22
22
|
import { useValidateExistingAutomationFilters } from "../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
|
|
23
|
+
import { useAutomationExportParameters } from "../../shared/automationFilters/useAutomationExportParameters.js";
|
|
23
24
|
import { useAutomationFiltersSelect } from "../../shared/automationFilters/useAutomationFiltersSelect.js";
|
|
24
25
|
import { DeleteScheduleConfirmDialog } from "../DefaultScheduledEmailManagementDialog/components/DeleteScheduleConfirmDialog.js";
|
|
25
26
|
import { useScheduleEmailDialogAccessibility } from "../hooks/useScheduleEmailDialogAccessibility.js";
|
|
@@ -73,7 +74,7 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
73
74
|
widget,
|
|
74
75
|
});
|
|
75
76
|
const { locale, dashboardTitle, dateFormat, weekStart, maxAutomationsRecipients, allowHourlyRecurrence, isCrossFiltering, isExecutionTimestampMode, enableNewScheduledExport, enableCustomizableCsvDelimiter, defaultPdfPageSize, } = useDefaultScheduledEmailDialogData();
|
|
76
|
-
const { defaultUser, editedAutomation, originalAutomation, isSubmitDisabled, xlsxSettings, pdfSettings, csvSettings, csvRawSettings, startDate, allowExternalRecipients, allowOnlyLoggedUserRecipients, validationErrorMessage, selectedAttachments, isParentValid, onDashboardAttachmentsChange, onWidgetAttachmentsChange, onXlsxSettingsChange, onPdfSettingsChange, onCsvSettingsChange, onCsvRawSettingsChange, slidesTemplateIds, onSlidesTemplateIdChange, onDestinationChange, onMessageChange, onRecipientsChange, onRecurrenceChange, onEvaluationModeChange, onSubjectChange, onTitleChange, onFiltersChange, onApplyCurrentFilters, onStoreFiltersChange, onFiltersByTabChange, enableAutomationEvaluationMode, } = useEditScheduledEmail({
|
|
77
|
+
const { defaultUser, editedAutomation, originalAutomation, isSubmitDisabled, xlsxSettings, pdfSettings, csvSettings, csvRawSettings, startDate, allowExternalRecipients, allowOnlyLoggedUserRecipients, validationErrorMessage, selectedAttachments, isParentValid, onDashboardAttachmentsChange, onWidgetAttachmentsChange, onXlsxSettingsChange, onPdfSettingsChange, onCsvSettingsChange, onCsvRawSettingsChange, slidesTemplateIds, onSlidesTemplateIdChange, onDestinationChange, onMessageChange, onRecipientsChange, onRecurrenceChange, onEvaluationModeChange, onSubjectChange, onTitleChange, onFiltersChange, onApplyCurrentFilters, onStoreFiltersChange, onFiltersByTabChange, setParametersWire, enableAutomationEvaluationMode, } = useEditScheduledEmail({
|
|
77
78
|
notificationChannels,
|
|
78
79
|
insight,
|
|
79
80
|
widget,
|
|
@@ -94,6 +95,18 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
94
95
|
setEditedAutomationFiltersByTab,
|
|
95
96
|
availableFiltersAsVisibleFiltersByTab,
|
|
96
97
|
});
|
|
98
|
+
const { parametersEnabled, visibleParametersByTab, availableParametersByTab, flatTabId, onParameterAdd, onParameterChange, onParameterDelete, onParameterAddByTab, onParameterChangeByTab, onParameterDeleteByTab, applyLatest: applyLatestParameters, onStoreParametersChange, } = useAutomationExportParameters({
|
|
99
|
+
automationToEdit: scheduledExportToEdit,
|
|
100
|
+
widget,
|
|
101
|
+
storeParameters: storeFilters,
|
|
102
|
+
setParametersWire,
|
|
103
|
+
});
|
|
104
|
+
// The store-filters checkbox gates parameter persistence too; the new value is passed to both
|
|
105
|
+
// sides because the `storeFilters` prop still holds the old one at call time.
|
|
106
|
+
const handleStoreFiltersChange = useCallback((value, filters, filtersByTabParam) => {
|
|
107
|
+
onStoreFiltersChange(value, filters, filtersByTabParam);
|
|
108
|
+
onStoreParametersChange(value);
|
|
109
|
+
}, [onStoreFiltersChange, onStoreParametersChange]);
|
|
97
110
|
const { isValid } = useValidateExistingAutomationFilters({
|
|
98
111
|
automationToEdit: scheduledExportToEdit,
|
|
99
112
|
widget,
|
|
@@ -172,6 +185,7 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
172
185
|
if (isApplyCurrentFiltersDialogOpen) {
|
|
173
186
|
return (_jsx(ApplyCurrentFiltersConfirmDialog, { automationType: "schedule", onCancel: () => onCancel?.(), onEdit: () => {
|
|
174
187
|
onApplyCurrentFilters();
|
|
188
|
+
applyLatestParameters();
|
|
175
189
|
setIsApplyCurrentFiltersDialogOpen(false);
|
|
176
190
|
} }));
|
|
177
191
|
}
|
|
@@ -209,7 +223,7 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
209
223
|
}), children: [
|
|
210
224
|
_jsx("div", { className: "gd-divider-with-margin" }), selectedTabId === "filters" ? (_jsx("div", { ref: filtersTabContentRef, className: "gd-schedule-dialog-tab-content", style: tabContentHeight
|
|
211
225
|
? { minHeight: `${tabContentHeight}px` }
|
|
212
|
-
: undefined, children: _jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: editedAutomationFilters, onFiltersChange: onFiltersChange, storeFilters: storeFilters, onStoreFiltersChange:
|
|
226
|
+
: undefined, children: _jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: editedAutomationFilters, onFiltersChange: onFiltersChange, storeFilters: storeFilters, onStoreFiltersChange: handleStoreFiltersChange, isDashboardAutomation: !widget, overlayPositionType: OVERLAY_POSITION_TYPE, hideTitle: true, showAllFilters: true, filtersByTab: filtersByTab, editedFiltersByTab: editedAutomationFiltersByTab, onFiltersByTabChange: onFiltersByTabChange, parameters: flatTabId ? visibleParametersByTab[flatTabId] : undefined, availableParameters: flatTabId ? availableParametersByTab[flatTabId] : undefined, onParameterChange: onParameterChange, onParameterDelete: onParameterDelete, onParameterAdd: onParameterAdd, parametersByTab: visibleParametersByTab, availableParametersByTab: availableParametersByTab, onParameterChangeByTab: onParameterChangeByTab, onParameterDeleteByTab: onParameterDeleteByTab, onParameterAddByTab: onParameterAddByTab, parametersEnabled: parametersEnabled }) })) : (_jsxs("div", { ref: generalTabContentRef, className: "gd-schedule-dialog-tab-content", children: [!widget && hasMultipleTabs ? (_jsx(Message, { type: "progress", className: "gd-schedule-dialog-tab-content-info", children: intl.formatMessage({
|
|
213
227
|
id: "dialogs.schedule.email.tabs.info",
|
|
214
228
|
}) })) : null, _jsx(RecurrenceForm, { startDate: startDate, cronExpression: editedAutomation.schedule?.cron ??
|
|
215
229
|
getDefaultCronExpression(startDate), cronDescription: editedAutomation.schedule?.cronDescription, timezone: editedAutomation.schedule?.timezone ??
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DashboardAttachmentType, type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationRecipient, type IAutomationVisibleFilter, type IExportDefinitionVisualizationObjectSettings, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type WidgetAttachmentType } from "@gooddata/sdk-model";
|
|
1
|
+
import { type DashboardAttachmentType, type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationRecipient, type IAutomationVisibleFilter, type IDashboardExportParameter, type IExportDefinitionVisualizationObjectSettings, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type WidgetAttachmentType } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IAutomationFiltersTab } from "../../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
3
3
|
import { type ExtendedDashboardWidget } from "../../../../../model/types/layoutTypes.js";
|
|
4
4
|
export interface IUseEditScheduledEmailProps {
|
|
@@ -87,6 +87,7 @@ export declare function useEditScheduledEmail({ scheduledExportToEdit, notificat
|
|
|
87
87
|
onApplyCurrentFilters: () => void;
|
|
88
88
|
onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[] | undefined, filtersByTabParam?: Record<string, FilterContextItem[]> | undefined) => void;
|
|
89
89
|
onFiltersByTabChange: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean | undefined) => void;
|
|
90
|
+
setParametersWire: (wire: Record<string, IDashboardExportParameter[]> | undefined) => void;
|
|
90
91
|
enableAutomationEvaluationMode: boolean;
|
|
91
92
|
};
|
|
92
93
|
//# sourceMappingURL=useEditScheduledEmail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditScheduledEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.ts"],"names":[],"mappings":"AAOA,OAAO,EAGH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"useEditScheduledEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.ts"],"names":[],"mappings":"AAOA,OAAO,EAGH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAE9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,EAU5B,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,EACH,KAAK,qBAAqB,EAG7B,MAAM,kEAAkE,CAAC;AAM1E,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAmBzF,MAAM,WAAW,2BAA2B;IACxC,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAC9F,wBAAwB,EAAE,MAAM,CAAC;IACjC,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;IAC1B,uBAAuB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9C,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACnE;;;OAGG;IACH,+BAA+B,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KAAK,IAAI,CAAC;IACzF,gBAAgB,CAAC,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IACvD,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,qCAAqC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAEnF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE,4CAA4C,CAAC,UAAU,CAAC,CAAC;CACjF;AAED,wBAAgB,qBAAqB,CAAC,EAClC,qBAAqB,EACrB,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,qCAAqC,EACxC,EAAE,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAu2B7B"}
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { invariant } from "ts-invariant";
|
|
5
|
-
import { DEFAULT_CSV_DELIMITER, insightProperties, isAutomationExternalUserRecipient, isAutomationUnknownUserRecipient, isAutomationUserRecipient, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, isWidget, } from "@gooddata/sdk-model";
|
|
6
|
-
import { areAutomationsEqual, convertCurrentUserToAutomationRecipient, convertCurrentUserToWorkspaceUser, convertExternalRecipientToAutomationRecipient, } from "../../../../../_staging/automation/index.js";
|
|
5
|
+
import { DEFAULT_CSV_DELIMITER, insightProperties, isAutomationExternalUserRecipient, isAutomationUnknownUserRecipient, isAutomationUserRecipient, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, isWidget, objRefToString, } from "@gooddata/sdk-model";
|
|
6
|
+
import { areAutomationsEqual, convertCurrentUserToAutomationRecipient, convertCurrentUserToWorkspaceUser, convertExternalRecipientToAutomationRecipient, getAutomationExportParametersByTab, setExportParametersByTab, } from "../../../../../_staging/automation/index.js";
|
|
7
7
|
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
|
|
8
8
|
import { selectEnableAutomationEvaluationMode, selectEnableExternalRecipients, selectSettings, selectTimezone, } from "../../../../../model/store/config/configSelectors.js";
|
|
9
9
|
import { selectAutomationCommonDateFilterId, selectDashboardHiddenFilters, } from "../../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
10
10
|
import { selectDashboardId, selectDashboardTitle } from "../../../../../model/store/meta/metaSelectors.js";
|
|
11
11
|
import { selectWidgetLocalIdToTabIdMap } from "../../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
12
|
+
import { selectExportEffectiveParameters } from "../../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
12
13
|
import { selectCurrentUser } from "../../../../../model/store/user/userSelectors.js";
|
|
13
14
|
import { selectUsers } from "../../../../../model/store/users/usersSelectors.js";
|
|
15
|
+
import { shouldStoreExportParameters } from "../../../shared/automationFilters/automationParameters.js";
|
|
14
16
|
import { getDefaultSelectedFiltersFromFiltersByTab } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
|
|
15
17
|
import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/automationFilters/utils.js";
|
|
16
18
|
import { toModifiedISOStringToTimezone, toNormalizedFirstRunAndCron, toNormalizedStartDate, } from "../../utils/date.js";
|
|
@@ -67,6 +69,12 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
67
69
|
}, [editedAutomationFiltersByTab, filtersDataByTab, storeFilters]);
|
|
68
70
|
const effectiveVisibleDashboardFilters = getVisibleFiltersByFilters(editedAutomationFilters ?? [], availableFiltersAsVisibleFilters, storeFilters);
|
|
69
71
|
const effectiveVisibleDashboardFiltersByTab = getVisibleFiltersByFiltersByTab(editedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, storeFilters);
|
|
72
|
+
const effectiveExportParametersByTab = useDashboardSelector(selectExportEffectiveParameters(widget ? [objRefToString(widget.ref)] : undefined));
|
|
73
|
+
// Mirrors the filters seed above, for parameters.
|
|
74
|
+
const parametersByTabForNewAutomation = shouldStoreExportParameters(isWidget, storeFilters) &&
|
|
75
|
+
Object.keys(effectiveExportParametersByTab).length > 0
|
|
76
|
+
? effectiveExportParametersByTab
|
|
77
|
+
: undefined;
|
|
70
78
|
const [editedAutomation, setEditedAutomation] = useState(scheduledExportToEdit ??
|
|
71
79
|
newAutomationMetadataObjectDefinition(isWidget
|
|
72
80
|
? {
|
|
@@ -84,6 +92,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
84
92
|
defaultPdfPageSize,
|
|
85
93
|
evaluationMode: "PER_RECIPIENT",
|
|
86
94
|
targetTabId,
|
|
95
|
+
parametersByTab: parametersByTabForNewAutomation,
|
|
87
96
|
}
|
|
88
97
|
: {
|
|
89
98
|
timezone,
|
|
@@ -98,8 +107,13 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
98
107
|
enableNewScheduledExport,
|
|
99
108
|
defaultPdfPageSize,
|
|
100
109
|
evaluationMode: "PER_RECIPIENT",
|
|
110
|
+
parametersByTab: parametersByTabForNewAutomation,
|
|
101
111
|
}));
|
|
102
112
|
const [originalAutomation] = useState(editedAutomation);
|
|
113
|
+
// The user-edit path into `content.parametersByTab`: re-encoded wire in, every export definition
|
|
114
|
+
// patched. Handed to `useAutomationExportParameters`, which owns when to call it. Definition
|
|
115
|
+
// rebuilds preserve the wire separately via `withRebuiltExportDefinitions`.
|
|
116
|
+
const setParametersWire = useCallback((wire) => setEditedAutomation((automation) => setExportParametersByTab(automation, wire)), []);
|
|
103
117
|
const selectedAttachments = useMemo(() => {
|
|
104
118
|
return (editedAutomation.exportDefinitions
|
|
105
119
|
?.map((exportDefinition) => exportDefinition.requestPayload.format)
|
|
@@ -174,10 +188,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
174
188
|
format,
|
|
175
189
|
}));
|
|
176
190
|
const updatedExportDefinitions = [...keptExportDefinitions, ...newExportDefinitions];
|
|
177
|
-
return
|
|
178
|
-
...s,
|
|
179
|
-
exportDefinitions: updatedExportDefinitions,
|
|
180
|
-
};
|
|
191
|
+
return withRebuiltExportDefinitions(s, updatedExportDefinitions);
|
|
181
192
|
});
|
|
182
193
|
};
|
|
183
194
|
const onWidgetAttachmentsChange = (formats) => {
|
|
@@ -201,10 +212,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
201
212
|
defaultPdfPageSize,
|
|
202
213
|
}));
|
|
203
214
|
const updatedExportDefinitions = [...keptExportDefinitions, ...newExportDefinitions];
|
|
204
|
-
return
|
|
205
|
-
...s,
|
|
206
|
-
exportDefinitions: updatedExportDefinitions,
|
|
207
|
-
};
|
|
215
|
+
return withRebuiltExportDefinitions(s, updatedExportDefinitions);
|
|
208
216
|
});
|
|
209
217
|
};
|
|
210
218
|
const onXlsxSettingsChange = useCallback((settings) => {
|
|
@@ -616,9 +624,21 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
616
624
|
onApplyCurrentFilters,
|
|
617
625
|
onStoreFiltersChange,
|
|
618
626
|
onFiltersByTabChange,
|
|
627
|
+
setParametersWire,
|
|
619
628
|
enableAutomationEvaluationMode,
|
|
620
629
|
};
|
|
621
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Replaces an automation's export definitions while preserving the current parameter wire. Freshly
|
|
633
|
+
* built definitions carry no `content.parametersByTab`, so without this the stored parameters would
|
|
634
|
+
* silently drop on any attachment-format change — the one place "rebuild definitions" stays paired
|
|
635
|
+
* with "keep parameters".
|
|
636
|
+
*/
|
|
637
|
+
function withRebuiltExportDefinitions(automation, exportDefinitions) {
|
|
638
|
+
const next = { ...automation, exportDefinitions };
|
|
639
|
+
const parametersByTab = getAutomationExportParametersByTab(automation);
|
|
640
|
+
return parametersByTab ? setExportParametersByTab(next, parametersByTab) : next;
|
|
641
|
+
}
|
|
622
642
|
function newDashboardExportDefinitionMetadataObjectDefinition({ dashboardId, dashboardTitle, dashboardFilters, filtersByTab, format, templateId, }) {
|
|
623
643
|
// Use filtersByTab if provided, otherwise fall back to simple filters
|
|
624
644
|
const filtersObj = filtersByTab
|
|
@@ -704,7 +724,7 @@ function newWidgetExportDefinitionMetadataObjectDefinition({ insight, widget, da
|
|
|
704
724
|
},
|
|
705
725
|
};
|
|
706
726
|
}
|
|
707
|
-
function newAutomationMetadataObjectDefinition({ timezone, dashboardId, notificationChannel, title, insight, widget, recipient, dashboardFilters, filtersByTab, widgetFilters, widgetFiltersWithInsight, visibleFiltersMetadata, visibleFiltersByTab, enableNewScheduledExport, defaultPdfPageSize, evaluationMode, targetTabId, }) {
|
|
727
|
+
function newAutomationMetadataObjectDefinition({ timezone, dashboardId, notificationChannel, title, insight, widget, recipient, dashboardFilters, filtersByTab, widgetFilters, widgetFiltersWithInsight, visibleFiltersMetadata, visibleFiltersByTab, enableNewScheduledExport, defaultPdfPageSize, evaluationMode, targetTabId, parametersByTab, }) {
|
|
708
728
|
const { firstRun, cron } = toNormalizedFirstRunAndCron(timezone);
|
|
709
729
|
const exportDefinition = widget && insight
|
|
710
730
|
? newWidgetExportDefinitionMetadataObjectDefinition({
|
|
@@ -763,5 +783,5 @@ function newAutomationMetadataObjectDefinition({ timezone, dashboardId, notifica
|
|
|
763
783
|
dashboard: dashboardId ? { id: dashboardId } : undefined,
|
|
764
784
|
...metadataObj,
|
|
765
785
|
};
|
|
766
|
-
return automation;
|
|
786
|
+
return parametersByTab ? setExportParametersByTab(automation, parametersByTab) : automation;
|
|
767
787
|
}
|