@gooddata/sdk-ui-dashboard 11.51.0-alpha.1 → 11.51.0-alpha.3
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 +4 -4
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/assets/timezone.svg +1 -0
- package/esm/index.d.ts +11 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +10 -2
- package/esm/model/react/useWidgetExecConfig.d.ts +9 -0
- package/esm/model/react/useWidgetExecConfig.d.ts.map +1 -1
- package/esm/model/react/useWidgetExecConfig.js +21 -3
- package/esm/model/store/config/configSelectors.d.ts +6 -0
- package/esm/model/store/config/configSelectors.d.ts.map +1 -1
- package/esm/model/store/config/configSelectors.js +8 -0
- package/esm/model/store/meta/index.d.ts +1 -0
- package/esm/model/store/meta/index.d.ts.map +1 -1
- package/esm/model/store/meta/metaReducers.d.ts +5 -1
- package/esm/model/store/meta/metaReducers.d.ts.map +1 -1
- package/esm/model/store/meta/metaReducers.js +9 -0
- package/esm/model/store/meta/metaSelectors.d.ts +35 -1
- package/esm/model/store/meta/metaSelectors.d.ts.map +1 -1
- package/esm/model/store/meta/metaSelectors.js +51 -2
- package/esm/model/store/meta/metaState.d.ts +1 -1
- package/esm/model/store/meta/metaState.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +9 -9
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultLoadingAlertingDialog.d.ts +7 -2
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultLoadingAlertingDialog.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultLoadingAlertingDialog.js +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts +6 -8
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.js +5 -2
- package/esm/presentation/automations/alerting/types.d.ts +30 -5
- package/esm/presentation/automations/alerting/types.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/AlertingConnector.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/AlertingConnector.js +22 -25
- package/esm/presentation/automations/connectors/AlertingConnector.test.js +71 -5
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.js +30 -32
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.test.js +90 -9
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.d.ts +7 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.js +12 -2
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.test.js +28 -2
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts +8 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js +12 -3
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js +38 -8
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.d.ts +6 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.js +6 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.test.js +7 -1
- package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts +29 -1
- package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/AlertingDialogContext.js +12 -0
- package/esm/presentation/automations/contexts/AlertingManagementDialogContext.d.ts +14 -0
- package/esm/presentation/automations/contexts/AlertingManagementDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/AlertingManagementDialogContext.js +12 -0
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts +13 -0
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/AutomationsContext.js +9 -0
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts +35 -1
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.js +14 -0
- package/esm/presentation/automations/contexts/ScheduledEmailManagementDialogContext.d.ts +20 -1
- package/esm/presentation/automations/contexts/ScheduledEmailManagementDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/ScheduledEmailManagementDialogContext.js +12 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultLoadingScheduledEmailDialog.d.ts +7 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultLoadingScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +17 -25
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +6 -12
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +5 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useElementHeightSnapshot.d.ts +12 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useElementHeightSnapshot.d.ts.map +1 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useElementHeightSnapshot.js +41 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.d.ts +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.d.ts +1 -3
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContent.js +2 -2
- package/esm/presentation/automations/scheduledEmail/types.d.ts +35 -5
- package/esm/presentation/automations/scheduledEmail/types.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/utils/timezone.d.ts +4 -1
- package/esm/presentation/automations/scheduledEmail/utils/timezone.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/utils/timezone.js +14 -138
- package/esm/presentation/dashboard/DashboardHeader/SettingsDialogProvider.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/SettingsDialogProvider.js +1 -0
- package/esm/presentation/dashboard/components/DashboardLoading.js +1 -1
- package/esm/presentation/dashboardContexts/useSlideData.d.ts +5 -10
- package/esm/presentation/dashboardContexts/useSlideData.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/useSlideData.js +16 -10
- package/esm/presentation/dashboardSettingsDialog/DefaultDashboardSettingsDialog.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/DefaultDashboardSettingsDialog.js +52 -14
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.d.ts +11 -0
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.d.ts.map +1 -0
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.js +36 -0
- package/esm/presentation/dashboardSettingsDialog/types.d.ts +2 -1
- package/esm/presentation/dashboardSettingsDialog/types.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/useDialogData.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/useDialogData.js +4 -1
- package/esm/presentation/filterBar/dateFilter/DefaultDashboardDateFilter.d.ts.map +1 -1
- package/esm/presentation/filterBar/dateFilter/DefaultDashboardDateFilter.js +30 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.js +29 -8
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderDescription.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderDescription.js +3 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableHeader/SectionHeaderEditable.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableHeader/SectionHeaderEditable.js +3 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/ExportableDashboardLayoutSectionRenderer.d.ts +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/ExportableDashboardLayoutSectionRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/ExportableDashboardLayoutSectionRenderer.js +2 -5
- package/esm/presentation/insightList/InsightList.d.ts.map +1 -1
- package/esm/presentation/insightList/InsightList.js +4 -5
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +48 -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 +48 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +11 -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 +13 -2
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +11 -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 +11 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +11 -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 +12 -1
- package/esm/presentation/topBar/timezoneIndicator/DefaultTimezoneIndicator.d.ts +10 -0
- package/esm/presentation/topBar/timezoneIndicator/DefaultTimezoneIndicator.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/DefaultTimezoneIndicator.js +19 -0
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts +13 -0
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.js +27 -0
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts +13 -0
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.js +20 -0
- package/esm/presentation/topBar/timezoneIndicator/types.d.ts +47 -0
- package/esm/presentation/topBar/timezoneIndicator/types.d.ts.map +1 -0
- package/esm/presentation/topBar/timezoneIndicator/types.js +2 -0
- package/esm/presentation/topBar/topBar/DefaultTopBar.d.ts.map +1 -1
- package/esm/presentation/topBar/topBar/DefaultTopBar.js +15 -4
- package/esm/presentation/topBar/topBar/types.d.ts +2 -0
- package/esm/presentation/topBar/topBar/types.d.ts.map +1 -1
- package/esm/presentation/widget/description/ExportModeInsightWidgetDescription.d.ts.map +1 -1
- package/esm/presentation/widget/description/ExportModeInsightWidgetDescription.js +3 -5
- package/esm/presentation/widget/description/InsightWidgetDescriptionTrigger.d.ts.map +1 -1
- package/esm/presentation/widget/description/InsightWidgetDescriptionTrigger.js +3 -6
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.js +5 -6
- package/esm/presentation/widget/insight/configuration/InsightDescriptionConfig/InsightDescription.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDescriptionConfig/InsightDescription.js +3 -6
- package/esm/presentation/widget/richText/EditModeDashboardRichText.d.ts.map +1 -1
- package/esm/presentation/widget/richText/EditModeDashboardRichText.js +3 -5
- package/esm/presentation/widget/richText/ViewModeDashboardRichText.d.ts.map +1 -1
- package/esm/presentation/widget/richText/ViewModeDashboardRichText.js +3 -5
- package/esm/sdk-ui-dashboard.d.ts +528 -12
- package/package.json +21 -21
- package/styles/css/main.css +28 -1
- package/styles/css/main.css.map +1 -1
- package/styles/css/timezoneIndicator.css +20 -0
- package/styles/css/timezoneIndicator.css.map +1 -0
- package/styles/css/topBar.css +9 -1
- package/styles/css/topBar.css.map +1 -1
- package/styles/scss/main.scss +1 -0
- package/styles/scss/timezoneIndicator.scss +23 -0
- package/styles/scss/topBar.scss +13 -2
|
@@ -7,16 +7,34 @@ const fixtures = vi.hoisted(() => {
|
|
|
7
7
|
const navigate = vi.fn();
|
|
8
8
|
const onAlertingManagementEdit = vi.fn();
|
|
9
9
|
let managementDialogProps;
|
|
10
|
+
let dialogProps;
|
|
11
|
+
let automationsError;
|
|
12
|
+
const useWorkspaceUsers = vi.fn(() => ({ users: [], status: "success", usersError: undefined }));
|
|
13
|
+
const alertsState = { isAlertDialogOpen: false, isAlertManagementDialogOpen: true };
|
|
10
14
|
return {
|
|
11
15
|
buildAutomationUrl,
|
|
12
16
|
navigate,
|
|
13
17
|
onAlertingManagementEdit,
|
|
18
|
+
useWorkspaceUsers,
|
|
19
|
+
alertsState,
|
|
14
20
|
get managementDialogProps() {
|
|
15
21
|
return managementDialogProps;
|
|
16
22
|
},
|
|
17
23
|
set managementDialogProps(value) {
|
|
18
24
|
managementDialogProps = value;
|
|
19
25
|
},
|
|
26
|
+
get dialogProps() {
|
|
27
|
+
return dialogProps;
|
|
28
|
+
},
|
|
29
|
+
set dialogProps(value) {
|
|
30
|
+
dialogProps = value;
|
|
31
|
+
},
|
|
32
|
+
get automationsError() {
|
|
33
|
+
return automationsError;
|
|
34
|
+
},
|
|
35
|
+
set automationsError(value) {
|
|
36
|
+
automationsError = value;
|
|
37
|
+
},
|
|
20
38
|
};
|
|
21
39
|
});
|
|
22
40
|
vi.mock("@gooddata/sdk-ui", () => ({
|
|
@@ -30,11 +48,15 @@ vi.mock("../../../model/react/DashboardStoreProvider.js", () => ({
|
|
|
30
48
|
vi.mock("../../../model/react/useDashboardAlerting/useDashboardAlerts.js", () => ({
|
|
31
49
|
useDashboardAlerts: () => ({
|
|
32
50
|
isInitialized: true,
|
|
33
|
-
isAlertDialogOpen
|
|
34
|
-
|
|
51
|
+
get isAlertDialogOpen() {
|
|
52
|
+
return fixtures.alertsState.isAlertDialogOpen;
|
|
53
|
+
},
|
|
54
|
+
get isAlertManagementDialogOpen() {
|
|
55
|
+
return fixtures.alertsState.isAlertManagementDialogOpen;
|
|
56
|
+
},
|
|
35
57
|
alertToEdit: undefined,
|
|
36
58
|
automations: [],
|
|
37
|
-
automationsError:
|
|
59
|
+
automationsError: fixtures.automationsError,
|
|
38
60
|
automationsLoading: false,
|
|
39
61
|
notificationChannels: [],
|
|
40
62
|
onAlertingCancel: vi.fn(),
|
|
@@ -54,7 +76,7 @@ vi.mock("../../../model/react/useDashboardAlerting/useDashboardAlerts.js", () =>
|
|
|
54
76
|
}),
|
|
55
77
|
}));
|
|
56
78
|
vi.mock("../../../model/react/useWorkspaceUsers.js", () => ({
|
|
57
|
-
useWorkspaceUsers:
|
|
79
|
+
useWorkspaceUsers: fixtures.useWorkspaceUsers,
|
|
58
80
|
}));
|
|
59
81
|
vi.mock("../../../model/store/config/configSelectors.js", () => ({
|
|
60
82
|
selectExternalRecipient: () => "recipient@example.com",
|
|
@@ -68,7 +90,10 @@ vi.mock("../../../model/store/meta/metaSelectors.js", () => ({
|
|
|
68
90
|
selectDashboardId: () => "current-dashboard",
|
|
69
91
|
}));
|
|
70
92
|
vi.mock("../alerting/AlertingDialog.js", () => ({
|
|
71
|
-
AlertingDialog: () =>
|
|
93
|
+
AlertingDialog: (props) => {
|
|
94
|
+
fixtures.dialogProps = props;
|
|
95
|
+
return null;
|
|
96
|
+
},
|
|
72
97
|
}));
|
|
73
98
|
vi.mock("../alerting/AlertingManagementDialog.js", () => ({
|
|
74
99
|
AlertingManagementDialog: (props) => {
|
|
@@ -114,6 +139,11 @@ describe("AlertingConnector", () => {
|
|
|
114
139
|
fixtures.navigate.mockClear();
|
|
115
140
|
fixtures.onAlertingManagementEdit.mockClear();
|
|
116
141
|
fixtures.managementDialogProps = undefined;
|
|
142
|
+
fixtures.dialogProps = undefined;
|
|
143
|
+
fixtures.automationsError = undefined;
|
|
144
|
+
fixtures.useWorkspaceUsers.mockClear();
|
|
145
|
+
fixtures.alertsState.isAlertDialogOpen = false;
|
|
146
|
+
fixtures.alertsState.isAlertManagementDialogOpen = true;
|
|
117
147
|
});
|
|
118
148
|
it("uses host routes when editing an alert on another dashboard in shell mode", () => {
|
|
119
149
|
render(_jsx(AlertingConnector, {}));
|
|
@@ -148,4 +178,40 @@ describe("AlertingConnector", () => {
|
|
|
148
178
|
dashboard: undefined,
|
|
149
179
|
});
|
|
150
180
|
});
|
|
181
|
+
it("does not load workspace users when only the management dialog is open", () => {
|
|
182
|
+
render(_jsx(AlertingConnector, {}));
|
|
183
|
+
expect(fixtures.useWorkspaceUsers).not.toHaveBeenCalled();
|
|
184
|
+
});
|
|
185
|
+
it("loads workspace users when the create/edit dialog is open", () => {
|
|
186
|
+
fixtures.alertsState.isAlertDialogOpen = true;
|
|
187
|
+
fixtures.alertsState.isAlertManagementDialogOpen = false;
|
|
188
|
+
render(_jsx(AlertingConnector, {}));
|
|
189
|
+
expect(fixtures.useWorkspaceUsers).toHaveBeenCalled();
|
|
190
|
+
});
|
|
191
|
+
it("does not supply the deprecated data props to the create/edit dialog", () => {
|
|
192
|
+
fixtures.alertsState.isAlertDialogOpen = true;
|
|
193
|
+
fixtures.alertsState.isAlertManagementDialogOpen = false;
|
|
194
|
+
render(_jsx(AlertingConnector, {}));
|
|
195
|
+
expect(fixtures.dialogProps).toBeDefined();
|
|
196
|
+
for (const prop of [
|
|
197
|
+
"alertToEdit",
|
|
198
|
+
"users",
|
|
199
|
+
"usersError",
|
|
200
|
+
"notificationChannels",
|
|
201
|
+
"widget",
|
|
202
|
+
"insight",
|
|
203
|
+
"isLoading",
|
|
204
|
+
]) {
|
|
205
|
+
expect(fixtures.dialogProps?.[prop]).toBeUndefined();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
it("renders the management dialog without the deprecated data props", () => {
|
|
209
|
+
fixtures.automationsError = new Error("automations failed to load");
|
|
210
|
+
render(_jsx(AlertingConnector, {}));
|
|
211
|
+
expect(fixtures.managementDialogProps).toBeDefined();
|
|
212
|
+
expect(fixtures.managementDialogProps?.["automations"]).toBeUndefined();
|
|
213
|
+
expect(fixtures.managementDialogProps?.["notificationChannels"]).toBeUndefined();
|
|
214
|
+
expect(fixtures.managementDialogProps?.["alertDataError"]).toBeUndefined();
|
|
215
|
+
expect(fixtures.managementDialogProps?.["isLoadingAlertingData"]).toBeUndefined();
|
|
216
|
+
});
|
|
151
217
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduledEmailConnector.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/connectors/ScheduledEmailConnector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"ScheduledEmailConnector.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/connectors/ScheduledEmailConnector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AA4CnE;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,CAGrG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,IAAI,YAAY,GAAG,IAAI,CAM7D"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { isWidget, } from "@gooddata/sdk-model";
|
|
3
5
|
import { getAutomationDashboardFilters, getAutomationVisualizationFilters, } from "../../../_staging/automation/index.js";
|
|
4
6
|
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
5
7
|
import { useDashboardScheduledEmails } from "../../../model/react/useDasboardScheduledEmails/useDashboardScheduledEmails.js";
|
|
@@ -16,6 +18,9 @@ import { useBuildAutomationsContext } from "./hooks/useBuildAutomationsContext.j
|
|
|
16
18
|
import { useBuildScheduledEmailDialogContext } from "./hooks/useBuildScheduledEmailDialogContext.js";
|
|
17
19
|
import { useBuildScheduledEmailManagementDialogContext } from "./hooks/useBuildScheduledEmailManagementDialogContext.js";
|
|
18
20
|
import { useWidgetAutomationFilters } from "./hooks/useWidgetAutomationFilters.js";
|
|
21
|
+
// Stable placeholder so useBuildScheduledEmailDialogContext's useMemo does not see a fresh array
|
|
22
|
+
// (and therefore a new context identity) on every render.
|
|
23
|
+
const EMPTY_USERS = [];
|
|
19
24
|
/**
|
|
20
25
|
* Provides AutomationsContext to its children, built from dashboard Redux state.
|
|
21
26
|
* Wraps the scheduled-email dialog subtree (both the create/edit and management dialogs reach
|
|
@@ -62,7 +67,7 @@ function ScheduledEmailConnectorWithData({ se }) {
|
|
|
62
67
|
// Shared Local State
|
|
63
68
|
scheduledExportToEdit,
|
|
64
69
|
// Data
|
|
65
|
-
automations,
|
|
70
|
+
automations, automationsLoading, notificationChannels,
|
|
66
71
|
// Single Schedule Dialog
|
|
67
72
|
isScheduleEmailingDialogOpen, onScheduleEmailingCancel, onScheduleEmailingBack, onScheduleEmailingCreateSuccess, onScheduleEmailingCreateError, onScheduleEmailingSaveSuccess, onScheduleEmailingSaveError,
|
|
68
73
|
// Management / List Dialog
|
|
@@ -72,42 +77,35 @@ function ScheduledEmailConnectorWithData({ se }) {
|
|
|
72
77
|
const automationDefaultSelectedFilters = useDashboardSelector(selectAutomationDefaultSelectedFilters);
|
|
73
78
|
const dashboardHiddenFilters = useDashboardSelector(selectDashboardHiddenFilters);
|
|
74
79
|
const { executionFilters: savedWidgetFilters } = getAutomationVisualizationFilters(scheduledExportToEdit);
|
|
75
|
-
const
|
|
76
|
-
const { result: liveWidgetFilters, status: widgetFiltersStatus, error: widgetFiltersError, } = useWidgetAutomationFilters(widget, insight);
|
|
77
|
-
const widgetFilters = savedWidgetFilters ?? liveWidgetFilters;
|
|
80
|
+
const { status: widgetFiltersStatus } = useWidgetAutomationFilters(widget, insight);
|
|
78
81
|
const shouldLoadWidgetFilters = !!widget && !savedWidgetFilters;
|
|
79
|
-
const dashboardFilters =
|
|
80
|
-
getAppliedDashboardFilters(automationDefaultSelectedFilters, dashboardHiddenFilters, true);
|
|
82
|
+
const dashboardFilters = useMemo(() => getAutomationDashboardFilters(scheduledExportToEdit) ??
|
|
83
|
+
getAppliedDashboardFilters(automationDefaultSelectedFilters, dashboardHiddenFilters, true), [scheduledExportToEdit, automationDefaultSelectedFilters, dashboardHiddenFilters]);
|
|
81
84
|
const isLoading = automationsLoading ||
|
|
82
85
|
(shouldLoadWidgetFilters && (widgetFiltersStatus === "pending" || widgetFiltersStatus === "running"));
|
|
83
|
-
const loadingError = (shouldLoadWidgetFilters ? widgetFiltersError : undefined) ?? automationsError;
|
|
84
86
|
const insightWidget = isWidget(widget) ? widget : undefined;
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
insight,
|
|
88
|
-
});
|
|
89
|
-
const managementCtx = useBuildScheduledEmailManagementDialogContext();
|
|
90
|
-
return (_jsxs(ScheduledEmailDialogContextProvider, { value: seCtx, children: [
|
|
91
|
-
_jsx(ScheduledEmailManagementDialogContextProvider, { value: managementCtx, children: isScheduleEmailingManagementDialogOpen ? (
|
|
92
|
-
// TODO(GDP-3167 phase3): automations, notificationChannels, and scheduleDataError
|
|
93
|
-
// are still prop-threaded here because DefaultScheduledEmailManagementDialog reads
|
|
94
|
-
// them from props, not from AutomationsContext. Once all dialog fields are migrated
|
|
95
|
-
// to read from context, remove these props and the corresponding prop types.
|
|
96
|
-
_jsx(ScheduledEmailManagementDialog, { automations: automations, notificationChannels: notificationChannels, scheduleDataError: loadingError, isLoadingScheduleData: isLoading, onAdd: onScheduleEmailingManagementAdd, onEdit: handleManagementEdit, onClose: onScheduleEmailingManagementClose, onDeleteSuccess: onScheduleEmailingManagementDeleteSuccess, onDeleteError: onScheduleEmailingManagementDeleteError })) : null }), isScheduleEmailingDialogOpen ? (
|
|
97
|
-
// TODO(GDP-3167 phase3): notificationChannels, users, usersError, widgetFilters,
|
|
98
|
-
// dashboardFilters, and isLoading are still prop-threaded here because
|
|
99
|
-
// DefaultScheduledEmailDialog reads them from props, not from context.
|
|
100
|
-
// Once all dialog fields are migrated to read from context, remove these props
|
|
101
|
-
// and the corresponding prop types.
|
|
102
|
-
_jsx(ScheduledEmailDialogWithUsers, { scheduledExportToEdit: scheduledExportToEdit, notificationChannels: notificationChannels, widget: insightWidget, insight: insight, widgetFilters: widgetFilters, dashboardFilters: dashboardFilters, isLoading: isLoading, onBack: onScheduleEmailingBack, onCancel: onScheduleEmailingCancel, onError: onScheduleEmailingCreateError, onSuccess: onScheduleEmailingCreateSuccess, onSaveError: onScheduleEmailingSaveError, onSaveSuccess: onScheduleEmailingSaveSuccess, onDeleteSuccess: onScheduleEmailingManagementDeleteSuccess, onDeleteError: onScheduleEmailingManagementDeleteError })) : null] }));
|
|
87
|
+
const managementCtx = useBuildScheduledEmailManagementDialogContext({ automations, isLoading });
|
|
88
|
+
return (_jsxs(ScheduledEmailManagementDialogContextProvider, { value: managementCtx, children: [isScheduleEmailingManagementDialogOpen ? (_jsx(ScheduledEmailManagementDialog, { onAdd: onScheduleEmailingManagementAdd, onEdit: handleManagementEdit, onClose: onScheduleEmailingManagementClose, onDeleteSuccess: onScheduleEmailingManagementDeleteSuccess, onDeleteError: onScheduleEmailingManagementDeleteError })) : null, isScheduleEmailingDialogOpen ? (_jsx(ScheduledEmailCreateEditConnector, { scheduledExportToEdit: scheduledExportToEdit, notificationChannels: notificationChannels, widget: insightWidget, insight: insight, dashboardFilters: dashboardFilters, isLoading: isLoading, onBack: onScheduleEmailingBack, onCancel: onScheduleEmailingCancel, onError: onScheduleEmailingCreateError, onSuccess: onScheduleEmailingCreateSuccess, onSaveError: onScheduleEmailingSaveError, onSaveSuccess: onScheduleEmailingSaveSuccess, onDeleteSuccess: onScheduleEmailingManagementDeleteSuccess, onDeleteError: onScheduleEmailingManagementDeleteError })) : null] }));
|
|
103
89
|
}
|
|
104
90
|
/**
|
|
105
|
-
* Loads workspace users
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* dispatches the workspace-users load, matching the pre-separation behavior.
|
|
91
|
+
* Loads workspace users and hydrates the scheduled-email create/edit context. Both live here
|
|
92
|
+
* rather than in the parent so that opening only the management dialog — which consumes
|
|
93
|
+
* neither — never dispatches the workspace-users load.
|
|
109
94
|
*/
|
|
110
|
-
function
|
|
95
|
+
function ScheduledEmailCreateEditConnector(props) {
|
|
96
|
+
const { scheduledExportToEdit, notificationChannels, widget, insight, dashboardFilters, isLoading: isDataLoading, onBack, onCancel, onError, onSuccess, onSaveError, onSaveSuccess, onDeleteSuccess, onDeleteError, } = props;
|
|
111
97
|
const { users, status: usersStatus, usersError } = useWorkspaceUsers();
|
|
112
|
-
|
|
98
|
+
const isLoading = isDataLoading || usersStatus === "pending" || usersStatus === "loading";
|
|
99
|
+
const effectiveUsers = users ?? EMPTY_USERS;
|
|
100
|
+
const seCtx = useBuildScheduledEmailDialogContext({
|
|
101
|
+
widget,
|
|
102
|
+
insight,
|
|
103
|
+
scheduledExportToEdit,
|
|
104
|
+
users: effectiveUsers,
|
|
105
|
+
usersError,
|
|
106
|
+
notificationChannels,
|
|
107
|
+
dashboardFilters,
|
|
108
|
+
isLoading,
|
|
109
|
+
});
|
|
110
|
+
return (_jsx(ScheduledEmailDialogContextProvider, { value: seCtx, children: _jsx(ScheduledEmailDialog, { onBack: onBack, onCancel: onCancel, onError: onError, onSuccess: onSuccess, onSaveError: onSaveError, onSaveSuccess: onSaveSuccess, onDeleteSuccess: onDeleteSuccess, onDeleteError: onDeleteError }) }));
|
|
113
111
|
}
|
|
@@ -7,16 +7,41 @@ const fixtures = vi.hoisted(() => {
|
|
|
7
7
|
const navigate = vi.fn();
|
|
8
8
|
const onScheduleEmailingManagementEdit = vi.fn();
|
|
9
9
|
let managementDialogProps;
|
|
10
|
+
let dialogProps;
|
|
11
|
+
let automationsError;
|
|
12
|
+
const useWorkspaceUsers = vi.fn(() => ({
|
|
13
|
+
users: [],
|
|
14
|
+
status: "success",
|
|
15
|
+
usersError: new Error("users failed to load"),
|
|
16
|
+
}));
|
|
17
|
+
const seState = {
|
|
18
|
+
isScheduleEmailingDialogOpen: false,
|
|
19
|
+
isScheduleEmailingManagementDialogOpen: true,
|
|
20
|
+
};
|
|
10
21
|
return {
|
|
11
22
|
buildAutomationUrl,
|
|
12
23
|
navigate,
|
|
13
24
|
onScheduleEmailingManagementEdit,
|
|
25
|
+
useWorkspaceUsers,
|
|
26
|
+
seState,
|
|
14
27
|
get managementDialogProps() {
|
|
15
28
|
return managementDialogProps;
|
|
16
29
|
},
|
|
17
30
|
set managementDialogProps(value) {
|
|
18
31
|
managementDialogProps = value;
|
|
19
32
|
},
|
|
33
|
+
get dialogProps() {
|
|
34
|
+
return dialogProps;
|
|
35
|
+
},
|
|
36
|
+
set dialogProps(value) {
|
|
37
|
+
dialogProps = value;
|
|
38
|
+
},
|
|
39
|
+
get automationsError() {
|
|
40
|
+
return automationsError;
|
|
41
|
+
},
|
|
42
|
+
set automationsError(value) {
|
|
43
|
+
automationsError = value;
|
|
44
|
+
},
|
|
20
45
|
};
|
|
21
46
|
});
|
|
22
47
|
vi.mock("@gooddata/sdk-ui", () => ({
|
|
@@ -30,11 +55,17 @@ vi.mock("../../../model/react/DashboardStoreProvider.js", () => ({
|
|
|
30
55
|
vi.mock("../../../model/react/useDasboardScheduledEmails/useDashboardScheduledEmails.js", () => ({
|
|
31
56
|
useDashboardScheduledEmails: () => ({
|
|
32
57
|
isInitialized: true,
|
|
33
|
-
isScheduleEmailingDialogOpen
|
|
34
|
-
|
|
35
|
-
|
|
58
|
+
get isScheduleEmailingDialogOpen() {
|
|
59
|
+
return fixtures.seState.isScheduleEmailingDialogOpen;
|
|
60
|
+
},
|
|
61
|
+
get isScheduleEmailingManagementDialogOpen() {
|
|
62
|
+
return fixtures.seState.isScheduleEmailingManagementDialogOpen;
|
|
63
|
+
},
|
|
64
|
+
scheduledExportToEdit: { id: "se-existing", title: "Existing schedule" },
|
|
36
65
|
automations: [],
|
|
37
|
-
automationsError
|
|
66
|
+
get automationsError() {
|
|
67
|
+
return fixtures.automationsError;
|
|
68
|
+
},
|
|
38
69
|
automationsLoading: false,
|
|
39
70
|
notificationChannels: [],
|
|
40
71
|
onScheduleEmailingCancel: vi.fn(),
|
|
@@ -48,12 +79,12 @@ vi.mock("../../../model/react/useDasboardScheduledEmails/useDashboardScheduledEm
|
|
|
48
79
|
onScheduleEmailingManagementEdit: fixtures.onScheduleEmailingManagementEdit,
|
|
49
80
|
onScheduleEmailingManagementDeleteSuccess: vi.fn(),
|
|
50
81
|
onScheduleEmailingManagementDeleteError: vi.fn(),
|
|
51
|
-
widget:
|
|
52
|
-
insight:
|
|
82
|
+
widget: { type: "insight", ref: { identifier: "widget-1" } },
|
|
83
|
+
insight: { insight: { identifier: "insight-1", title: "Insight" } },
|
|
53
84
|
}),
|
|
54
85
|
}));
|
|
55
86
|
vi.mock("../../../model/react/useWorkspaceUsers.js", () => ({
|
|
56
|
-
useWorkspaceUsers:
|
|
87
|
+
useWorkspaceUsers: fixtures.useWorkspaceUsers,
|
|
57
88
|
}));
|
|
58
89
|
vi.mock("../../../model/store/config/configSelectors.js", () => ({
|
|
59
90
|
selectExternalRecipient: () => "recipient@example.com",
|
|
@@ -84,7 +115,10 @@ vi.mock("../../../model/store/ui/uiSelectors.js", () => ({
|
|
|
84
115
|
selectAutomationsInvalidationId: () => 0,
|
|
85
116
|
}));
|
|
86
117
|
vi.mock("../scheduledEmail/ScheduledEmailDialog.js", () => ({
|
|
87
|
-
ScheduledEmailDialog: () =>
|
|
118
|
+
ScheduledEmailDialog: (props) => {
|
|
119
|
+
fixtures.dialogProps = props;
|
|
120
|
+
return null;
|
|
121
|
+
},
|
|
88
122
|
}));
|
|
89
123
|
vi.mock("../scheduledEmail/ScheduledEmailManagementDialog.js", () => ({
|
|
90
124
|
ScheduledEmailManagementDialog: (props) => {
|
|
@@ -115,7 +149,7 @@ vi.mock("./hooks/useWidgetAutomationFilters.js", () => ({
|
|
|
115
149
|
}));
|
|
116
150
|
vi.mock("../../../_staging/automation/index.js", () => ({
|
|
117
151
|
getAutomationDashboardFilters: () => undefined,
|
|
118
|
-
getAutomationVisualizationFilters: () => ({ executionFilters:
|
|
152
|
+
getAutomationVisualizationFilters: () => ({ executionFilters: [] }),
|
|
119
153
|
}));
|
|
120
154
|
vi.mock("../scheduledEmail/utils/filters.js", () => ({
|
|
121
155
|
getAppliedDashboardFilters: () => [],
|
|
@@ -127,6 +161,11 @@ describe("ScheduledEmailConnector", () => {
|
|
|
127
161
|
fixtures.navigate.mockClear();
|
|
128
162
|
fixtures.onScheduleEmailingManagementEdit.mockClear();
|
|
129
163
|
fixtures.managementDialogProps = undefined;
|
|
164
|
+
fixtures.dialogProps = undefined;
|
|
165
|
+
fixtures.automationsError = undefined;
|
|
166
|
+
fixtures.useWorkspaceUsers.mockClear();
|
|
167
|
+
fixtures.seState.isScheduleEmailingDialogOpen = false;
|
|
168
|
+
fixtures.seState.isScheduleEmailingManagementDialogOpen = true;
|
|
130
169
|
});
|
|
131
170
|
it("navigates cross-dashboard when editing a schedule on another dashboard in shell mode", () => {
|
|
132
171
|
render(_jsx(ScheduledEmailConnector, {}));
|
|
@@ -161,4 +200,46 @@ describe("ScheduledEmailConnector", () => {
|
|
|
161
200
|
dashboard: undefined,
|
|
162
201
|
});
|
|
163
202
|
});
|
|
203
|
+
it("does not load workspace users when only the management dialog is open", () => {
|
|
204
|
+
render(_jsx(ScheduledEmailConnector, {}));
|
|
205
|
+
expect(fixtures.useWorkspaceUsers).not.toHaveBeenCalled();
|
|
206
|
+
});
|
|
207
|
+
it("loads workspace users when the create/edit dialog is open", () => {
|
|
208
|
+
fixtures.seState.isScheduleEmailingDialogOpen = true;
|
|
209
|
+
fixtures.seState.isScheduleEmailingManagementDialogOpen = false;
|
|
210
|
+
render(_jsx(ScheduledEmailConnector, {}));
|
|
211
|
+
expect(fixtures.useWorkspaceUsers).toHaveBeenCalled();
|
|
212
|
+
});
|
|
213
|
+
it("does not supply the deprecated data props to the create/edit dialog", () => {
|
|
214
|
+
fixtures.seState.isScheduleEmailingDialogOpen = true;
|
|
215
|
+
fixtures.seState.isScheduleEmailingManagementDialogOpen = false;
|
|
216
|
+
render(_jsx(ScheduledEmailConnector, {}));
|
|
217
|
+
expect(fixtures.dialogProps).toBeDefined();
|
|
218
|
+
for (const prop of [
|
|
219
|
+
"scheduledExportToEdit",
|
|
220
|
+
"users",
|
|
221
|
+
"usersError",
|
|
222
|
+
"notificationChannels",
|
|
223
|
+
"widget",
|
|
224
|
+
"insight",
|
|
225
|
+
"dashboardFilters",
|
|
226
|
+
"widgetFilters",
|
|
227
|
+
"isLoading",
|
|
228
|
+
]) {
|
|
229
|
+
expect(fixtures.dialogProps?.[prop]).toBeUndefined();
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
it("does not supply the deprecated data props to the management dialog", () => {
|
|
233
|
+
fixtures.automationsError = new Error("automations failed to load");
|
|
234
|
+
render(_jsx(ScheduledEmailConnector, {}));
|
|
235
|
+
expect(fixtures.managementDialogProps).toBeDefined();
|
|
236
|
+
for (const prop of [
|
|
237
|
+
"automations",
|
|
238
|
+
"isLoadingScheduleData",
|
|
239
|
+
"notificationChannels",
|
|
240
|
+
"scheduleDataError",
|
|
241
|
+
]) {
|
|
242
|
+
expect(fixtures.managementDialogProps?.[prop]).toBeUndefined();
|
|
243
|
+
}
|
|
244
|
+
});
|
|
164
245
|
});
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { type IInsight, type IWidget } from "@gooddata/sdk-model";
|
|
1
|
+
import { type IAutomationMetadataObject, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget, type IWorkspaceUser } from "@gooddata/sdk-model";
|
|
2
|
+
import type { GoodDataSdkError } from "@gooddata/sdk-ui";
|
|
2
3
|
import type { IAlertingDialogContextValue } from "../../contexts/AlertingDialogContext.js";
|
|
3
4
|
export interface IUseBuildAlertingDialogContextOpts {
|
|
4
5
|
mode: "create" | "edit";
|
|
5
6
|
widget?: IWidget;
|
|
6
7
|
insight?: IInsight;
|
|
8
|
+
alertToEdit?: IAutomationMetadataObject;
|
|
9
|
+
users: IWorkspaceUser[];
|
|
10
|
+
usersError?: GoodDataSdkError;
|
|
11
|
+
notificationChannels: INotificationChannelIdentifier[] | INotificationChannelMetadataObject[];
|
|
12
|
+
isLoading: boolean;
|
|
7
13
|
}
|
|
8
14
|
export declare function useBuildAlertingDialogContext(opts: IUseBuildAlertingDialogContextOpts): IAlertingDialogContextValue;
|
|
9
15
|
//# sourceMappingURL=useBuildAlertingDialogContext.d.ts.map
|
package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuildAlertingDialogContext.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"useBuildAlertingDialogContext.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACZ,KAAK,cAAc,EAEtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiBzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAI3F,MAAM,WAAW,kCAAkC;IAC/C,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAC9F,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,6BAA6B,CACzC,IAAI,EAAE,kCAAkC,GACzC,2BAA2B,CAsG7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { useCallback, useMemo, useRef } from "react";
|
|
3
|
-
import { serializeObjRef } from "@gooddata/sdk-model";
|
|
3
|
+
import { serializeObjRef, } from "@gooddata/sdk-model";
|
|
4
4
|
import { createAlert as createAlertCmd, saveAlert as saveAlertCmd, } from "../../../../model/commands/alerts.js";
|
|
5
5
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
6
6
|
import { selectExecutionResultEntities } from "../../../../model/store/executionResults/executionResultsSelectors.js";
|
|
@@ -11,7 +11,7 @@ import { selectEffectiveParameterValuesForWidget } from "../../../../model/store
|
|
|
11
11
|
import { getWidgetTitle } from "../../../../model/utils/dashboardItemUtils.js";
|
|
12
12
|
import { useCommandAsPromise, useDeleteAutomation } from "./useCommandAsPromise.js";
|
|
13
13
|
export function useBuildAlertingDialogContext(opts) {
|
|
14
|
-
const { mode, widget, insight } = opts;
|
|
14
|
+
const { mode, widget, insight, alertToEdit, users, usersError, notificationChannels, isLoading } = opts;
|
|
15
15
|
const dashboardFilters = useDashboardSelector(selectAutomationDefaultSelectedFilters);
|
|
16
16
|
const hiddenFilters = useDashboardSelector(selectDashboardHiddenFilters);
|
|
17
17
|
const dashboardId = useDashboardSelector(selectDashboardId);
|
|
@@ -69,6 +69,11 @@ export function useBuildAlertingDialogContext(opts) {
|
|
|
69
69
|
createAlert,
|
|
70
70
|
saveAlert,
|
|
71
71
|
deleteAlert,
|
|
72
|
+
alertToEdit,
|
|
73
|
+
users,
|
|
74
|
+
usersError,
|
|
75
|
+
notificationChannels,
|
|
76
|
+
isLoading,
|
|
72
77
|
}), [
|
|
73
78
|
mode,
|
|
74
79
|
widget,
|
|
@@ -85,5 +90,10 @@ export function useBuildAlertingDialogContext(opts) {
|
|
|
85
90
|
createAlert,
|
|
86
91
|
saveAlert,
|
|
87
92
|
deleteAlert,
|
|
93
|
+
alertToEdit,
|
|
94
|
+
users,
|
|
95
|
+
usersError,
|
|
96
|
+
notificationChannels,
|
|
97
|
+
isLoading,
|
|
88
98
|
]);
|
|
89
99
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { renderHook } from "@testing-library/react";
|
|
3
3
|
import { describe, expect, it, vi } from "vitest";
|
|
4
|
-
import { idRef } from "@gooddata/sdk-model";
|
|
4
|
+
import { idRef, } from "@gooddata/sdk-model";
|
|
5
5
|
const fixtures = vi.hoisted(() => {
|
|
6
6
|
// A single, referentially stable execution-result envelope, simulating an
|
|
7
7
|
// unchanged normalized store entity across renders.
|
|
@@ -52,7 +52,12 @@ import { useBuildAlertingDialogContext } from "./useBuildAlertingDialogContext.j
|
|
|
52
52
|
describe("useBuildAlertingDialogContext", () => {
|
|
53
53
|
it("returns a referentially stable execution-result envelope across renders (no render loop)", () => {
|
|
54
54
|
const ref = idRef("widget-1");
|
|
55
|
-
const { result, rerender } = renderHook(() => useBuildAlertingDialogContext({
|
|
55
|
+
const { result, rerender } = renderHook(() => useBuildAlertingDialogContext({
|
|
56
|
+
mode: "create",
|
|
57
|
+
users: [],
|
|
58
|
+
notificationChannels: [],
|
|
59
|
+
isLoading: false,
|
|
60
|
+
}));
|
|
56
61
|
const first = result.current.executionResultByRef(ref);
|
|
57
62
|
rerender();
|
|
58
63
|
const second = result.current.executionResultByRef(ref);
|
|
@@ -63,4 +68,25 @@ describe("useBuildAlertingDialogContext", () => {
|
|
|
63
68
|
expect(second).toBe(first);
|
|
64
69
|
expect(first?.executionResult).toBe(fixtures.stableEnvelope.executionResult);
|
|
65
70
|
});
|
|
71
|
+
it("passes the create/edit inputs through to the context unchanged", () => {
|
|
72
|
+
const alertToEdit = { id: "alert-1", title: "My alert" };
|
|
73
|
+
const users = [
|
|
74
|
+
{ ref: idRef("user-1"), uri: "/users/user-1", login: "user-1", email: "user-1@example.com" },
|
|
75
|
+
];
|
|
76
|
+
const notificationChannels = [
|
|
77
|
+
{ id: "channel-1", type: "notificationChannel" },
|
|
78
|
+
];
|
|
79
|
+
const { result } = renderHook(() => useBuildAlertingDialogContext({
|
|
80
|
+
mode: "edit",
|
|
81
|
+
alertToEdit,
|
|
82
|
+
users,
|
|
83
|
+
usersError: undefined,
|
|
84
|
+
notificationChannels,
|
|
85
|
+
isLoading: true,
|
|
86
|
+
}));
|
|
87
|
+
expect(result.current.alertToEdit).toBe(alertToEdit);
|
|
88
|
+
expect(result.current.users).toBe(users);
|
|
89
|
+
expect(result.current.notificationChannels).toBe(notificationChannels);
|
|
90
|
+
expect(result.current.isLoading).toBe(true);
|
|
91
|
+
});
|
|
66
92
|
});
|
package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { type IInsight, type IWidget } from "@gooddata/sdk-model";
|
|
1
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget, type IWorkspaceUser } from "@gooddata/sdk-model";
|
|
2
|
+
import type { GoodDataSdkError } from "@gooddata/sdk-ui";
|
|
2
3
|
import type { IScheduledEmailDialogContextValue } from "../../contexts/ScheduledEmailDialogContext.js";
|
|
3
4
|
export interface IUseBuildScheduledEmailDialogContextOpts {
|
|
4
5
|
widget?: IWidget;
|
|
5
6
|
insight?: IInsight;
|
|
7
|
+
scheduledExportToEdit?: IAutomationMetadataObject;
|
|
8
|
+
users: IWorkspaceUser[];
|
|
9
|
+
usersError?: GoodDataSdkError;
|
|
10
|
+
notificationChannels: INotificationChannelIdentifier[] | INotificationChannelMetadataObject[];
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
dashboardFilters?: FilterContextItem[];
|
|
6
13
|
}
|
|
7
14
|
export declare function useBuildScheduledEmailDialogContext(opts: IUseBuildScheduledEmailDialogContextOpts): IScheduledEmailDialogContextValue;
|
|
8
15
|
//# sourceMappingURL=useBuildScheduledEmailDialogContext.d.ts.map
|
package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuildScheduledEmailDialogContext.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"useBuildScheduledEmailDialogContext.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACZ,KAAK,cAAc,EAEtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAuBzD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAIvG,MAAM,WAAW,wCAAwC;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAC9F,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC1C;AAED,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,wCAAwC,GAC/C,iCAAiC,CA2GnC"}
|
package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js
CHANGED
|
@@ -6,7 +6,7 @@ import { useDashboardSelector } from "../../../../model/react/DashboardStoreProv
|
|
|
6
6
|
import { useExportTemplates } from "../../../../model/react/useExportTemplates.js";
|
|
7
7
|
import { selectDateFormat } from "../../../../model/store/config/configSelectors.js";
|
|
8
8
|
import { selectIsCrossFiltering } from "../../../../model/store/drill/drillSelectors.js";
|
|
9
|
-
import { selectAutomationCommonDateFilterId,
|
|
9
|
+
import { selectAutomationCommonDateFilterId, selectDashboardHiddenFilters, } from "../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
10
10
|
import { selectDashboardId, selectDashboardTitle } from "../../../../model/store/meta/metaSelectors.js";
|
|
11
11
|
import { selectEffectiveAttributeFiltersModeMap } from "../../../../model/store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
|
|
12
12
|
import { selectEffectiveDateFilterMode } from "../../../../model/store/tabs/dateFilterConfig/dateFilterConfigSelectors.js";
|
|
@@ -17,8 +17,7 @@ import { selectTabs } from "../../../../model/store/tabs/tabsSelectors.js";
|
|
|
17
17
|
import { getWidgetTitle } from "../../../../model/utils/dashboardItemUtils.js";
|
|
18
18
|
import { useCommandAsPromise, useDeleteAutomation } from "./useCommandAsPromise.js";
|
|
19
19
|
export function useBuildScheduledEmailDialogContext(opts) {
|
|
20
|
-
const { widget, insight } = opts;
|
|
21
|
-
const dashboardFilters = useDashboardSelector(selectAutomationDefaultSelectedFilters);
|
|
20
|
+
const { widget, insight, scheduledExportToEdit, users, usersError, notificationChannels, isLoading, dashboardFilters, } = opts;
|
|
22
21
|
const hiddenFilters = useDashboardSelector(selectDashboardHiddenFilters);
|
|
23
22
|
const dashboardId = useDashboardSelector(selectDashboardId);
|
|
24
23
|
const dashboardTitle = useDashboardSelector(selectDashboardTitle);
|
|
@@ -71,6 +70,11 @@ export function useBuildScheduledEmailDialogContext(opts) {
|
|
|
71
70
|
createScheduledEmail,
|
|
72
71
|
saveScheduledEmail,
|
|
73
72
|
deleteScheduledEmail,
|
|
73
|
+
scheduledExportToEdit,
|
|
74
|
+
users,
|
|
75
|
+
usersError,
|
|
76
|
+
notificationChannels,
|
|
77
|
+
isLoading,
|
|
74
78
|
}), [
|
|
75
79
|
widget,
|
|
76
80
|
insight,
|
|
@@ -92,5 +96,10 @@ export function useBuildScheduledEmailDialogContext(opts) {
|
|
|
92
96
|
createScheduledEmail,
|
|
93
97
|
saveScheduledEmail,
|
|
94
98
|
deleteScheduledEmail,
|
|
99
|
+
scheduledExportToEdit,
|
|
100
|
+
users,
|
|
101
|
+
usersError,
|
|
102
|
+
notificationChannels,
|
|
103
|
+
isLoading,
|
|
95
104
|
]);
|
|
96
105
|
}
|