@gooddata/sdk-ui-dashboard 11.54.0-alpha.6 → 11.54.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +25 -111
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSubmit.d.ts +19 -14
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSubmit.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSubmit.js +18 -2
- package/esm/presentation/automations/alerting/state/AlertActionsContext.d.ts +1 -10
- package/esm/presentation/automations/alerting/state/AlertActionsContext.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/AlertDataContext.d.ts +1 -11
- package/esm/presentation/automations/alerting/state/AlertDataContext.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/AlertDraftContext.d.ts +1 -11
- package/esm/presentation/automations/alerting/state/AlertDraftContext.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/AlertFiltersContext.d.ts +1 -13
- package/esm/presentation/automations/alerting/state/AlertFiltersContext.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/AlertingDialogStateProvider.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/types.d.ts +156 -0
- package/esm/presentation/automations/alerting/state/types.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/state/types.js +2 -0
- package/esm/presentation/automations/alerting/state/useAlertFiltersModel.d.ts +2 -8
- package/esm/presentation/automations/alerting/state/useAlertFiltersModel.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/useAlertFormState.d.ts +4 -34
- package/esm/presentation/automations/alerting/state/useAlertFormState.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/useAlertSupportedMetrics.d.ts +2 -11
- package/esm/presentation/automations/alerting/state/useAlertSupportedMetrics.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/useAlertSupportedMetrics.js +2 -2
- package/esm/presentation/automations/alerting/state/useAlertingDialogRegionProps.d.ts +82 -0
- package/esm/presentation/automations/alerting/state/useAlertingDialogRegionProps.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/state/useAlertingDialogRegionProps.js +152 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +34 -145
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.d.ts +17 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.js +16 -5
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleTimezone.d.ts +2 -29
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleTimezone.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleTimezone.js +0 -14
- package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.js +3 -3
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportActionsContext.d.ts +1 -16
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportActionsContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDataContext.d.ts +1 -12
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDataContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.d.ts +1 -15
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportFiltersContext.d.ts +2 -14
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportFiltersContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/types.d.ts +204 -0
- package/esm/presentation/automations/scheduledEmail/state/types.d.ts.map +1 -0
- package/esm/presentation/automations/scheduledEmail/state/types.js +2 -0
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDialogRegionProps.d.ts +105 -0
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDialogRegionProps.d.ts.map +1 -0
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDialogRegionProps.js +196 -0
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailExportSettings.d.ts +3 -11
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailExportSettings.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFiltersModel.d.ts +2 -20
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFiltersModel.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFiltersModel.js +1 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFormState.d.ts +3 -20
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFormState.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +0 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +0 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +0 -1
- package/package.json +25 -25
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationVisibleFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IMeasureFormatMap } from "../DefaultAlertingDialog/utils/getters.js";
|
|
3
|
-
import { type AlertAttribute, type AlertMetric
|
|
3
|
+
import { type AlertAttribute, type AlertMetric } from "../types.js";
|
|
4
|
+
import { type IAlertFormState } from "./types.js";
|
|
4
5
|
/**
|
|
5
6
|
* Props for {@link useAlertFormState}.
|
|
6
7
|
* @internal
|
|
@@ -28,36 +29,5 @@ export interface IUseAlertFormStateProps {
|
|
|
28
29
|
*
|
|
29
30
|
* @internal
|
|
30
31
|
*/
|
|
31
|
-
export declare function useAlertFormState({ alertToEdit, insight, widget, notificationChannels, editedAutomationFilters, availableFiltersAsVisibleFilters, externalRecipientOverride, supportedMeasures, supportedAttributes, measureFormatMap }: IUseAlertFormStateProps):
|
|
32
|
-
editedAutomation: IAutomationMetadataObjectDefinition | undefined;
|
|
33
|
-
setEditedAutomation: import("react").Dispatch<import("react").SetStateAction<IAutomationMetadataObjectDefinition | undefined>>;
|
|
34
|
-
originalAutomation: IAutomationMetadataObjectDefinition | undefined;
|
|
35
|
-
defaultUser: IAutomationRecipient;
|
|
36
|
-
defaultRecipient: IAutomationRecipient;
|
|
37
|
-
automationParameters: import("../../shared/automationFilters/automationParameters.js").IAutomationParameter[];
|
|
38
|
-
availableParameters: import("../../shared/automationFilters/automationParameters.js").IAutomationParameter[];
|
|
39
|
-
onParameterChange: (ref: import("@gooddata/sdk-model").IdentifierRef, value: string | number) => void;
|
|
40
|
-
onParameterDelete: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
41
|
-
onParameterAdd: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
42
|
-
dropStaleParameters: () => void;
|
|
43
|
-
onTitleChange: (value: string) => void;
|
|
44
|
-
onMeasureChange: (measure: AlertMetric) => void;
|
|
45
|
-
onAttributeChange: (attribute: AlertAttribute | undefined, value: {
|
|
46
|
-
title: string;
|
|
47
|
-
value: string;
|
|
48
|
-
name: string;
|
|
49
|
-
} | undefined) => void;
|
|
50
|
-
onComparisonOperatorChange: (measure: AlertMetric, comparisonOperator: IAlertComparisonOperator) => void;
|
|
51
|
-
onRelativeOperatorChange: (measure: AlertMetric, relativeOperator: IAlertRelativeOperator, arithmeticOperator: IAlertRelativeArithmeticOperator) => void;
|
|
52
|
-
onAnomalyDetectionChange: (measure: AlertMetric) => void;
|
|
53
|
-
onComparisonTypeChange: (measure: AlertMetric | undefined, relativeOperator: [IAlertRelativeOperator, IAlertRelativeArithmeticOperator] | undefined, comparisonType: AlertMetricComparatorType, granularity?: DateAttributeGranularity | undefined) => void;
|
|
54
|
-
onSensitivityChange: (sensitivity: IAlertAnomalyDetectionSensitivity) => void;
|
|
55
|
-
onTriggerIntervalChange: (triggerInterval: IAlertTriggerInterval, dirty?: boolean) => void;
|
|
56
|
-
onGranularityChange: (measure: AlertMetric | undefined, granularity: IAlertAnomalyDetectionGranularity) => void;
|
|
57
|
-
onDestinationChange: (destinationId: string) => void;
|
|
58
|
-
onTriggerModeChange: (triggerMode: IAlertTriggerMode) => void;
|
|
59
|
-
onRecipientsChange: (updatedRecipients: IAutomationRecipient[]) => void;
|
|
60
|
-
warningMessage: string | undefined;
|
|
61
|
-
isTitleValid: boolean;
|
|
62
|
-
};
|
|
32
|
+
export declare function useAlertFormState({ alertToEdit, insight, widget, notificationChannels, editedAutomationFilters, availableFiltersAsVisibleFilters, externalRecipientOverride, supportedMeasures, supportedAttributes, measureFormatMap }: IUseAlertFormStateProps): IAlertFormState;
|
|
63
33
|
//# sourceMappingURL=useAlertFormState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAlertFormState.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/state/useAlertFormState.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"useAlertFormState.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/state/useAlertFormState.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,KAAK,iBAAiB,EAQtB,KAAK,yBAAyB,EAG9B,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EAEb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACf,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAWnF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAkC,MAAM,aAAa,CAAC;AAEpG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAC9F,uBAAuB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9C,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,iBAAiB,EAAE,WAAW,EAAE,CAAC;IACjC,mBAAmB,EAAE,cAAc,EAAE,CAAC;IACtC,gBAAgB,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,EAC9B,WAAW,EACX,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,uBAAuB,EACvB,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACnB,EAAE,uBAAuB,GAAG,eAAe,CA6Z3C"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type IAutomationMetadataObject, type IInsight, type IWidget } from "@gooddata/sdk-model";
|
|
2
|
-
import {
|
|
3
|
-
import { type IMeasureFormatMap } from "../DefaultAlertingDialog/utils/getters.js";
|
|
4
|
-
import { type AlertAttribute, type AlertMetric } from "../types.js";
|
|
2
|
+
import { type IAlertSupportedMetrics } from "./types.js";
|
|
5
3
|
export interface IUseAlertSupportedMetricsProps {
|
|
6
4
|
insight?: IInsight;
|
|
7
5
|
widget?: IWidget;
|
|
@@ -17,12 +15,5 @@ export interface IUseAlertSupportedMetricsProps {
|
|
|
17
15
|
*
|
|
18
16
|
* @internal
|
|
19
17
|
*/
|
|
20
|
-
export declare function useAlertSupportedMetrics({ insight, widget, alertToEdit }: IUseAlertSupportedMetricsProps):
|
|
21
|
-
measureFormatMap: IMeasureFormatMap;
|
|
22
|
-
supportedMeasures: AlertMetric[];
|
|
23
|
-
supportedAttributes: AlertAttribute[];
|
|
24
|
-
isResultLoading: boolean;
|
|
25
|
-
getAttributeValues: ReturnType<typeof useAttributeValuesFromExecResults>["getAttributeValues"];
|
|
26
|
-
getMetricValue: ReturnType<typeof useAttributeValuesFromExecResults>["getMetricValue"];
|
|
27
|
-
};
|
|
18
|
+
export declare function useAlertSupportedMetrics({ insight, widget, alertToEdit }: IUseAlertSupportedMetricsProps): IAlertSupportedMetrics;
|
|
28
19
|
//# sourceMappingURL=useAlertSupportedMetrics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAlertSupportedMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/state/useAlertSupportedMetrics.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAlertSupportedMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/state/useAlertSupportedMetrics.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAYlG,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,8BAA8B;IAC3C,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,yBAAyB,CAAC;CAC3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,OAAO,EACP,MAAM,EACN,WAAW,EACd,EAAE,8BAA8B,GAAG,sBAAsB,CA8CzD"}
|
|
@@ -4,7 +4,7 @@ import { fillMissingTitles } from "@gooddata/sdk-ui";
|
|
|
4
4
|
import { useAlertingDialogContext } from "../../contexts/AlertingDialogContext.js";
|
|
5
5
|
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
6
6
|
import { useAttributeValuesFromExecResults } from "../DefaultAlertingDialog/hooks/useAttributeValuesFromExecResults.js";
|
|
7
|
-
import { getMeasureFormatsFromExecution
|
|
7
|
+
import { getMeasureFormatsFromExecution } from "../DefaultAlertingDialog/utils/getters.js";
|
|
8
8
|
import { getSupportedInsightAttributesByInsight, getSupportedInsightMeasuresByInsight, } from "../DefaultAlertingDialog/utils/items.js";
|
|
9
9
|
/**
|
|
10
10
|
* Derives which measures and attributes the alerting dialog may offer for the current widget: it
|
|
@@ -16,7 +16,7 @@ import { getSupportedInsightAttributesByInsight, getSupportedInsightMeasuresByIn
|
|
|
16
16
|
*
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
export function useAlertSupportedMetrics({ insight, widget, alertToEdit }) {
|
|
19
|
+
export function useAlertSupportedMetrics({ insight, widget, alertToEdit, }) {
|
|
20
20
|
const { locale, catalogDateDatasets, catalogAttributes } = useAutomationsContext();
|
|
21
21
|
const { executionResultByRef } = useAlertingDialogContext();
|
|
22
22
|
const execResult = executionResultByRef(widget?.ref);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
import { type IAutomationDialogActionBarProps, type IAutomationDialogDestinationProps, type IAutomationDialogRecipientsProps } from "../../shared/slots/types.js";
|
|
3
|
+
import { type AlertingDialogHeaderDefaultProps, type IAlertingDialogFiltersProps } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Inputs of {@link useAlertingDialogHeaderProps} that come from the dialog rather than its state.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface IUseAlertingDialogHeaderPropsInput {
|
|
10
|
+
/**
|
|
11
|
+
* Closes the dialog; the header's back/close button calls it.
|
|
12
|
+
*/
|
|
13
|
+
onCancel?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* The dialog's initial-focus ref, attached to the title input.
|
|
16
|
+
*/
|
|
17
|
+
ref?: Ref<HTMLInputElement>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The exact props the default alerting dialog renders its header region with.
|
|
21
|
+
*
|
|
22
|
+
* Throws outside the alerting dialog's state providers.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function useAlertingDialogHeaderProps({ onCancel, ref }: IUseAlertingDialogHeaderPropsInput): AlertingDialogHeaderDefaultProps;
|
|
27
|
+
/**
|
|
28
|
+
* The exact props the default alerting dialog renders its filters region with.
|
|
29
|
+
*
|
|
30
|
+
* Throws outside the alerting dialog's state providers.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare function useAlertingDialogFiltersProps(): IAlertingDialogFiltersProps;
|
|
35
|
+
/**
|
|
36
|
+
* The exact props the default alerting dialog renders its destination region with.
|
|
37
|
+
*
|
|
38
|
+
* Throws outside the alerting dialog's state providers.
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare function useAlertingDialogDestinationProps(): IAutomationDialogDestinationProps;
|
|
43
|
+
/**
|
|
44
|
+
* The exact props the default alerting dialog renders its recipients region with.
|
|
45
|
+
*
|
|
46
|
+
* Throws outside the alerting dialog's state providers.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export declare function useAlertingDialogRecipientsProps(): IAutomationDialogRecipientsProps;
|
|
51
|
+
/**
|
|
52
|
+
* Inputs of {@link useAlertingDialogActionBarProps} that come from the dialog rather than its state.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export interface IUseAlertingDialogActionBarPropsInput {
|
|
57
|
+
/**
|
|
58
|
+
* Closes the dialog without saving.
|
|
59
|
+
*/
|
|
60
|
+
onCancel?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Submits the automation; the dialog's single submit path (see `useAlertSubmit`).
|
|
63
|
+
*/
|
|
64
|
+
onSubmit: () => void;
|
|
65
|
+
/**
|
|
66
|
+
* Whether a save is in flight.
|
|
67
|
+
*/
|
|
68
|
+
isSaving: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Opens the delete confirmation. Rendered only when an existing alert is being edited.
|
|
71
|
+
*/
|
|
72
|
+
onDelete?: () => void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The exact props the default alerting dialog renders its action bar with.
|
|
76
|
+
*
|
|
77
|
+
* Throws outside the alerting dialog's state providers.
|
|
78
|
+
*
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export declare function useAlertingDialogActionBarProps({ onCancel, onSubmit, isSaving, onDelete }: IUseAlertingDialogActionBarPropsInput): IAutomationDialogActionBarProps;
|
|
82
|
+
//# sourceMappingURL=useAlertingDialogRegionProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlertingDialogRegionProps.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/state/useAlertingDialogRegionProps.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAW,MAAM,OAAO,CAAC;AAQ1C,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,EACtC,KAAK,gCAAgC,EACxC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,KAAK,gCAAgC,EAAE,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAStG;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,EACzC,QAAQ,EACR,GAAG,EACN,EAAE,kCAAkC,GAAG,gCAAgC,CAkCvE;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,IAAI,2BAA2B,CAwB3E;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,IAAI,iCAAiC,CAUrF;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,IAAI,gCAAgC,CAqBnF;AAED;;;;GAIG;AACH,MAAM,WAAW,qCAAqC;IAClD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,EAC5C,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACX,EAAE,qCAAqC,GAAG,+BAA+B,CAmCzE"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { defineMessage, useIntl } from "react-intl";
|
|
5
|
+
import { UiIcon } from "@gooddata/sdk-ui-kit";
|
|
6
|
+
import { useAlertingDialogContext } from "../../contexts/AlertingDialogContext.js";
|
|
7
|
+
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
8
|
+
import { isAnomalyDetection } from "../DefaultAlertingDialog/utils/guards.js";
|
|
9
|
+
import { isMobileView } from "../DefaultAlertingDialog/utils/responsive.js";
|
|
10
|
+
import { useAlertActions } from "./AlertActionsContext.js";
|
|
11
|
+
import { useAlertData } from "./AlertDataContext.js";
|
|
12
|
+
import { useAlertDraft } from "./AlertDraftContext.js";
|
|
13
|
+
import { useAlertFilters } from "./AlertFiltersContext.js";
|
|
14
|
+
import { useAlertDialogValidity } from "./useAlertDialogValidity.js";
|
|
15
|
+
import { useAlertSelectedValues } from "./useAlertSelectedValues.js";
|
|
16
|
+
/**
|
|
17
|
+
* The exact props the default alerting dialog renders its header region with.
|
|
18
|
+
*
|
|
19
|
+
* Throws outside the alerting dialog's state providers.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export function useAlertingDialogHeaderProps({ onCancel, ref, }) {
|
|
24
|
+
const intl = useIntl();
|
|
25
|
+
const { isSecondaryTitleVisible } = useAutomationsContext();
|
|
26
|
+
const { widgetTitle } = useAlertingDialogContext();
|
|
27
|
+
const { editedAutomation } = useAlertDraft();
|
|
28
|
+
const { onTitleChange } = useAlertActions();
|
|
29
|
+
const { isParentValid } = useAlertDialogValidity();
|
|
30
|
+
const secondaryTitleIcon = useMemo(() => (_jsx(UiIcon, { type: "visualization", size: 16, color: "complementary-6", accessibilityConfig: {
|
|
31
|
+
ariaLabel: intl.formatMessage({
|
|
32
|
+
id: "dialogs.automation.icon.ariaLabel.sourceVisualization",
|
|
33
|
+
}),
|
|
34
|
+
} })), [intl]);
|
|
35
|
+
return {
|
|
36
|
+
title: editedAutomation?.title ?? "",
|
|
37
|
+
onChange: onTitleChange,
|
|
38
|
+
onCancel,
|
|
39
|
+
placeholder: intl.formatMessage({ id: "dialogs.alert.title.placeholder" }),
|
|
40
|
+
ref,
|
|
41
|
+
secondaryTitle: widgetTitle,
|
|
42
|
+
secondaryTitleIcon,
|
|
43
|
+
isSecondaryTitleVisible: isSecondaryTitleVisible ? isParentValid : undefined,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The exact props the default alerting dialog renders its filters region with.
|
|
48
|
+
*
|
|
49
|
+
* Throws outside the alerting dialog's state providers.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export function useAlertingDialogFiltersProps() {
|
|
54
|
+
const { editedAutomation } = useAlertDraft();
|
|
55
|
+
const { availableFilters, selectedFilters, onFiltersChange, automationParameters, availableParameters, onParameterAdd, onParameterChange, onParameterDelete, } = useAlertFilters();
|
|
56
|
+
return {
|
|
57
|
+
availableFilters,
|
|
58
|
+
selectedFilters,
|
|
59
|
+
onFiltersChange,
|
|
60
|
+
disableDateFilters: isAnomalyDetection(editedAutomation?.alert),
|
|
61
|
+
parameters: automationParameters,
|
|
62
|
+
availableParameters,
|
|
63
|
+
onParameterAdd,
|
|
64
|
+
onParameterChange,
|
|
65
|
+
onParameterDelete,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The exact props the default alerting dialog renders its destination region with.
|
|
70
|
+
*
|
|
71
|
+
* Throws outside the alerting dialog's state providers.
|
|
72
|
+
*
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export function useAlertingDialogDestinationProps() {
|
|
76
|
+
const { notificationChannels } = useAlertingDialogContext();
|
|
77
|
+
const { editedAutomation } = useAlertDraft();
|
|
78
|
+
const { onDestinationChange } = useAlertActions();
|
|
79
|
+
return {
|
|
80
|
+
notificationChannels,
|
|
81
|
+
selectedNotificationChannelId: editedAutomation?.notificationChannel,
|
|
82
|
+
onChange: onDestinationChange,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The exact props the default alerting dialog renders its recipients region with.
|
|
87
|
+
*
|
|
88
|
+
* Throws outside the alerting dialog's state providers.
|
|
89
|
+
*
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
export function useAlertingDialogRecipientsProps() {
|
|
93
|
+
const { maxAutomationsRecipients, externalRecipient: externalRecipientOverride } = useAutomationsContext();
|
|
94
|
+
const { notificationChannels } = useAlertingDialogContext();
|
|
95
|
+
const { editedAutomation } = useAlertDraft();
|
|
96
|
+
const { onRecipientsChange } = useAlertActions();
|
|
97
|
+
const { defaultUser } = useAlertData();
|
|
98
|
+
const { allowExternalRecipients, allowOnlyLoggedUserRecipients } = useAlertSelectedValues();
|
|
99
|
+
return {
|
|
100
|
+
loggedUser: defaultUser,
|
|
101
|
+
value: editedAutomation?.recipients ?? [],
|
|
102
|
+
onChange: onRecipientsChange,
|
|
103
|
+
allowEmptySelection: true,
|
|
104
|
+
allowOnlyLoggedUserRecipients,
|
|
105
|
+
allowExternalRecipients,
|
|
106
|
+
maxRecipients: maxAutomationsRecipients,
|
|
107
|
+
notificationChannels,
|
|
108
|
+
notificationChannelId: editedAutomation?.notificationChannel,
|
|
109
|
+
externalRecipientOverride,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The exact props the default alerting dialog renders its action bar with.
|
|
114
|
+
*
|
|
115
|
+
* Throws outside the alerting dialog's state providers.
|
|
116
|
+
*
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
export function useAlertingDialogActionBarProps({ onCancel, onSubmit, isSaving, onDelete, }) {
|
|
120
|
+
const intl = useIntl();
|
|
121
|
+
const { isWhiteLabeled, isExecutionTimestampMode } = useAutomationsContext();
|
|
122
|
+
const { alertToEdit } = useAlertingDialogContext();
|
|
123
|
+
const { isSubmitDisabled } = useAlertDialogValidity();
|
|
124
|
+
const helpTextId = isMobileView()
|
|
125
|
+
? defineMessage({ id: "dialogs.alerting.footer.title.short" }).id
|
|
126
|
+
: defineMessage({ id: "dialogs.alerting.footer.title" }).id;
|
|
127
|
+
return {
|
|
128
|
+
cancelButtonText: intl.formatMessage({ id: "cancel" }),
|
|
129
|
+
submitButtonText: alertToEdit
|
|
130
|
+
? intl.formatMessage({ id: "save" })
|
|
131
|
+
: intl.formatMessage({ id: "create" }),
|
|
132
|
+
onCancel: () => onCancel?.(),
|
|
133
|
+
onSubmit,
|
|
134
|
+
isSubmitDisabled: isSubmitDisabled || isSaving || isExecutionTimestampMode,
|
|
135
|
+
isSaving,
|
|
136
|
+
submitButtonTooltipText: isExecutionTimestampMode
|
|
137
|
+
? intl.formatMessage({ id: "dialogs.alert.save.executionTimestampMode" })
|
|
138
|
+
: undefined,
|
|
139
|
+
...(isWhiteLabeled
|
|
140
|
+
? {}
|
|
141
|
+
: {
|
|
142
|
+
helpLinkText: intl.formatMessage({ id: helpTextId }),
|
|
143
|
+
helpLinkHref: "https://www.gooddata.com/docs/cloud/create-dashboards/automation/alerts/",
|
|
144
|
+
}),
|
|
145
|
+
...(alertToEdit && onDelete
|
|
146
|
+
? {
|
|
147
|
+
deleteButtonText: intl.formatMessage({ id: "delete" }),
|
|
148
|
+
onDelete,
|
|
149
|
+
}
|
|
150
|
+
: {}),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
@@ -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":"AAsDA,OAAO,EAAE,KAAK,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAuBrE,wBAAgB,2BAA2B,CAAC,EACxC,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,OAAO,EACP,MAAM,EACN,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,aAAa,EAChB,EAAE,iCAAiC,2CA4cnC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,iCAAiC,2CAYnF"}
|
|
@@ -2,9 +2,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2019-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import {
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
6
|
import { ValidationContextStore, createInvalidNode, useValidationContextValue } from "@gooddata/sdk-ui";
|
|
7
|
-
import { ConfirmDialogBase, ContentDivider, Message, Overlay, OverlayController, OverlayControllerProvider, RecurrenceForm, ScrollablePanel,
|
|
7
|
+
import { ConfirmDialogBase, ContentDivider, Message, Overlay, OverlayController, OverlayControllerProvider, RecurrenceForm, ScrollablePanel, UiTabs, getTimezoneDisplayLabel, isEnterKey, useIdPrefixed, } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import { DASHBOARD_DIALOG_OVERS_Z_INDEX } from "../../../constants/zIndex.js";
|
|
9
9
|
import { IntlWrapper } from "../../../localization/IntlWrapper.js";
|
|
10
10
|
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
@@ -14,13 +14,12 @@ import { AutomationDialogActionBar, AutomationDialogFooterLeft, } from "../../sh
|
|
|
14
14
|
import { DeleteScheduleConfirmDialog } from "../DefaultScheduledEmailManagementDialog/components/DeleteScheduleConfirmDialog.js";
|
|
15
15
|
import { useScheduleEmailDialogAccessibility } from "../hooks/useScheduleEmailDialogAccessibility.js";
|
|
16
16
|
import { useScheduledExportActions } from "../state/ScheduledExportActionsContext.js";
|
|
17
|
-
import { useScheduledExportData } from "../state/ScheduledExportDataContext.js";
|
|
18
17
|
import { useScheduledExportDraft } from "../state/ScheduledExportDraftContext.js";
|
|
19
18
|
import { useScheduledExportFilters } from "../state/ScheduledExportFiltersContext.js";
|
|
19
|
+
import { useScheduledEmailDialogActionBarProps, useScheduledEmailDialogDestinationProps, useScheduledEmailDialogFiltersProps, useScheduledEmailDialogHeaderProps, useScheduledEmailDialogRecipientsProps, useScheduledEmailDialogTimezoneProps, } from "../state/useScheduledEmailDialogRegionProps.js";
|
|
20
20
|
import { useScheduledExportAttachments } from "../state/useScheduledExportAttachments.js";
|
|
21
21
|
import { useScheduledExportDialogValidity } from "../state/useScheduledExportDialogValidity.js";
|
|
22
22
|
import { getDefaultCronExpression } from "../utils/cron.js";
|
|
23
|
-
import { isMobileView } from "../utils/responsive.js";
|
|
24
23
|
import { TIMEZONE_DEFAULT } from "../utils/timezone.js";
|
|
25
24
|
import { DashboardAttachments } from "./components/Attachments/DashboardAttachments.js";
|
|
26
25
|
import { WidgetAttachments } from "./components/Attachments/WidgetAttachments.js";
|
|
@@ -51,73 +50,51 @@ export function ScheduledMailDialogRenderer({ onBack, onCancel, onDeleteSuccess,
|
|
|
51
50
|
const filtersTabContentRef = useRef(null);
|
|
52
51
|
const [scheduledEmailToDelete, setScheduledEmailToDelete] = useState(null);
|
|
53
52
|
const [selectedTabId, setSelectedTabId] = useState("general");
|
|
54
|
-
const { isWhiteLabeled,
|
|
55
|
-
const { exportTemplates,
|
|
53
|
+
const { isWhiteLabeled, tabIds } = useAutomationsContext();
|
|
54
|
+
const { exportTemplates, widget, dashboardFilters, notificationChannels } = useScheduledEmailDialogContext();
|
|
56
55
|
const handleScheduleDeleteSuccess = () => {
|
|
57
56
|
onDeleteSuccess?.();
|
|
58
57
|
setScheduledEmailToDelete(null);
|
|
59
58
|
};
|
|
60
|
-
const { locale, dashboardTitle, dateFormat, weekStart,
|
|
61
|
-
const { editedAutomation, startDate, isTimezoneFeatureEnabled, canSelectScheduleTimezone,
|
|
62
|
-
const {
|
|
63
|
-
const {
|
|
64
|
-
const { selectedFilters, availableFilters, storeFilters, filtersByTab, editedFiltersByTab, onFiltersChange, onFiltersByTabChange, onApplyCurrentFilters, onStoreFiltersChange, automationIsValid, parametersEnabled, visibleParametersByTab, availableParametersByTab, flatTabId, onParameterAdd, onParameterChange, onParameterDelete, onParameterAddByTab, onParameterChangeByTab, onParameterDeleteByTab, applyLatest: applyLatestParameters, } = useScheduledExportFilters();
|
|
59
|
+
const { locale, dashboardTitle, dateFormat, weekStart, allowHourlyRecurrence, isCrossFiltering, isSlidesExportEnabled, isAccessibilityModeEnabled, enableAutomationEvaluationMode, } = useDefaultScheduledEmailDialogData();
|
|
60
|
+
const { editedAutomation, startDate, isTimezoneFeatureEnabled, canSelectScheduleTimezone, scheduleTimezoneIsStale, } = useScheduledExportDraft();
|
|
61
|
+
const { onRecurrenceChange, onEvaluationModeChange, onSubjectChange, onMessageChange, onDashboardAttachmentsChange, onWidgetAttachmentsChange, onXlsxSettingsChange, onPdfSettingsChange, onCsvSettingsChange, onCsvRawSettingsChange, onSlidesTemplateIdChange, applyCurrentScheduleTimezone, } = useScheduledExportActions();
|
|
62
|
+
const { onApplyCurrentFilters, automationIsValid, applyLatest: applyLatestParameters, } = useScheduledExportFilters();
|
|
65
63
|
const { selectedAttachments, xlsxSettings, pdfSettings, csvSettings, csvRawSettings, slidesTemplateIds } = useScheduledExportAttachments();
|
|
66
|
-
const { isSubmitDisabled, validationErrorMessage
|
|
64
|
+
const { isSubmitDisabled, validationErrorMessage } = useScheduledExportDialogValidity();
|
|
67
65
|
// a stale schedule timezone repairs through the same consent dialog as stale filters
|
|
68
66
|
const [isApplyCurrentFiltersDialogOpen, setIsApplyCurrentFiltersDialogOpen] = useState(!automationIsValid || scheduleTimezoneIsStale);
|
|
69
|
-
const { handleSaveScheduledEmail, isSavingScheduledEmail, savingErrorMessage } = useSaveScheduledEmailToBackend(
|
|
70
|
-
onSuccess,
|
|
71
|
-
onError,
|
|
72
|
-
onSubmit,
|
|
73
|
-
onSaveSuccess,
|
|
74
|
-
onSaveError,
|
|
75
|
-
onSave,
|
|
76
|
-
});
|
|
67
|
+
const { handleSaveScheduledEmail, isSavingScheduledEmail, savingErrorMessage } = useSaveScheduledEmailToBackend({ onSuccess, onError, onSubmit, onSaveSuccess, onSaveError, onSave });
|
|
77
68
|
const { returnFocusTo } = useScheduleEmailDialogAccessibility();
|
|
78
69
|
const missingAttachmentsErrorMessage = selectedAttachments.length === 0 &&
|
|
79
70
|
intl.formatMessage({ id: "scheduledEmail.attachments.error.noAttachmentsSelected" });
|
|
80
71
|
const validationContextValue = useValidationContextValue(createInvalidNode({ id: "ScheduledEmailDialog" }));
|
|
81
72
|
const { getInvalidDatapoints } = validationContextValue;
|
|
82
73
|
const errorMessage = savingErrorMessage ?? validationErrorMessage ?? missingAttachmentsErrorMessage;
|
|
83
|
-
const helpTextId = isMobileView()
|
|
84
|
-
? defineMessage({ id: "dialogs.schedule.email.footer.title.short" }).id
|
|
85
|
-
: defineMessage({ id: "dialogs.schedule.email.footer.title" }).id;
|
|
86
74
|
const titleElementId = useIdPrefixed("title");
|
|
87
|
-
const
|
|
75
|
+
const actionBarDefaultProps = useScheduledEmailDialogActionBarProps({
|
|
76
|
+
onCancel,
|
|
77
|
+
onSubmit: handleSaveScheduledEmail,
|
|
78
|
+
isSaving: isSavingScheduledEmail,
|
|
79
|
+
onDelete: () => setScheduledEmailToDelete(editedAutomation),
|
|
80
|
+
});
|
|
81
|
+
const submitDisabled = actionBarDefaultProps.isSubmitDisabled;
|
|
88
82
|
const handleSubmitForm = useCallback((e) => {
|
|
89
83
|
if (isEnterKey(e) && !submitDisabled) {
|
|
90
84
|
handleSaveScheduledEmail();
|
|
91
85
|
}
|
|
92
86
|
}, [submitDisabled, handleSaveScheduledEmail]);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
secondaryTitle: widgetTitle,
|
|
105
|
-
secondaryTitleIcon: (_jsx(UiIcon, { type: "visualization", size: 16, color: "complementary-6", accessibilityConfig: {
|
|
106
|
-
ariaLabel: intl.formatMessage({
|
|
107
|
-
id: "dialogs.automation.icon.ariaLabel.sourceVisualization",
|
|
108
|
-
}),
|
|
109
|
-
} })),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
secondaryTitle: dashboardTitle,
|
|
114
|
-
secondaryTitleIcon: (_jsx(UiIcon, { type: "dashboard", size: 16, color: "complementary-6", accessibilityConfig: {
|
|
115
|
-
ariaLabel: intl.formatMessage({
|
|
116
|
-
id: "dialogs.automation.icon.ariaLabel.sourceDashboard",
|
|
117
|
-
}),
|
|
118
|
-
} })),
|
|
119
|
-
};
|
|
120
|
-
}, [widget, widgetTitle, dashboardTitle, intl]);
|
|
87
|
+
const headerDefaultProps = useScheduledEmailDialogHeaderProps({
|
|
88
|
+
onBack,
|
|
89
|
+
onTitleKeyDown: handleSubmitForm,
|
|
90
|
+
ref: dialogTitleRef,
|
|
91
|
+
});
|
|
92
|
+
const filtersDefaultProps = useScheduledEmailDialogFiltersProps();
|
|
93
|
+
const destinationDefaultProps = useScheduledEmailDialogDestinationProps();
|
|
94
|
+
const recipientsDefaultProps = useScheduledEmailDialogRecipientsProps({
|
|
95
|
+
onKeyDownSubmit: handleSubmitForm,
|
|
96
|
+
});
|
|
97
|
+
const timezoneDefaultProps = useScheduledEmailDialogTimezoneProps();
|
|
121
98
|
const tabs = useMemo(() => [
|
|
122
99
|
{
|
|
123
100
|
id: "general",
|
|
@@ -151,75 +128,8 @@ export function ScheduledMailDialogRenderer({ onBack, onCancel, onDeleteSuccess,
|
|
|
151
128
|
}
|
|
152
129
|
const selectedChannel = notificationChannels.find((channel) => channel.id === editedAutomation.notificationChannel);
|
|
153
130
|
const isInPlatformChannel = selectedChannel?.destinationType === "inPlatform";
|
|
154
|
-
const filtersDefaultProps = {
|
|
155
|
-
availableFilters,
|
|
156
|
-
selectedFilters,
|
|
157
|
-
onFiltersChange,
|
|
158
|
-
storeFilters,
|
|
159
|
-
onStoreFiltersChange,
|
|
160
|
-
isDashboardAutomation: !widget,
|
|
161
|
-
filtersByTab,
|
|
162
|
-
editedFiltersByTab,
|
|
163
|
-
onFiltersByTabChange,
|
|
164
|
-
parameters: flatTabId ? visibleParametersByTab[flatTabId] : undefined,
|
|
165
|
-
availableParameters: flatTabId ? availableParametersByTab[flatTabId] : undefined,
|
|
166
|
-
onParameterAdd,
|
|
167
|
-
onParameterChange,
|
|
168
|
-
onParameterDelete,
|
|
169
|
-
parametersByTab: visibleParametersByTab,
|
|
170
|
-
availableParametersByTab,
|
|
171
|
-
onParameterAddByTab,
|
|
172
|
-
onParameterChangeByTab,
|
|
173
|
-
onParameterDeleteByTab,
|
|
174
|
-
parametersEnabled,
|
|
175
|
-
};
|
|
176
|
-
const destinationDefaultProps = {
|
|
177
|
-
notificationChannels,
|
|
178
|
-
selectedNotificationChannelId: editedAutomation.notificationChannel,
|
|
179
|
-
onChange: onDestinationChange,
|
|
180
|
-
};
|
|
181
|
-
const recipientsDefaultProps = {
|
|
182
|
-
loggedUser: defaultUser,
|
|
183
|
-
value: editedAutomation.recipients ?? [],
|
|
184
|
-
onChange: onRecipientsChange,
|
|
185
|
-
allowEmptySelection: true,
|
|
186
|
-
allowOnlyLoggedUserRecipients,
|
|
187
|
-
allowExternalRecipients,
|
|
188
|
-
maxRecipients: maxAutomationsRecipients,
|
|
189
|
-
notificationChannels,
|
|
190
|
-
notificationChannelId: editedAutomation.notificationChannel,
|
|
191
|
-
onKeyDownSubmit: handleSubmitForm,
|
|
192
|
-
externalRecipientOverride,
|
|
193
|
-
};
|
|
194
|
-
const actionBarDefaultProps = {
|
|
195
|
-
cancelButtonText: intl.formatMessage({ id: "cancel" }),
|
|
196
|
-
submitButtonText: scheduledExportToEdit
|
|
197
|
-
? intl.formatMessage({ id: "dialogs.schedule.email.save" })
|
|
198
|
-
: intl.formatMessage({ id: "dialogs.schedule.email.create" }),
|
|
199
|
-
onCancel: () => onCancel?.(),
|
|
200
|
-
onSubmit: handleSaveScheduledEmail,
|
|
201
|
-
isSubmitDisabled: submitDisabled,
|
|
202
|
-
isSaving: isSavingScheduledEmail,
|
|
203
|
-
submitButtonTooltipText: isExecutionTimestampMode
|
|
204
|
-
? intl.formatMessage({ id: "dialogs.schedule.email.save.executionTimestampMode" })
|
|
205
|
-
: undefined,
|
|
206
|
-
...(isWhiteLabeled
|
|
207
|
-
? {}
|
|
208
|
-
: {
|
|
209
|
-
helpLinkText: intl.formatMessage({ id: helpTextId }),
|
|
210
|
-
helpLinkHref: "https://www.gooddata.com/docs/cloud/create-dashboards/automation/scheduled-exports/#ScheduleExportsinDashboards-ScheduleExport",
|
|
211
|
-
}),
|
|
212
|
-
...(scheduledExportToEdit
|
|
213
|
-
? {
|
|
214
|
-
deleteButtonText: intl.formatMessage({ id: "delete" }),
|
|
215
|
-
onDelete: () => setScheduledEmailToDelete(editedAutomation),
|
|
216
|
-
}
|
|
217
|
-
: {}),
|
|
218
|
-
};
|
|
219
131
|
return (_jsxs(_Fragment, { children: [
|
|
220
|
-
_jsx(Overlay, { className: "gd-notifications-channels-dialog-overlay", isModal: true, positionType: "fixed", ensureVisibility: true, children: _jsx(OverlayControllerProvider, { overlayController: overlayController, children: _jsx(ValidationContextStore, { value: validationContextValue, children: _jsxs(ConfirmDialogBase, { className: "gd-notifications-channels-dialog s-gd-notifications-channels-dialog gd-dialog--wide gd-notifications-channels-dialog--wide", isPositive: true, cancelButtonText:
|
|
221
|
-
? intl.formatMessage({ id: `dialogs.schedule.email.save` })
|
|
222
|
-
: intl.formatMessage({ id: `dialogs.schedule.email.create` }), accessibilityConfig: {
|
|
132
|
+
_jsx(Overlay, { className: "gd-notifications-channels-dialog-overlay", isModal: true, positionType: "fixed", ensureVisibility: true, children: _jsx(OverlayControllerProvider, { overlayController: overlayController, children: _jsx(ValidationContextStore, { value: validationContextValue, children: _jsxs(ConfirmDialogBase, { className: "gd-notifications-channels-dialog s-gd-notifications-channels-dialog gd-dialog--wide gd-notifications-channels-dialog--wide", isPositive: true, cancelButtonText: actionBarDefaultProps.cancelButtonText, submitButtonText: actionBarDefaultProps.submitButtonText, accessibilityConfig: {
|
|
223
133
|
closeButton: {
|
|
224
134
|
ariaLabel: intl.formatMessage({
|
|
225
135
|
id: "dialogs.schedule.email.closeLabel",
|
|
@@ -227,30 +137,11 @@ export function ScheduledMailDialogRenderer({ onBack, onCancel, onDeleteSuccess,
|
|
|
227
137
|
},
|
|
228
138
|
titleElementId,
|
|
229
139
|
dialogId: SCHEDULED_EMAIL_DIALOG_ID,
|
|
230
|
-
}, showProgressIndicator:
|
|
140
|
+
}, showProgressIndicator: actionBarDefaultProps.isSaving, returnFocusTo: returnFocusTo, returnFocusAfterClose: false, footerLeftRenderer: ActionBarSlot
|
|
231
141
|
? undefined
|
|
232
|
-
: () => (_jsx(AutomationDialogFooterLeft, { helpLinkText: actionBarDefaultProps.helpLinkText, helpLinkHref: actionBarDefaultProps.helpLinkHref, deleteButtonText: actionBarDefaultProps.deleteButtonText, onDelete: actionBarDefaultProps.onDelete, isDeleteDisabled:
|
|
142
|
+
: () => (_jsx(AutomationDialogFooterLeft, { helpLinkText: actionBarDefaultProps.helpLinkText, helpLinkHref: actionBarDefaultProps.helpLinkHref, deleteButtonText: actionBarDefaultProps.deleteButtonText, onDelete: actionBarDefaultProps.onDelete, isDeleteDisabled: actionBarDefaultProps.isSaving })), footerRenderer: ActionBarSlot
|
|
233
143
|
? () => (_jsx(ActionBarSlot, { Default: AutomationDialogActionBar, defaultProps: actionBarDefaultProps }))
|
|
234
|
-
: undefined, isSubmitDisabled:
|
|
235
|
-
? intl.formatMessage({
|
|
236
|
-
id: "dialogs.schedule.email.save.executionTimestampMode",
|
|
237
|
-
})
|
|
238
|
-
: undefined, initialFocus: dialogTitleRef, submitOnEnterKey: false, onCancel: onCancel, onSubmit: handleSaveScheduledEmail, headline: undefined, headerLeftButtonRenderer: () => {
|
|
239
|
-
const headerDefaultProps = {
|
|
240
|
-
title: editedAutomation.title ?? "",
|
|
241
|
-
onChange: onTitleChange,
|
|
242
|
-
onBack,
|
|
243
|
-
placeholder: intl.formatMessage({
|
|
244
|
-
id: "dialogs.schedule.email.title.placeholder",
|
|
245
|
-
}),
|
|
246
|
-
ref: dialogTitleRef,
|
|
247
|
-
onTitleKeyDown: handleSubmitForm,
|
|
248
|
-
secondaryTitle,
|
|
249
|
-
secondaryTitleIcon,
|
|
250
|
-
isSecondaryTitleVisible: isSecondaryTitleVisible
|
|
251
|
-
? isParentValid
|
|
252
|
-
: undefined,
|
|
253
|
-
};
|
|
144
|
+
: undefined, isSubmitDisabled: actionBarDefaultProps.isSubmitDisabled, submitButtonTooltipText: actionBarDefaultProps.submitButtonTooltipText, initialFocus: dialogTitleRef, submitOnEnterKey: false, onCancel: onCancel, onSubmit: actionBarDefaultProps.onSubmit, headline: undefined, headerLeftButtonRenderer: () => {
|
|
254
145
|
return HeaderSlot ? (_jsx(HeaderSlot, { Default: ScheduledEmailDialogHeader, defaultProps: headerDefaultProps })) : (_jsx(ScheduledEmailDialogHeader, { ...headerDefaultProps }));
|
|
255
146
|
}, children: [
|
|
256
147
|
_jsx("h2", { className: "sr-only", id: titleElementId, children: intl.formatMessage({ id: "dialogs.schedule.email.accessibilityTitle" }) }), tabs.length > 1 ? (_jsx(UiTabs, { tabs: tabs, selectedTabId: selectedTabId, onTabSelect: handleTabSelect, size: "medium", accessibilityConfig: {
|
|
@@ -323,17 +214,15 @@ function DefaultScheduledEmailDialogBody(props) {
|
|
|
323
214
|
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(ScheduledMailDialogRenderer, { ...props }) }));
|
|
324
215
|
}
|
|
325
216
|
function useDefaultScheduledEmailDialogData() {
|
|
326
|
-
const { locale, settings, weekStart,
|
|
217
|
+
const { locale, settings, weekStart, allowHourlyRecurrence, features: { enableSlideshowExports, enableAutomationEvaluationMode }, } = useAutomationsContext();
|
|
327
218
|
const { dashboardTitle, dateFormat, isCrossFiltering } = useScheduledEmailDialogContext();
|
|
328
219
|
return {
|
|
329
220
|
locale,
|
|
330
221
|
dashboardTitle,
|
|
331
222
|
dateFormat,
|
|
332
223
|
weekStart,
|
|
333
|
-
maxAutomationsRecipients,
|
|
334
224
|
allowHourlyRecurrence,
|
|
335
225
|
isCrossFiltering,
|
|
336
|
-
isExecutionTimestampMode,
|
|
337
226
|
isSlidesExportEnabled: enableSlideshowExports,
|
|
338
227
|
isAccessibilityModeEnabled: settings?.enableAccessibilityMode === true,
|
|
339
228
|
enableAutomationEvaluationMode,
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import { type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition } from "@gooddata/sdk-model";
|
|
2
1
|
import { type IScheduledEmailDialogProps } from "../../types.js";
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Lifecycle callbacks of {@link useSaveScheduledEmailToBackend}: `onSubmit`/`onSuccess`/`onError`
|
|
4
|
+
* (create) and `onSave`/`onSaveSuccess`/`onSaveError` (edit).
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export type IUseSaveScheduledEmailCallbacks = Pick<IScheduledEmailDialogProps, "onSuccess" | "onError" | "onSubmit" | "onSaveSuccess" | "onSaveError" | "onSave">;
|
|
9
|
+
/**
|
|
10
|
+
* Saves the scheduled-export dialog's draft: creates a new schedule or updates the edited one after
|
|
11
|
+
* sanitizing it, keeps a 400 response's detail as an in-dialog error message, and routes everything
|
|
12
|
+
* else to the matching callback.
|
|
13
|
+
*
|
|
14
|
+
* Reads the draft from the scheduled-export state contexts, so it throws outside them.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function useSaveScheduledEmailToBackend({ onSuccess, onError, onSubmit, onSaveSuccess, onSaveError, onSave }: IUseSaveScheduledEmailCallbacks): {
|
|
4
19
|
handleSaveScheduledEmail: () => void;
|
|
5
20
|
isSavingScheduledEmail: boolean;
|
|
6
21
|
savingErrorMessage: string | undefined;
|