@gooddata/sdk-ui-dashboard 11.44.0-alpha.0 → 11.44.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/NOTICE +75 -75
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/kdaDialog/dialog/KdaDialog.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialog.js +2 -1
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.d.ts +2 -1
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.js +9 -6
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.d.ts +4 -2
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.js +4 -4
- package/esm/kdaDialog/dialog/hooks/useKdaDialogAccessibility.d.ts +1 -0
- package/esm/kdaDialog/dialog/hooks/useKdaDialogAccessibility.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/hooks/useKdaDialogAccessibility.js +6 -4
- package/esm/model/commandHandlers/dashboard/common/parameterHydration.js +2 -2
- package/esm/model/commands/executionResults.d.ts +18 -0
- package/esm/model/commands/executionResults.d.ts.map +1 -1
- package/esm/model/commands/executionResults.js +22 -0
- package/esm/model/react/useWidgetExecutionsHandler.d.ts.map +1 -1
- package/esm/model/react/useWidgetExecutionsHandler.js +18 -3
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts +58 -6
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.js +114 -22
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +16 -1
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersSelectors.js +51 -19
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts +27 -0
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts.map +1 -0
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.js +107 -0
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.js +16 -55
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.js +7 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.test.js +15 -0
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts +8 -0
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts.map +1 -0
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js +102 -0
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.d.ts +2 -0
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.d.ts.map +1 -0
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js +156 -0
- package/esm/presentation/automations/connectors/hooks/useCommandAsPromise.d.ts +26 -0
- package/esm/presentation/automations/connectors/hooks/useCommandAsPromise.d.ts.map +1 -0
- package/esm/presentation/automations/connectors/hooks/useCommandAsPromise.js +47 -0
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts +2 -0
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts +54 -0
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts.map +1 -0
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.js +11 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +11 -37
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +6 -5
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +7 -23
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useFiltersForDashboardScheduledExportInfo.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useFiltersForDashboardScheduledExportInfo.js +2 -7
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.js +37 -37
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleValidation.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleValidation.js +3 -4
- package/esm/presentation/automations/scheduledEmail/types.d.ts +5 -3
- package/esm/presentation/automations/scheduledEmail/types.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationDateFilter.test.js +2 -0
- package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.js +2 -2
- package/esm/presentation/dashboard/components/ToastMessages.d.ts.map +1 -1
- package/esm/presentation/dashboard/components/ToastMessages.js +3 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViewsList.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViewsList.js +3 -2
- package/esm/presentation/filterBar/parameterFilter/useParameterToastMessages.d.ts +12 -0
- package/esm/presentation/filterBar/parameterFilter/useParameterToastMessages.d.ts.map +1 -0
- package/esm/presentation/filterBar/parameterFilter/useParameterToastMessages.js +51 -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 +12 -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 +12 -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/sdk-ui-dashboard.d.ts +23 -1
- package/package.json +20 -20
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useCreateScheduledEmail.d.ts +0 -11
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useCreateScheduledEmail.d.ts.map +0 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useCreateScheduledEmail.js +0 -27
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useUpdateScheduledEmail.d.ts +0 -11
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useUpdateScheduledEmail.d.ts.map +0 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useUpdateScheduledEmail.js +0 -27
- package/esm/presentation/automations/scheduledEmail/hooks/useWidgetAutomationFilters.d.ts +0 -3
- package/esm/presentation/automations/scheduledEmail/hooks/useWidgetAutomationFilters.d.ts.map +0 -1
- package/esm/presentation/automations/scheduledEmail/hooks/useWidgetAutomationFilters.js +0 -5
- package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.d.ts +0 -2
- package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.d.ts.map +0 -1
- package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.js +0 -45
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useCallback, useRef } from "react";
|
|
3
|
+
import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
4
|
+
import { useDashboardCommandProcessing } from "../../../../model/react/useDashboardCommandProcessing.js";
|
|
5
|
+
import { sanitizeAutomationForSave } from "./sanitizeAutomationForSave.js";
|
|
6
|
+
/**
|
|
7
|
+
* Wraps a Redux dashboard command in a promise-based API using a single-slot pending ref.
|
|
8
|
+
* Sanitizes the input via sanitizeAutomationForSave before dispatching the command.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export function useCommandAsPromise({ commandCreator, successEvent, resolveWith, }) {
|
|
13
|
+
const pendingRef = useRef(null);
|
|
14
|
+
const { run } = useDashboardCommandProcessing({
|
|
15
|
+
commandCreator: (input) => commandCreator(sanitizeAutomationForSave(input)),
|
|
16
|
+
successEvent,
|
|
17
|
+
errorEvent: "GDC.DASH/EVT.COMMAND.FAILED",
|
|
18
|
+
onSuccess: (event) => {
|
|
19
|
+
if (pendingRef.current) {
|
|
20
|
+
pendingRef.current.resolve(resolveWith(event, pendingRef.current.input));
|
|
21
|
+
pendingRef.current = null;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
onError: (event) => {
|
|
25
|
+
const error = event.payload.error ?? new Error(event.payload.message);
|
|
26
|
+
pendingRef.current?.reject(error);
|
|
27
|
+
pendingRef.current = null;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return useCallback((input) => new Promise((resolve, reject) => {
|
|
31
|
+
pendingRef.current = { input, resolve, reject };
|
|
32
|
+
run(input);
|
|
33
|
+
}), [run]);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns a stable callback that deletes an automation via the backend directly (no Redux command).
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export function useDeleteAutomation() {
|
|
41
|
+
const backend = useBackendStrict();
|
|
42
|
+
const workspace = useWorkspaceStrict();
|
|
43
|
+
return useCallback(async (automation) => {
|
|
44
|
+
const automationService = backend.workspace(workspace).automations();
|
|
45
|
+
await automationService.deleteAutomation(automation.id);
|
|
46
|
+
}, [backend, workspace]);
|
|
47
|
+
}
|
|
@@ -61,6 +61,8 @@ export interface IAutomationsContextValue {
|
|
|
61
61
|
enableExternalRecipients: boolean;
|
|
62
62
|
enableAlertAttributes: boolean;
|
|
63
63
|
canManageWorkspace: boolean;
|
|
64
|
+
enableCustomizableCsvDelimiter: boolean;
|
|
65
|
+
enableAutomationEvaluationMode: boolean;
|
|
64
66
|
};
|
|
65
67
|
getCatalogAttributeByRef: (ref: ObjRef) => ICatalogAttribute | ICatalogDateAttribute | undefined;
|
|
66
68
|
getAttributeFilterDisplayForm: (displayForm: ObjRef) => IAttributeDisplayFormMetadataObject | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationsContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/AutomationsContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,qCAAqC,EACrC,qBAAqB,EACrB,iBAAiB,EACjB,mCAAmC,EACnC,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,+BAA+B,EAC/B,0BAA0B,EAC1B,8BAA8B,EAC9B,kCAAkC,EAClC,WAAW,EACX,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IACzC,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAChD,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,qBAAqB,EAAE,CAAC;IACnE,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,wBAAwB,GAAG,SAAS,CAAC;CAC7E;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,CAAC,E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IAC/B,WAAW,EAAE,KAAK,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE;QACN,mBAAmB,EAAE,OAAO,CAAC;QAC7B,0BAA0B,EAAE,OAAO,CAAC;QACpC,2BAA2B,EAAE,OAAO,CAAC;QACrC,0BAA0B,EAAE,OAAO,CAAC;QACpC,iBAAiB,EAAE,OAAO,CAAC;QAC3B,0BAA0B,EAAE,OAAO,CAAC;QACpC,wBAAwB,EAAE,OAAO,CAAC;QAClC,qBAAqB,EAAE,OAAO,CAAC;QAC/B,kBAAkB,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AutomationsContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/AutomationsContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,qCAAqC,EACrC,qBAAqB,EACrB,iBAAiB,EACjB,mCAAmC,EACnC,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,+BAA+B,EAC/B,0BAA0B,EAC1B,8BAA8B,EAC9B,kCAAkC,EAClC,WAAW,EACX,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IACzC,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAChD,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,sBAAsB,EAAE,CAAC,KAAK,EA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EAAE,qBAAqB,EAAE,CAAC;IAChD,sBAAsB,EAAE,iBAAiB,EAAE,CAAC;IAC5C,0BAA0B,EAAE,iBAAiB,EAAE,CAAC;IAChD,wBAAwB,EAAE,OAAO,CAAC;IAClC,wBAAwB,EAAE,MAAM,CAAC;IACjC,wBAAwB,EAAE,OAAO,CAAC;IAClC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,KAAK,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE;QACN,mBAAmB,EAAE,OAAO,CAAC;QAC7B,0BAA0B,EAAE,OAAO,CAAC;QACpC,2BAA2B,EAAE,OAAO,CAAC;QACrC,0BAA0B,EAAE,OAAO,CAAC;QACpC,iBAAiB,EAAE,OAAO,CAAC;QAC3B,0BAA0B,EAAE,OAAO,CAAC;QACpC,wBAAwB,EAAE,OAAO,CAAC;QAClC,qBAAqB,EAAE,OAAO,CAAC;QAC/B,kBAAkB,EAAE,OAAO,CAAC;QAC5B,8BAA8B,EAAE,OAAO,CAAC;QACxC,8BAA8B,EAAE,OAAO,CAAC;KAC3C,CAAC;IACF,wBAAwB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,iBAAiB,GAAG,qBAAqB,GAAG,SAAS,CAAC;IACjG,6BAA6B,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,mCAAmC,GAAG,SAAS,CAAC;CAC3G;AAID,eAAO,MAAM,0BAA0B,gEAA8B,CAAC;AAEtE,wBAAgB,qBAAqB,IAAI,wBAAwB,CAWhE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { DashboardAttributeFilterConfigMode, DashboardDateFilterConfigMode, FilterContextItem, IAutomationMetadataObject, IAutomationMetadataObjectDefinition, IDashboardExportParameter, IExportTemplate, IInsight, IWidget, ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
/**
|
|
3
|
+
* Sub-context for the scheduled-email create/edit dialog.
|
|
4
|
+
* Shape grows during Phase 2 migration as DefaultScheduledEmailDialog and its hooks are migrated.
|
|
5
|
+
* The connector hydrates this from dashboard state and provides the CRUD callbacks.
|
|
6
|
+
*/
|
|
7
|
+
export interface IScheduledEmailDialogContextValue {
|
|
8
|
+
widget?: IWidget;
|
|
9
|
+
insight?: IInsight;
|
|
10
|
+
widgetTitle?: string;
|
|
11
|
+
dashboardId?: string;
|
|
12
|
+
dashboardTitle: string;
|
|
13
|
+
dashboardFilters?: FilterContextItem[];
|
|
14
|
+
/**
|
|
15
|
+
* Raw dashboard hidden filters (selectDashboardHiddenFilters). Combined with edited filters via
|
|
16
|
+
* getAppliedDashboardFilters/getAppliedWidgetFilters inside the dialog, mirroring the alerting context.
|
|
17
|
+
*/
|
|
18
|
+
hiddenFilters: FilterContextItem[];
|
|
19
|
+
widgetLocalIdToTabIdMap: Record<string, string>;
|
|
20
|
+
commonDateFilterId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Effective export parameter overrides keyed by tab, scoped to the dialog's widget when present.
|
|
23
|
+
* Replaces the direct selectExportEffectiveParameters read in useEditScheduledEmail.
|
|
24
|
+
*/
|
|
25
|
+
exportParametersByTab: Record<string, IDashboardExportParameter[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Organization-level export templates fetched in the connector (replaces the useExportTemplates
|
|
28
|
+
* react hook read in the dialog).
|
|
29
|
+
*/
|
|
30
|
+
exportTemplates: IExportTemplate[];
|
|
31
|
+
/** Workspace date format (e.g. "MM/dd/yyyy"); from selectDateFormat. */
|
|
32
|
+
dateFormat: string | undefined;
|
|
33
|
+
/** Whether cross-filtering is active on the dashboard; from selectIsCrossFiltering. */
|
|
34
|
+
isCrossFiltering: boolean;
|
|
35
|
+
/** Whether the dashboard has more than one tab; derived from selectTabs. */
|
|
36
|
+
hasMultipleTabs: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Returns true when a widget with the given ref still exists on the dashboard layout.
|
|
39
|
+
* Bridges identifier↔URI mismatches the same way as selectWidgetByRef.
|
|
40
|
+
*/
|
|
41
|
+
widgetExistsByRef: (ref: ObjRef | undefined) => boolean;
|
|
42
|
+
/** Effective mode for the common (dashboard-level) date filter. */
|
|
43
|
+
commonDateFilterMode: DashboardDateFilterConfigMode;
|
|
44
|
+
/** Effective mode map for per-dataset date filters (localIdentifier → mode). */
|
|
45
|
+
dateFiltersModeMap: Map<string, DashboardDateFilterConfigMode>;
|
|
46
|
+
/** Effective mode map for attribute filters (localIdentifier → mode). */
|
|
47
|
+
attributeFiltersModeMap: Map<string, DashboardAttributeFilterConfigMode>;
|
|
48
|
+
createScheduledEmail(se: IAutomationMetadataObjectDefinition): Promise<IAutomationMetadataObject>;
|
|
49
|
+
saveScheduledEmail(se: IAutomationMetadataObject): Promise<IAutomationMetadataObject>;
|
|
50
|
+
deleteScheduledEmail(se: IAutomationMetadataObject): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export declare const ScheduledEmailDialogContextProvider: import("react").Provider<IScheduledEmailDialogContextValue | undefined>;
|
|
53
|
+
export declare function useScheduledEmailDialogContext(): IScheduledEmailDialogContextValue;
|
|
54
|
+
//# sourceMappingURL=ScheduledEmailDialogContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScheduledEmailDialogContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/ScheduledEmailDialogContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,kCAAkC,EAClC,6BAA6B,EAC7B,iBAAiB,EACjB,yBAAyB,EACzB,mCAAmC,EACnC,yBAAyB,EACzB,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACT,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAC9C,MAAM,CAA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wBAAgB,8BAA8B,IAAI,iCAAiC,CAQlF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const ScheduledEmailDialogContext = createContext(undefined);
|
|
4
|
+
export const ScheduledEmailDialogContextProvider = ScheduledEmailDialogContext.Provider;
|
|
5
|
+
export function useScheduledEmailDialogContext() {
|
|
6
|
+
const ctx = useContext(ScheduledEmailDialogContext);
|
|
7
|
+
if (!ctx) {
|
|
8
|
+
throw new Error("useScheduledEmailDialogContext must be used within ScheduledEmailDialogContextProvider");
|
|
9
|
+
}
|
|
10
|
+
return ctx;
|
|
11
|
+
}
|
|
@@ -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":"AA4CA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,aAAa,CAAC;AA8D9D,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,2CA2kB5B;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,0BAA0B,2CAW5E"}
|
|
@@ -5,20 +5,10 @@ import cx from "classnames";
|
|
|
5
5
|
import { defineMessage, useIntl } from "react-intl";
|
|
6
6
|
import { ValidationContextStore, createInvalidNode, useValidationContextValue } from "@gooddata/sdk-ui";
|
|
7
7
|
import { Button, ConfirmDialogBase, ContentDivider, Hyperlink, Message, Overlay, OverlayController, OverlayControllerProvider, RecurrenceForm, ScrollablePanel, UiIcon, UiTabs, isEnterKey, useIdPrefixed, } from "@gooddata/sdk-ui-kit";
|
|
8
|
-
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
9
|
-
import { useExportTemplates } from "../../../../model/react/useExportTemplates.js";
|
|
10
|
-
import { selectDateFormat, selectEnableAutomationManagement, selectEnableCustomizableCsvDelimiter, selectEnableNewScheduledExport, selectExternalRecipient, selectIsWhiteLabeled, selectLocale, selectSettings, selectWeekStart, } from "../../../../model/store/config/configSelectors.js";
|
|
11
|
-
import { selectIsCrossFiltering } from "../../../../model/store/drill/drillSelectors.js";
|
|
12
|
-
import { selectEntitlementMinimumRecurrenceMinutes, selectMaxAutomationRecipients, } from "../../../../model/store/entitlements/entitlementsSelectors.js";
|
|
13
|
-
import { selectDashboardTitle } from "../../../../model/store/meta/metaSelectors.js";
|
|
14
|
-
import { selectTabs } from "../../../../model/store/tabs/tabsSelectors.js";
|
|
15
|
-
import { selectIsAutomationDialogSecondaryTitleVisible } from "../../../../model/store/topBar/topBarSelectors.js";
|
|
16
|
-
import { selectExecutionTimestamp } from "../../../../model/store/ui/uiSelectors.js";
|
|
17
|
-
import { getWidgetTitle } from "../../../../model/utils/dashboardItemUtils.js";
|
|
18
8
|
import { DASHBOARD_DIALOG_OVERS_Z_INDEX } from "../../../constants/zIndex.js";
|
|
19
9
|
import { IntlWrapper } from "../../../localization/IntlWrapper.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
10
|
+
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
11
|
+
import { useScheduledEmailDialogContext } from "../../contexts/ScheduledEmailDialogContext.js";
|
|
22
12
|
import { ApplyCurrentFiltersConfirmDialog } from "../../shared/automationFilters/components/ApplyLatestFiltersConfirmDialog.js";
|
|
23
13
|
import { AutomationFiltersSelect } from "../../shared/automationFilters/components/AutomationFiltersSelect.js";
|
|
24
14
|
import { useValidateExistingAutomationFilters } from "../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
|
|
@@ -42,7 +32,6 @@ import { SCHEDULED_EMAIL_DIALOG_ID } from "./constants.js";
|
|
|
42
32
|
import { DefaultLoadingScheduledEmailDialog } from "./DefaultLoadingScheduledEmailDialog.js";
|
|
43
33
|
import { useEditScheduledEmail } from "./hooks/useEditScheduledEmail.js";
|
|
44
34
|
import { useSaveScheduledEmailToBackend } from "./hooks/useSaveScheduledEmailToBackend.js";
|
|
45
|
-
const DEFAULT_MIN_RECURRENCE_MINUTES = "60";
|
|
46
35
|
const OVERLAY_POSITION_TYPE = "sameAsTarget";
|
|
47
36
|
const CLOSE_ON_PARENT_SCROLL = true;
|
|
48
37
|
const overlayController = OverlayController.getInstance(DASHBOARD_DIALOG_OVERS_Z_INDEX);
|
|
@@ -58,13 +47,8 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
58
47
|
const [scheduledEmailToDelete, setScheduledEmailToDelete] = useState(null);
|
|
59
48
|
const [selectedTabId, setSelectedTabId] = useState("general");
|
|
60
49
|
const [tabContentHeight, setTabContentHeight] = useState(undefined);
|
|
61
|
-
const isWhiteLabeled =
|
|
62
|
-
const
|
|
63
|
-
const isSecondaryTitleVisible = useDashboardSelector(selectIsAutomationDialogSecondaryTitleVisible);
|
|
64
|
-
const enableAutomationManagement = useDashboardSelector(selectEnableAutomationManagement);
|
|
65
|
-
const dashboardTabs = useDashboardSelector(selectTabs);
|
|
66
|
-
const hasMultipleTabs = (dashboardTabs?.length ?? 0) > 1;
|
|
67
|
-
const exportTemplates = useExportTemplates();
|
|
50
|
+
const { isWhiteLabeled, externalRecipient: externalRecipientOverride, isSecondaryTitleVisible, features: { enableAutomationManagement }, } = useAutomationsContext();
|
|
51
|
+
const { exportTemplates, widgetTitle, hasMultipleTabs } = useScheduledEmailDialogContext();
|
|
68
52
|
const handleScheduleDeleteSuccess = () => {
|
|
69
53
|
onDeleteSuccess?.();
|
|
70
54
|
setScheduledEmailToDelete(null);
|
|
@@ -80,6 +64,7 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
80
64
|
notificationChannels,
|
|
81
65
|
insight,
|
|
82
66
|
widget,
|
|
67
|
+
users,
|
|
83
68
|
scheduledExportToEdit,
|
|
84
69
|
storeFilters,
|
|
85
70
|
editedAutomationFilters,
|
|
@@ -142,7 +127,7 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
142
127
|
const { secondaryTitle, secondaryTitleIcon } = useMemo(() => {
|
|
143
128
|
if (widget) {
|
|
144
129
|
return {
|
|
145
|
-
secondaryTitle:
|
|
130
|
+
secondaryTitle: widgetTitle,
|
|
146
131
|
secondaryTitleIcon: (_jsx(UiIcon, { type: "visualization", size: 16, color: "complementary-6", accessibilityConfig: {
|
|
147
132
|
ariaLabel: intl.formatMessage({
|
|
148
133
|
id: "dialogs.automation.icon.ariaLabel.sourceVisualization",
|
|
@@ -158,7 +143,7 @@ export function ScheduledMailDialogRenderer({ scheduledExportToEdit, users, user
|
|
|
158
143
|
}),
|
|
159
144
|
} })),
|
|
160
145
|
};
|
|
161
|
-
}, [widget, dashboardTitle, intl]);
|
|
146
|
+
}, [widget, widgetTitle, dashboardTitle, intl]);
|
|
162
147
|
const tabs = useMemo(() => [
|
|
163
148
|
{
|
|
164
149
|
id: "general",
|
|
@@ -251,24 +236,13 @@ export function DefaultScheduledEmailDialog(props) {
|
|
|
251
236
|
return _jsx(DefaultScheduledEmailDialogBody, { ...props });
|
|
252
237
|
}
|
|
253
238
|
function DefaultScheduledEmailDialogBody(props) {
|
|
254
|
-
const locale =
|
|
255
|
-
|
|
256
|
-
return (_jsx(AutomationsContextProvider, { value: automationsContext, children: _jsx(IntlWrapper, { locale: locale, children: _jsx(ScheduledMailDialogRenderer, { ...props }) }) }));
|
|
239
|
+
const { locale } = useAutomationsContext();
|
|
240
|
+
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(ScheduledMailDialogRenderer, { ...props }) }));
|
|
257
241
|
}
|
|
258
242
|
function useDefaultScheduledEmailDialogData() {
|
|
259
|
-
const locale =
|
|
260
|
-
const dashboardTitle =
|
|
261
|
-
const dateFormat = useDashboardSelector(selectDateFormat);
|
|
262
|
-
const settings = useDashboardSelector(selectSettings);
|
|
243
|
+
const { locale, settings, weekStart, maxAutomationsRecipients, allowHourlyRecurrence, isExecutionTimestampMode, enableNewScheduledExport, features: { enableCustomizableCsvDelimiter }, } = useAutomationsContext();
|
|
244
|
+
const { dashboardTitle, dateFormat, isCrossFiltering } = useScheduledEmailDialogContext();
|
|
263
245
|
const formatLocale = settings?.formatLocale;
|
|
264
|
-
const weekStart = useDashboardSelector(selectWeekStart);
|
|
265
|
-
const maxAutomationsRecipients = useDashboardSelector(selectMaxAutomationRecipients);
|
|
266
|
-
const minimumRecurrenceMinutesEntitlement = useDashboardSelector(selectEntitlementMinimumRecurrenceMinutes);
|
|
267
|
-
const allowHourlyRecurrence = parseInt(minimumRecurrenceMinutesEntitlement?.value ?? DEFAULT_MIN_RECURRENCE_MINUTES, 10) === 60;
|
|
268
|
-
const isCrossFiltering = useDashboardSelector(selectIsCrossFiltering);
|
|
269
|
-
const isExecutionTimestampMode = !!useDashboardSelector(selectExecutionTimestamp);
|
|
270
|
-
const enableNewScheduledExport = useDashboardSelector(selectEnableNewScheduledExport);
|
|
271
|
-
const enableCustomizableCsvDelimiter = useDashboardSelector(selectEnableCustomizableCsvDelimiter);
|
|
272
246
|
const defaultPdfPageSize = getDefaultPdfPageSize(formatLocale);
|
|
273
247
|
return {
|
|
274
248
|
locale,
|
|
@@ -1,11 +1,12 @@
|
|
|
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";
|
|
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 IWidget, type IWorkspaceUser, type WidgetAttachmentType } from "@gooddata/sdk-model";
|
|
2
2
|
import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
|
|
3
|
-
import { type ExtendedDashboardWidget } from "../../../../../model/types/layoutTypes.js";
|
|
4
3
|
export interface IUseEditScheduledEmailProps {
|
|
5
4
|
scheduledExportToEdit?: IAutomationMetadataObject;
|
|
6
5
|
notificationChannels: INotificationChannelIdentifier[] | INotificationChannelMetadataObject[];
|
|
7
6
|
maxAutomationsRecipients: number;
|
|
8
|
-
|
|
7
|
+
/** Workspace users, lazy-loaded in the connector and passed via dialog props. */
|
|
8
|
+
users: IWorkspaceUser[];
|
|
9
|
+
widget?: IWidget;
|
|
9
10
|
insight?: IInsight;
|
|
10
11
|
widgetFilters?: IFilter[];
|
|
11
12
|
editedAutomationFilters?: FilterContextItem[];
|
|
@@ -31,8 +32,8 @@ export interface IUseEditScheduledEmailProps {
|
|
|
31
32
|
enableNewScheduledExport: boolean;
|
|
32
33
|
defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
|
|
33
34
|
}
|
|
34
|
-
export declare function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, enableNewScheduledExport, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab }: IUseEditScheduledEmailProps): {
|
|
35
|
-
defaultUser:
|
|
35
|
+
export declare function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, users, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, enableNewScheduledExport, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab }: IUseEditScheduledEmailProps): {
|
|
36
|
+
defaultUser: IWorkspaceUser;
|
|
36
37
|
areDashboardFiltersChanged: boolean;
|
|
37
38
|
originalAutomation: IAutomationMetadataObjectDefinition;
|
|
38
39
|
editedAutomation: IAutomationMetadataObjectDefinition;
|
|
@@ -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,EAC7B,KAAK,yBAAyB,EAE9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,
|
|
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,EAC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,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,KAAK,EACL,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA42B7B"}
|
|
@@ -2,16 +2,10 @@
|
|
|
2
2
|
import { useCallback, useMemo, useRef, 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,
|
|
5
|
+
import { DEFAULT_CSV_DELIMITER, insightProperties, isAutomationExternalUserRecipient, isAutomationUnknownUserRecipient, isAutomationUserRecipient, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, } from "@gooddata/sdk-model";
|
|
6
6
|
import { getAutomationExportParametersByTab, setExportParametersByTab, } from "../../../../../_staging/automation/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { selectAutomationCommonDateFilterId, selectDashboardHiddenFilters, } from "../../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
10
|
-
import { selectDashboardId, selectDashboardTitle } from "../../../../../model/store/meta/metaSelectors.js";
|
|
11
|
-
import { selectWidgetLocalIdToTabIdMap } from "../../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
12
|
-
import { selectExportEffectiveParameters } from "../../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
13
|
-
import { selectCurrentUser } from "../../../../../model/store/user/userSelectors.js";
|
|
14
|
-
import { selectUsers } from "../../../../../model/store/users/usersSelectors.js";
|
|
7
|
+
import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
|
|
8
|
+
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
15
9
|
import { shouldStoreExportParameters } from "../../../shared/automationFilters/automationParameters.js";
|
|
16
10
|
import { getDefaultSelectedFiltersFromFiltersByTab } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
|
|
17
11
|
import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/automationFilters/utils.js";
|
|
@@ -20,32 +14,23 @@ import { toModifiedISOStringToTimezone, toNormalizedFirstRunAndCron, toNormalize
|
|
|
20
14
|
import { getUserTimezone } from "../../utils/timezone.js";
|
|
21
15
|
import { isEmail } from "../../utils/validate.js";
|
|
22
16
|
import { useScheduleValidation } from "./useScheduleValidation.js";
|
|
23
|
-
export function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, enableNewScheduledExport, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab, }) {
|
|
17
|
+
export function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, users, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, enableNewScheduledExport, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab, }) {
|
|
24
18
|
const intl = useIntl();
|
|
19
|
+
const { settings, timezone, currentUser, features: { enableExternalRecipients: enabledExternalRecipients, enableAutomationEvaluationMode }, } = useAutomationsContext();
|
|
20
|
+
const { dashboardId, dashboardTitle, hiddenFilters: dashboardHiddenFilters, commonDateFilterId, widgetLocalIdToTabIdMap: widgetTabMap, exportParametersByTab: effectiveExportParametersByTab, } = useScheduledEmailDialogContext();
|
|
25
21
|
const [isCronValid, setIsCronValid] = useState(true);
|
|
26
22
|
const [isTitleValid, setIsTitleValid] = useState(true);
|
|
27
23
|
const [isSubjectValid, setIsSubjectValid] = useState(true);
|
|
28
24
|
const [isOnMessageValid, setIsOnMessageValid] = useState(true);
|
|
29
25
|
const isWidget = !!widget && !!insight;
|
|
30
26
|
// Dashboard
|
|
31
|
-
const dashboardId = useDashboardSelector(selectDashboardId);
|
|
32
|
-
const dashboardTitle = useDashboardSelector(selectDashboardTitle);
|
|
33
|
-
const settings = useDashboardSelector(selectSettings);
|
|
34
|
-
const timezone = useDashboardSelector(selectTimezone);
|
|
35
27
|
const resolvedDefaultCsvDelimiter = settings?.exportCsvCustomDelimiter ?? DEFAULT_CSV_DELIMITER;
|
|
36
28
|
const areDashboardFiltersChanged = !!dashboardFilters;
|
|
37
|
-
const currentUser = useDashboardSelector(selectCurrentUser);
|
|
38
|
-
const users = useDashboardSelector(selectUsers);
|
|
39
29
|
const defaultUser = convertCurrentUserToWorkspaceUser(users ?? [], currentUser);
|
|
40
30
|
const defaultRecipient = externalRecipientOverride
|
|
41
31
|
? convertExternalRecipientToAutomationRecipient(externalRecipientOverride)
|
|
42
32
|
: convertCurrentUserToAutomationRecipient(users ?? [], currentUser);
|
|
43
|
-
const enabledExternalRecipients = useDashboardSelector(selectEnableExternalRecipients);
|
|
44
|
-
const enableAutomationEvaluationMode = useDashboardSelector(selectEnableAutomationEvaluationMode);
|
|
45
33
|
const firstChannel = notificationChannels[0]?.id;
|
|
46
|
-
const dashboardHiddenFilters = useDashboardSelector(selectDashboardHiddenFilters);
|
|
47
|
-
const commonDateFilterId = useDashboardSelector(selectAutomationCommonDateFilterId);
|
|
48
|
-
const widgetTabMap = useDashboardSelector(selectWidgetLocalIdToTabIdMap);
|
|
49
34
|
// Determine target tab ID if widget is present
|
|
50
35
|
const targetTabId = widget?.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
|
|
51
36
|
const effectiveWidgetFilters = getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, false);
|
|
@@ -70,7 +55,6 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
70
55
|
}, [editedAutomationFiltersByTab, filtersDataByTab, storeFilters]);
|
|
71
56
|
const effectiveVisibleDashboardFilters = getVisibleFiltersByFilters(editedAutomationFilters ?? [], availableFiltersAsVisibleFilters, storeFilters);
|
|
72
57
|
const effectiveVisibleDashboardFiltersByTab = getVisibleFiltersByFiltersByTab(editedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, storeFilters);
|
|
73
|
-
const effectiveExportParametersByTab = useDashboardSelector(selectExportEffectiveParameters(widget ? [objRefToString(widget.ref)] : undefined));
|
|
74
58
|
// Mirrors the filters seed above, for parameters.
|
|
75
59
|
const parametersByTabForNewAutomation = shouldStoreExportParameters(isWidget, storeFilters) &&
|
|
76
60
|
Object.keys(effectiveExportParametersByTab).length > 0
|
|
@@ -670,7 +654,7 @@ function newDashboardExportDefinitionMetadataObjectDefinition({ dashboardId, das
|
|
|
670
654
|
};
|
|
671
655
|
}
|
|
672
656
|
function newWidgetExportDefinitionMetadataObjectDefinition({ insight, widget, dashboardId, format, widgetFilters, widgetFiltersWithInsight, dashboardFilters, enableNewScheduledExport, defaultPdfPageSize, defaultCsvDelimiter, }) {
|
|
673
|
-
const widgetTitle =
|
|
657
|
+
const widgetTitle = widget.title;
|
|
674
658
|
// Determine which filters to use based on format:
|
|
675
659
|
// - CSV: Use widgetFiltersWithInsight (insight filters merged on frontend)
|
|
676
660
|
// - CSV_RAW: Use widgetFilters (insight filters merged on backend)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFiltersForDashboardScheduledExportInfo.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useFiltersForDashboardScheduledExportInfo.ts"],"names":[],"mappings":"AAIA,OAAO,EAKH,KAAK,iBAAiB,EAKzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"useFiltersForDashboardScheduledExportInfo.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useFiltersForDashboardScheduledExportInfo.ts"],"names":[],"mappings":"AAIA,OAAO,EAKH,KAAK,iBAAiB,EAKzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAKjE,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC1C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAED,UAAU,+CAA+C;IACrD;;OAEG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC1C;AAED,eAAO,MAAM,yCAAyC,iJAcrD,CAAC"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
2
|
import { compact } from "lodash-es";
|
|
3
3
|
import { DashboardAttributeFilterConfigModeValues, DashboardDateFilterConfigModeValues, dashboardAttributeFilterItemLocalIdentifier, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, } from "@gooddata/sdk-model";
|
|
4
|
-
import {
|
|
5
|
-
import { selectEffectiveAttributeFiltersModeMap } from "../../../../../model/store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
|
|
6
|
-
import { selectEffectiveDateFilterMode } from "../../../../../model/store/tabs/dateFilterConfig/dateFilterConfigSelectors.js";
|
|
7
|
-
import { selectEffectiveDateFiltersModeMap } from "../../../../../model/store/tabs/dateFilterConfigs/dateFilterConfigsSelectors.js";
|
|
4
|
+
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
8
5
|
import { useFiltersNamings } from "../../../shared/hooks/useFiltersNamings.js";
|
|
9
6
|
export const useFiltersForDashboardScheduledExportInfo = ({ effectiveFilters = [], }) => {
|
|
10
7
|
// Remove hidden dashboard filters, we don't want to display them.
|
|
11
|
-
const commonDateFilterMode =
|
|
12
|
-
const dateFiltersModeMap = useDashboardSelector(selectEffectiveDateFiltersModeMap);
|
|
13
|
-
const attributeFiltersModeMap = useDashboardSelector(selectEffectiveAttributeFiltersModeMap);
|
|
8
|
+
const { commonDateFilterMode, dateFiltersModeMap, attributeFiltersModeMap } = useScheduledEmailDialogContext();
|
|
14
9
|
const filtersToDisplay = removeHiddenFilters(effectiveFilters, commonDateFilterMode, dateFiltersModeMap, attributeFiltersModeMap);
|
|
15
10
|
return compact(useFiltersNamings(filtersToDisplay));
|
|
16
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSaveScheduledEmailToBackend.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EAO3C,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useSaveScheduledEmailToBackend.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EAO3C,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,wBAAgB,8BAA8B,CAC1C,UAAU,EAAE,yBAAyB,GAAG,mCAAmC,EAC3E,EACI,SAAS,EACT,OAAO,EACP,QAAQ,EACR,aAAa,EACb,WAAW,EACX,MAAM,EACT,EAAE,IAAI,CACH,0BAA0B,EAC1B,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,GAAG,aAAa,GAAG,QAAQ,CACpF;;;;EAwEJ"}
|
|
@@ -3,16 +3,22 @@ import { useCallback, useState } from "react";
|
|
|
3
3
|
import { omit } from "lodash-es";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { isAllValuesAttributeFilter, isAllValuesDashboardAttributeFilter, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, } from "@gooddata/sdk-model";
|
|
6
|
-
import {
|
|
7
|
-
import { useUpdateScheduledEmail } from "./useUpdateScheduledEmail.js";
|
|
6
|
+
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
8
7
|
export function useSaveScheduledEmailToBackend(automation, { onSuccess, onError, onSubmit, onSaveSuccess, onSaveError, onSave, }) {
|
|
9
8
|
const intl = useIntl();
|
|
10
9
|
const [savingErrorMessage, setSavingErrorMessage] = useState(undefined);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const [isSavingScheduledEmail, setIsSavingScheduledEmail] = useState(false);
|
|
11
|
+
const { createScheduledEmail, saveScheduledEmail } = useScheduledEmailDialogContext();
|
|
12
|
+
const handleCreateScheduledEmail = useCallback(async (scheduledEmail) => {
|
|
13
|
+
const sanitizedAutomation = sanitizeAutomation(scheduledEmail, intl);
|
|
14
|
+
setSavingErrorMessage(undefined);
|
|
15
|
+
onSubmit?.(sanitizedAutomation);
|
|
16
|
+
setIsSavingScheduledEmail(true);
|
|
17
|
+
try {
|
|
18
|
+
const created = await createScheduledEmail(sanitizedAutomation);
|
|
19
|
+
onSuccess?.(created);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
16
22
|
/**
|
|
17
23
|
* Handle 400 error separately as it contains a detailed error message
|
|
18
24
|
* to be shown in the dialog without closing it
|
|
@@ -23,19 +29,21 @@ export function useSaveScheduledEmailToBackend(automation, { onSuccess, onError,
|
|
|
23
29
|
else {
|
|
24
30
|
onError?.(error);
|
|
25
31
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const handleCreateScheduledEmail = useCallback((scheduledEmail) => {
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
setIsSavingScheduledEmail(false);
|
|
35
|
+
}
|
|
36
|
+
}, [createScheduledEmail, intl, onSubmit, onSuccess, onError]);
|
|
37
|
+
const handleUpdateScheduledEmail = useCallback(async (scheduledEmail) => {
|
|
33
38
|
const sanitizedAutomation = sanitizeAutomation(scheduledEmail, intl);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
setSavingErrorMessage(undefined);
|
|
40
|
+
onSave?.(sanitizedAutomation);
|
|
41
|
+
setIsSavingScheduledEmail(true);
|
|
42
|
+
try {
|
|
43
|
+
await saveScheduledEmail(sanitizedAutomation);
|
|
44
|
+
onSaveSuccess?.();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
39
47
|
/**
|
|
40
48
|
* Handle 400 error separately as it contains a detailed error message
|
|
41
49
|
* to be shown in the dialog without closing it
|
|
@@ -46,27 +54,19 @@ export function useSaveScheduledEmailToBackend(automation, { onSuccess, onError,
|
|
|
46
54
|
else {
|
|
47
55
|
onSaveError?.(error);
|
|
48
56
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
scheduledEmailUpdater.save(sanitizedAutomation);
|
|
58
|
-
}, [scheduledEmailUpdater, intl]);
|
|
59
|
-
const handleSaveScheduledEmail = () => {
|
|
60
|
-
const sanitizedAutomation = sanitizeAutomation(automation, intl);
|
|
61
|
-
if (sanitizedAutomation.id) {
|
|
62
|
-
handleUpdateScheduledEmail(sanitizedAutomation);
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
setIsSavingScheduledEmail(false);
|
|
60
|
+
}
|
|
61
|
+
}, [saveScheduledEmail, intl, onSave, onSaveSuccess, onSaveError]);
|
|
62
|
+
const handleSaveScheduledEmail = useCallback(() => {
|
|
63
|
+
if (automation.id) {
|
|
64
|
+
void handleUpdateScheduledEmail(automation);
|
|
63
65
|
}
|
|
64
66
|
else {
|
|
65
|
-
handleCreateScheduledEmail(
|
|
67
|
+
void handleCreateScheduledEmail(automation);
|
|
66
68
|
}
|
|
67
|
-
};
|
|
68
|
-
const isSavingScheduledEmail = scheduledEmailCreator.creationStatus === "running" ||
|
|
69
|
-
scheduledEmailUpdater.savingStatus === "running";
|
|
69
|
+
}, [automation, handleUpdateScheduledEmail, handleCreateScheduledEmail]);
|
|
70
70
|
return { handleSaveScheduledEmail, isSavingScheduledEmail, savingErrorMessage };
|
|
71
71
|
}
|
|
72
72
|
function sanitizeAutomation(automationToSave, intl) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduleValidation.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleValidation.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,mCAAmC,EAI3C,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useScheduleValidation.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleValidation.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,mCAAmC,EAI3C,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,qBAAqB;;CAsBjC,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
2
|
import { isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, } from "@gooddata/sdk-model";
|
|
3
|
-
import {
|
|
4
|
-
import { selectWidgetByRef } from "../../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
3
|
+
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
5
4
|
export const useScheduleValidation = (schedule) => {
|
|
5
|
+
const { widgetExistsByRef } = useScheduledEmailDialogContext();
|
|
6
6
|
const isDashboardSchedule = schedule.exportDefinitions?.some((exportDefinition) => isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload));
|
|
7
7
|
const widgetLocalId = schedule.exportDefinitions?.find((exportDefinition) => isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload))?.requestPayload.content?.widget;
|
|
8
8
|
const widgetRef = widgetLocalId ? { identifier: widgetLocalId } : undefined;
|
|
9
|
-
const widget = useDashboardSelector(selectWidgetByRef(widgetRef));
|
|
10
9
|
// Schedules created via API may not reference any widget — that's acceptable.
|
|
11
10
|
// We only flag an error when a widget was explicitly referenced but no longer exists on the dashboard.
|
|
12
|
-
const hasUnresolvableWidgetRef = !!widgetRef && !
|
|
11
|
+
const hasUnresolvableWidgetRef = !!widgetRef && !widgetExistsByRef(widgetRef);
|
|
13
12
|
const isValid = isDashboardSchedule || !hasUnresolvableWidgetRef;
|
|
14
13
|
return {
|
|
15
14
|
isValid,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ComponentType } from "react";
|
|
2
|
-
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWorkspaceUser } from "@gooddata/sdk-model";
|
|
2
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget, type IWorkspaceUser } from "@gooddata/sdk-model";
|
|
3
3
|
import { type GoodDataSdkError } from "@gooddata/sdk-ui";
|
|
4
|
-
import { type ExtendedDashboardWidget } from "../../../model/types/layoutTypes.js";
|
|
5
4
|
/**
|
|
6
5
|
* @alpha
|
|
7
6
|
*/
|
|
@@ -26,8 +25,11 @@ export interface IScheduledEmailDialogProps {
|
|
|
26
25
|
* Widget to be used for scheduled email.
|
|
27
26
|
*
|
|
28
27
|
* Note: this is available only when scheduling export for widget, not dashboard.
|
|
28
|
+
* Typed as IWidget (not ExtendedDashboardWidget) because the dialog only
|
|
29
|
+
* supports insight widgets; custom widgets and nested layouts are not valid
|
|
30
|
+
* export targets and were silently discarded at the connector boundary anyway.
|
|
29
31
|
*/
|
|
30
|
-
widget?:
|
|
32
|
+
widget?: IWidget;
|
|
31
33
|
/**
|
|
32
34
|
* Insight to be used for scheduled email.
|
|
33
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/scheduledEmail/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,cAAc,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/scheduledEmail/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAMzD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;OAEG;IACH,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAElD;;OAEG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B;;OAEG;IACH,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAE9F;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEvC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;O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,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACrD;AAMD;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,aAAa,CAAC,0BAA0B,CAAC,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,6CAA6C,GACrD,aAAa,CAAC,oCAAoC,CAAC,CAAC"}
|
|
@@ -70,6 +70,8 @@ function createAutomationsContextValue(overrides) {
|
|
|
70
70
|
enableExternalRecipients: false,
|
|
71
71
|
enableAlertAttributes: false,
|
|
72
72
|
canManageWorkspace: false,
|
|
73
|
+
enableCustomizableCsvDelimiter: false,
|
|
74
|
+
enableAutomationEvaluationMode: false,
|
|
73
75
|
},
|
|
74
76
|
getCatalogAttributeByRef: () => undefined,
|
|
75
77
|
getAttributeFilterDisplayForm: () => undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardHeader.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardHeader/DashboardHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardHeader.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardHeader/DashboardHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAqE1C,wBAAgB,oBAAoB,4CAGnC;AAID,wBAAgB,eAAe,IAAI,YAAY,CAyB9C"}
|