@gooddata/sdk-ui-dashboard 11.36.0-alpha.3 → 11.36.0-alpha.6

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.
Files changed (162) hide show
  1. package/NOTICE +63 -115
  2. package/esm/__version.d.ts +1 -1
  3. package/esm/__version.js +1 -1
  4. package/esm/index.d.ts +5 -13
  5. package/esm/index.js +2 -10
  6. package/esm/internal.d.ts +1 -1
  7. package/esm/model/commandHandlers/dashboard/common/filterViews.js +24 -1
  8. package/esm/model/commandHandlers/dashboard/common/parameterHydration.d.ts +7 -1
  9. package/esm/model/commandHandlers/dashboard/common/parameterHydration.js +16 -2
  10. package/esm/model/commandHandlers/dashboard/common/stateInitializers.js +4 -2
  11. package/esm/model/commandHandlers/drill/resolveDrillToCustomUrl.d.ts +7 -1
  12. package/esm/model/commandHandlers/drill/resolveDrillToCustomUrl.js +80 -4
  13. package/esm/model/commandHandlers/filterContext/filterViewHandler.js +10 -0
  14. package/esm/model/commandHandlers/filterContext/filterViewParameters.d.ts +7 -0
  15. package/esm/model/commandHandlers/filterContext/filterViewParameters.js +11 -0
  16. package/esm/model/store/config/configSelectors.d.ts +0 -6
  17. package/esm/model/store/config/configSelectors.js +0 -8
  18. package/esm/model/store/tabs/index.d.ts +4 -0
  19. package/esm/model/store/tabs/parameters/parametersReducers.d.ts +11 -1
  20. package/esm/model/store/tabs/parameters/parametersReducers.js +16 -8
  21. package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +7 -0
  22. package/esm/model/store/tabs/parameters/parametersSelectors.js +17 -0
  23. package/esm/model/types/commonTypes.d.ts +11 -2
  24. package/esm/model/utils/measureValueFilterUtils.d.ts +14 -0
  25. package/esm/model/utils/measureValueFilterUtils.js +21 -0
  26. package/esm/presentation/alerting/DefaultAlertingDialog/{DefaultAlertingDialogNew.d.ts → DefaultAlertingDialog.d.ts} +1 -1
  27. package/esm/presentation/alerting/DefaultAlertingDialog/{DefaultAlertingDialogNew.js → DefaultAlertingDialog.js} +6 -12
  28. package/esm/presentation/alerting/DefaultAlertingDialog/components/AlertAttributeSelect.js +43 -9
  29. package/esm/presentation/alerting/DefaultAlertingDialog/hooks/useSaveAlertToBackend.js +13 -25
  30. package/esm/presentation/alerting/types.d.ts +1 -72
  31. package/esm/presentation/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts +1 -2
  32. package/esm/presentation/automationFilters/hooks/useValidateExistingAutomationFilters.js +5 -5
  33. package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.js +1 -8
  34. package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.js +17 -8
  35. package/esm/presentation/dashboard/DashboardHeader/ShareDialogDashboardHeader.js +5 -2
  36. package/esm/presentation/dashboard/components/DashboardRenderer.js +2 -2
  37. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditor.js +97 -13
  38. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParameters.d.ts +1 -1
  39. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParameters.js +3 -3
  40. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/DashboardParametersSection.d.ts +3 -2
  41. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/DashboardParametersSection.js +17 -4
  42. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/InsightParametersSection.d.ts +4 -2
  43. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/InsightParametersSection.js +37 -4
  44. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/Parameter.d.ts +4 -3
  45. package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/Parameter.js +3 -4
  46. package/esm/presentation/filterBar/attributeFilter/DefaultDashboardAttributeFilter.js +4 -1
  47. package/esm/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.js +4 -1
  48. package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +2 -9
  49. package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +2 -9
  50. package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +2 -9
  51. package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +2 -9
  52. package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +2 -9
  53. package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +2 -9
  54. package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +4 -36
  55. package/esm/presentation/localization/bundles/en-US.localization-bundle.js +4 -36
  56. package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +2 -9
  57. package/esm/presentation/localization/bundles/es-419.localization-bundle.js +2 -9
  58. package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +2 -9
  59. package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +2 -9
  60. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +2 -9
  61. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +2 -9
  62. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +2 -9
  63. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +2 -9
  64. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +2 -9
  65. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +2 -9
  66. package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +2 -9
  67. package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +2 -9
  68. package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +2 -9
  69. package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +2 -9
  70. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +2 -9
  71. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +2 -9
  72. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +2 -9
  73. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +2 -9
  74. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +2 -9
  75. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +2 -9
  76. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +2 -9
  77. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +2 -9
  78. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +2 -9
  79. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +2 -9
  80. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +2 -9
  81. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +2 -9
  82. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +2 -9
  83. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +2 -9
  84. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +2 -9
  85. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +2 -9
  86. package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +2 -9
  87. package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +2 -9
  88. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +2 -9
  89. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +2 -9
  90. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +2 -9
  91. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +2 -9
  92. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +2 -9
  93. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +2 -9
  94. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +2 -9
  95. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +2 -9
  96. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +2 -9
  97. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +2 -9
  98. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +2 -9
  99. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +2 -9
  100. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +26 -59
  101. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +2 -6
  102. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +22 -104
  103. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.js +12 -33
  104. package/esm/presentation/scheduledEmail/hooks/useWidgetAutomationFilters.d.ts +3 -0
  105. package/esm/presentation/scheduledEmail/hooks/useWidgetAutomationFilters.js +46 -0
  106. package/esm/presentation/scheduledEmail/types.d.ts +1 -7
  107. package/esm/presentation/scheduledEmail/utils/filters.d.ts +2 -0
  108. package/esm/presentation/scheduledEmail/utils/filters.js +5 -0
  109. package/esm/presentation/shareDialog/DefaultShareDialog.d.ts +1 -1
  110. package/esm/presentation/shareDialog/DefaultShareDialog.js +2 -2
  111. package/esm/presentation/shareDialog/types.d.ts +5 -1
  112. package/esm/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.d.ts +2 -2
  113. package/esm/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.js +36 -5
  114. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js +2 -2
  115. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightWidgetAlerting.js +3 -6
  116. package/esm/presentation/widget/insight/configuration/InsightAlerts.js +1 -9
  117. package/esm/sdk-ui-dashboard.d.ts +28 -240
  118. package/package.json +20 -20
  119. package/esm/model/react/filtering/shared.d.ts +0 -6
  120. package/esm/model/react/filtering/shared.js +0 -38
  121. package/esm/model/react/filtering/useAutomationAvailableDashboardFilters.d.ts +0 -13
  122. package/esm/model/react/filtering/useAutomationAvailableDashboardFilters.js +0 -54
  123. package/esm/model/react/filtering/useDashboardScheduledExportFilters.d.ts +0 -19
  124. package/esm/model/react/filtering/useDashboardScheduledExportFilters.js +0 -18
  125. package/esm/model/react/filtering/useScheduledExportFilters.d.ts +0 -26
  126. package/esm/model/react/filtering/useScheduledExportFilters.js +0 -23
  127. package/esm/model/react/filtering/useWidgetAlertFilters.d.ts +0 -33
  128. package/esm/model/react/filtering/useWidgetAlertFilters.js +0 -48
  129. package/esm/model/react/filtering/useWidgetScheduledExportFilters.d.ts +0 -33
  130. package/esm/model/react/filtering/useWidgetScheduledExportFilters.js +0 -48
  131. package/esm/model/react/useDashboardAlerting/useEnableAutomationFilterContext.d.ts +0 -4
  132. package/esm/model/react/useDashboardAlerting/useEnableAutomationFilterContext.js +0 -20
  133. package/esm/model/react/useDashboardAlertsOld.d.ts +0 -32
  134. package/esm/model/react/useDashboardAlertsOld.js +0 -141
  135. package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialogOld.d.ts +0 -5
  136. package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialogOld.js +0 -36
  137. package/esm/presentation/alerting/DefaultAlertingDialog/components/AlertAttributeSelectOld.d.ts +0 -17
  138. package/esm/presentation/alerting/DefaultAlertingDialog/components/AlertAttributeSelectOld.js +0 -103
  139. package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogOld.d.ts +0 -5
  140. package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogOld.js +0 -53
  141. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertOld.d.ts +0 -9
  142. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertOld.js +0 -84
  143. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsListOld.d.ts +0 -11
  144. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsListOld.js +0 -16
  145. package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProviderOld.d.ts +0 -1
  146. package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProviderOld.js +0 -12
  147. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFilters.d.ts +0 -29
  148. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFilters.js +0 -61
  149. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFiltersList.d.ts +0 -6
  150. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFiltersList.js +0 -12
  151. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentItems.d.ts +0 -17
  152. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentItems.js +0 -68
  153. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentsWrapper.d.ts +0 -4
  154. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentsWrapper.js +0 -6
  155. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/DashboardAttachments.d.ts +0 -15
  156. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/DashboardAttachments.js +0 -42
  157. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/WidgetAttachments.d.ts +0 -18
  158. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/WidgetAttachments.js +0 -25
  159. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/types.d.ts +0 -2
  160. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/types.js +0 -2
  161. package/esm/presentation/widget/insight/configuration/InsightAlertsOld.d.ts +0 -2
  162. package/esm/presentation/widget/insight/configuration/InsightAlertsOld.js +0 -43
@@ -1,33 +0,0 @@
1
- import { type IAutomationMetadataObjectDefinition, type IFilter, type IInsightDefinition } from "@gooddata/sdk-model";
2
- import { type FilterableDashboardWidget } from "../../types/layoutTypes.js";
3
- import { type QueryProcessingState } from "../useDashboardQueryProcessing.js";
4
- /**
5
- * @alpha
6
- */
7
- export interface IUseWidgetAlertFiltersProps {
8
- /**
9
- * Optionally provide metadata object to get filters from instead of the current widget filters.
10
- */
11
- alertToEdit?: IAutomationMetadataObjectDefinition;
12
- /**
13
- * Widget to get filters for.
14
- */
15
- widget?: FilterableDashboardWidget;
16
- /**
17
- * Insight to get filters for.
18
- */
19
- insight?: IInsightDefinition;
20
- }
21
- /**
22
- * Hook for getting filters for widget alert.
23
- *
24
- * Note:
25
- * - In case of existing widget alert, it returns the saved filters from the widget alert.
26
- * - Otherwise, it returns the filters ready to be saved in new widget alert, sanitized according to the following rules:
27
- * - Cross-filtering filters are excluded as they are typically not desired in the widget alert.
28
- * - The widget's ignored filters configuration is honored.
29
- *
30
- * @alpha
31
- * @deprecated - can be removed, once `enableAutomationFilterContext` is removed
32
- */
33
- export declare function useWidgetAlertFilters({ alertToEdit, widget, insight }: IUseWidgetAlertFiltersProps): QueryProcessingState<IFilter[]>;
@@ -1,48 +0,0 @@
1
- // (C) 2020-2026 GoodData Corporation
2
- import { selectCrossFilteringItems } from "../../store/drill/drillSelectors.js";
3
- import { useDashboardSelector } from "../DashboardStoreProvider.js";
4
- import { useWidgetFilters } from "../useWidgetFilters.js";
5
- import { sanitizeWidgetFilters } from "./shared.js";
6
- /**
7
- * Hook for getting filters for widget alert.
8
- *
9
- * Note:
10
- * - In case of existing widget alert, it returns the saved filters from the widget alert.
11
- * - Otherwise, it returns the filters ready to be saved in new widget alert, sanitized according to the following rules:
12
- * - Cross-filtering filters are excluded as they are typically not desired in the widget alert.
13
- * - The widget's ignored filters configuration is honored.
14
- *
15
- * @alpha
16
- * @deprecated - can be removed, once `enableAutomationFilterContext` is removed
17
- */
18
- export function useWidgetAlertFilters({ alertToEdit, widget, insight, }) {
19
- const newScheduledExportFiltersQuery = useFiltersForNewWidgetAlert(widget, insight);
20
- const existingWidgetScheduledExportFilters = alertToEdit?.alert?.execution?.filters;
21
- if (existingWidgetScheduledExportFilters) {
22
- return {
23
- result: existingWidgetScheduledExportFilters,
24
- error: undefined,
25
- status: "success",
26
- };
27
- }
28
- return newScheduledExportFiltersQuery;
29
- }
30
- /**
31
- * @internal
32
- */
33
- function useFiltersForNewWidgetAlert(widget, insight) {
34
- const widgetFiltersQuery = useWidgetFilters(widget, insight);
35
- const { result: widgetFilters, status: widgetFiltersStatus } = widgetFiltersQuery;
36
- const crossFilteringItems = useDashboardSelector(selectCrossFilteringItems);
37
- const sanitizedWidgetFilters = widgetFilters
38
- ? sanitizeWidgetFilters(widgetFilters, crossFilteringItems)
39
- : undefined;
40
- if (widgetFiltersStatus === "success" && sanitizedWidgetFilters) {
41
- return {
42
- result: sanitizedWidgetFilters,
43
- error: undefined,
44
- status: "success",
45
- };
46
- }
47
- return widgetFiltersQuery;
48
- }
@@ -1,33 +0,0 @@
1
- import { type IAutomationMetadataObjectDefinition, type IFilter, type IInsightDefinition } from "@gooddata/sdk-model";
2
- import { type FilterableDashboardWidget } from "../../types/layoutTypes.js";
3
- import { type QueryProcessingState } from "../useDashboardQueryProcessing.js";
4
- /**
5
- * @deprecated - can be removed, once `enableAutomationFilterContext` is removed
6
- * @alpha
7
- */
8
- export interface IUseWidgetScheduledExportFiltersProps {
9
- /**
10
- * Optionally provide metadata object to get filters from instead of the current widget filters.
11
- */
12
- scheduledExportToEdit?: IAutomationMetadataObjectDefinition;
13
- /**
14
- * Widget to get filters for.
15
- */
16
- widget?: FilterableDashboardWidget;
17
- /**
18
- * Insight to get filters for.
19
- */
20
- insight?: IInsightDefinition;
21
- }
22
- /**
23
- * Returns filters for widget scheduled export.
24
- *
25
- * - In case of existing scheduled export, it returns the saved filters from the scheduled export.
26
- * - Otherwise, it returns the filters ready to be saved in new scheduled export, sanitized according to the following rules:
27
- * - Cross-filtering filters are excluded as they are typically not desired in the scheduled export.
28
- * - The widget's ignored filters configuration is honored.
29
- *
30
- * @deprecated - can be removed, once `enableAutomationFilterContext` is removed
31
- * @alpha
32
- */
33
- export declare function useWidgetScheduledExportFilters({ scheduledExportToEdit, widget, insight }: IUseWidgetScheduledExportFiltersProps): QueryProcessingState<IFilter[]>;
@@ -1,48 +0,0 @@
1
- // (C) 2020-2026 GoodData Corporation
2
- import { getAutomationVisualizationFilters } from "../../../_staging/automation/index.js";
3
- import { selectCrossFilteringItems } from "../../store/drill/drillSelectors.js";
4
- import { useDashboardSelector } from "../DashboardStoreProvider.js";
5
- import { useWidgetFilters } from "../useWidgetFilters.js";
6
- import { sanitizeWidgetFilters } from "./shared.js";
7
- /**
8
- * Returns filters for widget scheduled export.
9
- *
10
- * - In case of existing scheduled export, it returns the saved filters from the scheduled export.
11
- * - Otherwise, it returns the filters ready to be saved in new scheduled export, sanitized according to the following rules:
12
- * - Cross-filtering filters are excluded as they are typically not desired in the scheduled export.
13
- * - The widget's ignored filters configuration is honored.
14
- *
15
- * @deprecated - can be removed, once `enableAutomationFilterContext` is removed
16
- * @alpha
17
- */
18
- export function useWidgetScheduledExportFilters({ scheduledExportToEdit, widget, insight, }) {
19
- const newScheduledExportFiltersQuery = useFiltersForNewWidgetScheduledExport(widget, insight);
20
- const { executionFilters: existingWidgetScheduledExportFilters } = getAutomationVisualizationFilters(scheduledExportToEdit);
21
- if (existingWidgetScheduledExportFilters) {
22
- return {
23
- result: existingWidgetScheduledExportFilters,
24
- error: undefined,
25
- status: "success",
26
- };
27
- }
28
- return newScheduledExportFiltersQuery;
29
- }
30
- /**
31
- * @internal
32
- */
33
- function useFiltersForNewWidgetScheduledExport(widget, insight) {
34
- const widgetFiltersQuery = useWidgetFilters(widget, insight);
35
- const { result: widgetFilters, status: widgetFiltersStatus } = widgetFiltersQuery;
36
- const crossFilteringItems = useDashboardSelector(selectCrossFilteringItems);
37
- const sanitizedWidgetFilters = widgetFilters
38
- ? sanitizeWidgetFilters(widgetFilters, crossFilteringItems)
39
- : undefined;
40
- if (widgetFiltersStatus === "success" && sanitizedWidgetFilters) {
41
- return {
42
- result: sanitizedWidgetFilters,
43
- error: undefined,
44
- status: "success",
45
- };
46
- }
47
- return widgetFiltersQuery;
48
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * @internal
3
- */
4
- export declare const useEnableAlertingAutomationFilterContext: () => boolean;
@@ -1,20 +0,0 @@
1
- // (C) 2019-2026 GoodData Corporation
2
- import { useMemo } from "react";
3
- import { dashboardFilterLocalIdentifier } from "@gooddata/sdk-model";
4
- import { selectEnableAutomationFilterContext } from "../../store/config/configSelectors.js";
5
- import { selectDashboardFiltersWithoutCrossFiltering } from "../../store/filtering/dashboardFilterSelectors.js";
6
- import { useDashboardSelector } from "../DashboardStoreProvider.js";
7
- const validateAllFilterLocalIdentifiers = (filters) => {
8
- return filters.every((filter) => dashboardFilterLocalIdentifier(filter) !== undefined);
9
- };
10
- /**
11
- * @internal
12
- */
13
- export const useEnableAlertingAutomationFilterContext = () => {
14
- const filters = useDashboardSelector(selectDashboardFiltersWithoutCrossFiltering);
15
- const enableAutomationFilterContextFlag = useDashboardSelector(selectEnableAutomationFilterContext);
16
- return useMemo(() => {
17
- const doAllFiltersHaveLocalIdentifiers = validateAllFilterLocalIdentifiers(filters ?? []);
18
- return enableAutomationFilterContextFlag && doAllFiltersHaveLocalIdentifiers;
19
- }, [filters, enableAutomationFilterContextFlag]);
20
- };
@@ -1,32 +0,0 @@
1
- import { type IAutomationMetadataObject, type IInsightWidget } from "@gooddata/sdk-model";
2
- import { type GoodDataSdkError } from "@gooddata/sdk-ui";
3
- /**
4
- * Hook that handles alerts dialog
5
- *
6
- * @alpha
7
- */
8
- export declare const useDashboardAlertsOld: () => {
9
- isInitialized: boolean;
10
- automations: IAutomationMetadataObject[];
11
- alertingToEdit: {
12
- alert: IAutomationMetadataObject;
13
- widget: IInsightWidget | undefined;
14
- anchor: HTMLElement | null;
15
- } | null;
16
- alertingLoadError: GoodDataSdkError | undefined;
17
- isAlertingLoading: boolean;
18
- isAlertsManagementVisible: boolean;
19
- isAlertingDialogOpen: boolean;
20
- isAlertingManagementDialogOpen: boolean;
21
- defaultOnAlerting: () => void;
22
- defaultOnAlertsManagement: () => void;
23
- onAlertingManagementEdit: (alert: IAutomationMetadataObject, widget: IInsightWidget | undefined, anchor: HTMLElement | null, onClosed: () => void) => void;
24
- onAlertingManagementClose: () => void;
25
- onAlertingManagementDeleteSuccess: () => void;
26
- onAlertingManagementDeleteError: () => void;
27
- onAlertingManagementLoadingError: () => void;
28
- onAlertingManagementPauseSuccess: (_alert: IAutomationMetadataObject, pause: boolean) => void;
29
- onAlertingManagementPauseError: (_err: GoodDataSdkError, pause: boolean) => void;
30
- onAlertingCancel: () => void;
31
- onAlertingUpdate: (_alert: IAutomationMetadataObject) => void;
32
- };
@@ -1,141 +0,0 @@
1
- // (C) 2022-2026 GoodData Corporation
2
- import { useCallback, useState } from "react";
3
- import { useToastMessage } from "@gooddata/sdk-ui-kit";
4
- import { messages } from "../../locales.js";
5
- import { refreshAutomations } from "../commands/scheduledEmail.js";
6
- import { selectAutomationsError, selectAutomationsIsInitialized, selectAutomationsIsLoading, selectDashboardUserAutomationAlertsInContext, } from "../store/automations/automationsSelectors.js";
7
- import { selectEnableAlerting, selectIsReadOnly } from "../store/config/configSelectors.js";
8
- import { selectDashboardRef } from "../store/meta/metaSelectors.js";
9
- import { selectNotificationChannelsCount } from "../store/notificationChannels/notificationChannelsSelectors.js";
10
- import { selectCanManageWorkspace } from "../store/permissions/permissionsSelectors.js";
11
- import { selectIsInViewMode } from "../store/renderMode/renderModeSelectors.js";
12
- import { uiActions } from "../store/ui/index.js";
13
- import { selectIsAlertingDialogOpen, selectIsAlertsManagementDialogOpen, selectMenuButtonItemsVisibility, } from "../store/ui/uiSelectors.js";
14
- import { useDashboardDispatch, useDashboardSelector } from "./DashboardStoreProvider.js";
15
- /**
16
- * Hook that handles alerts dialog
17
- *
18
- * @alpha
19
- */
20
- export const useDashboardAlertsOld = () => {
21
- const { addSuccess, addError } = useToastMessage();
22
- const isInitialized = useDashboardSelector(selectAutomationsIsInitialized);
23
- const isAlertingDialogOpen = useDashboardSelector(selectIsAlertingDialogOpen) || false;
24
- const isAlertingManagementDialogOpen = useDashboardSelector(selectIsAlertsManagementDialogOpen) || false;
25
- const [alertingToEdit, setAlertingToEdit] = useState(null);
26
- const [onEditAlertingClosed, setOnEditAlertingClosed] = useState({
27
- handler: null,
28
- });
29
- const isReadOnly = useDashboardSelector(selectIsReadOnly);
30
- const isInViewMode = useDashboardSelector(selectIsInViewMode);
31
- const isAlertingEnabled = useDashboardSelector(selectEnableAlerting);
32
- const menuButtonItemsVisibility = useDashboardSelector(selectMenuButtonItemsVisibility);
33
- const isWorkspaceManager = useDashboardSelector(selectCanManageWorkspace);
34
- const dispatch = useDashboardDispatch();
35
- const dashboardRef = useDashboardSelector(selectDashboardRef);
36
- const numberOfAvailableDestinations = useDashboardSelector(selectNotificationChannelsCount);
37
- const automations = useDashboardSelector(selectDashboardUserAutomationAlertsInContext(undefined));
38
- const automationsLoading = useDashboardSelector(selectAutomationsIsLoading);
39
- const automationsError = useDashboardSelector(selectAutomationsError);
40
- /**
41
- * We want to hide scheduling when there are no webhooks unless the user is admin.
42
- */
43
- const showDueToNumberOfAvailableDestinations = numberOfAvailableDestinations > 0 || isWorkspaceManager;
44
- const isAlertingAvailable = isInViewMode &&
45
- !isReadOnly &&
46
- showDueToNumberOfAvailableDestinations &&
47
- (menuButtonItemsVisibility.alertingButton ?? true);
48
- const isAlertsManagementVisible = isAlertingAvailable && isAlertingEnabled;
49
- const openAlertingManagementDialog = useCallback(() => isAlertingEnabled && dispatch(uiActions.openAlertingManagementDialog({})), [dispatch, isAlertingEnabled]);
50
- const closeAlertingManagementDialog = useCallback(() => isAlertingEnabled && dispatch(uiActions.closeAlertingManagementDialog()), [dispatch, isAlertingEnabled]);
51
- const openAlertingDialog = useCallback(() => isAlertingEnabled && dispatch(uiActions.openAlertingDialog({})), [dispatch, isAlertingEnabled]);
52
- const closeAlertingDialog = useCallback(() => isAlertingEnabled && dispatch(uiActions.closeAlertingDialog()), [dispatch, isAlertingEnabled]);
53
- const defaultOnAlerting = useCallback(() => {
54
- if (!dashboardRef) {
55
- return;
56
- }
57
- openAlertingDialog();
58
- }, [dashboardRef, openAlertingDialog]);
59
- const defaultOnAlertsManagement = useCallback(() => {
60
- if (!dashboardRef) {
61
- return;
62
- }
63
- openAlertingManagementDialog();
64
- }, [dashboardRef, openAlertingManagementDialog]);
65
- const onAlertingManagementEdit = useCallback((alert, widget, anchor, onClosed) => {
66
- setAlertingToEdit({
67
- alert,
68
- anchor,
69
- widget,
70
- });
71
- setOnEditAlertingClosed({ handler: onClosed });
72
- openAlertingDialog();
73
- }, [openAlertingDialog]);
74
- const onAlertingManagementClose = useCallback(() => {
75
- closeAlertingManagementDialog();
76
- }, [closeAlertingManagementDialog]);
77
- const onAlertingManagementLoadingError = useCallback(() => {
78
- closeAlertingManagementDialog();
79
- addError(messages.alertingManagementLoadError);
80
- }, [closeAlertingManagementDialog, addError]);
81
- const onAlertingManagementDeleteSuccess = useCallback(() => {
82
- closeAlertingDialog();
83
- addSuccess(messages.alertingDeleteSuccess);
84
- dispatch(refreshAutomations());
85
- }, [addSuccess, closeAlertingDialog, dispatch]);
86
- const onAlertingManagementDeleteError = useCallback(() => {
87
- closeAlertingDialog();
88
- addError(messages.alertingManagementDeleteError);
89
- }, [closeAlertingDialog, addError]);
90
- const onAlertingManagementPauseSuccess = useCallback((_alert, pause) => {
91
- closeAlertingDialog();
92
- if (pause) {
93
- addSuccess(messages.alertingManagementPauseSuccess);
94
- }
95
- else {
96
- addSuccess(messages.alertingManagementActivateSuccess);
97
- }
98
- dispatch(refreshAutomations());
99
- }, [addSuccess, closeAlertingDialog, dispatch]);
100
- const onAlertingManagementPauseError = useCallback((_err, pause) => {
101
- closeAlertingDialog();
102
- if (pause) {
103
- addError(messages.alertingManagementPauseError);
104
- }
105
- else {
106
- addError(messages.alertingManagementActivateError);
107
- }
108
- }, [closeAlertingDialog, addError]);
109
- const onAlertingUpdate = useCallback((_alert) => {
110
- closeAlertingDialog();
111
- setAlertingToEdit(null);
112
- dispatch(refreshAutomations());
113
- }, [closeAlertingDialog, dispatch]);
114
- const onAlertingCancel = useCallback(() => {
115
- closeAlertingDialog();
116
- onEditAlertingClosed.handler?.();
117
- setAlertingToEdit(null);
118
- setOnEditAlertingClosed({ handler: null });
119
- }, [closeAlertingDialog, onEditAlertingClosed]);
120
- return {
121
- isInitialized,
122
- automations,
123
- alertingToEdit,
124
- alertingLoadError: automationsError,
125
- isAlertingLoading: automationsLoading,
126
- isAlertsManagementVisible,
127
- isAlertingDialogOpen,
128
- isAlertingManagementDialogOpen,
129
- defaultOnAlerting,
130
- defaultOnAlertsManagement,
131
- onAlertingManagementEdit,
132
- onAlertingManagementClose,
133
- onAlertingManagementDeleteSuccess,
134
- onAlertingManagementDeleteError,
135
- onAlertingManagementLoadingError,
136
- onAlertingManagementPauseSuccess,
137
- onAlertingManagementPauseError,
138
- onAlertingCancel,
139
- onAlertingUpdate,
140
- };
141
- };
@@ -1,5 +0,0 @@
1
- import { type IAlertingDialogOldProps } from "../types.js";
2
- /**
3
- * @alpha
4
- */
5
- export declare function DefaultAlertingDialogOld({ editAlert, editWidget, anchorEl, onCancel, onUpdate }: IAlertingDialogOldProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,36 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // (C) 2022-2026 GoodData Corporation
3
- import cx from "classnames";
4
- import { OverlayController, OverlayControllerProvider, ScrollablePanel, } from "@gooddata/sdk-ui-kit";
5
- import { DASHBOARD_DIALOG_OVERS_Z_INDEX } from "../../constants/zIndex.js";
6
- import { ConfigurationBubble } from "../../widget/common/configuration/ConfigurationBubble.js";
7
- import { EditAlert } from "../../widget/insight/configuration/InsightAlertConfig/EditAlert.js";
8
- import { useInsightWidgetAlerting } from "../../widget/insight/configuration/InsightAlertConfig/hooks/useInsightWidgetAlerting.js";
9
- const overlayController = OverlayController.getInstance(DASHBOARD_DIALOG_OVERS_Z_INDEX);
10
- const defaultAlignPoints = [
11
- { align: "br tr" },
12
- { align: "tr bl" },
13
- { align: "cr cl" },
14
- { align: "cl cr" },
15
- ];
16
- const defaultArrowOffsets = {
17
- "br tr": [0, 0],
18
- "tr bl": [0, 0],
19
- };
20
- /**
21
- * @alpha
22
- */
23
- export function DefaultAlertingDialogOld({ editAlert, editWidget, anchorEl, onCancel = () => () => { }, onUpdate = () => () => { }, }) {
24
- const { execResult, hasAlerts, destinations, users, supportedMeasures, supportedAttributes, measureFormatMap, catalogAttributes, catalogDateDatasets, canManageAttributes, canManageComparison, cancelAlertEditing, updateExistingAlert, maxAutomationsRecipients, isExecutionTimestampMode, } = useInsightWidgetAlerting({ closeInsightWidgetMenu: onCancel, widget: editWidget });
25
- if (!anchorEl?.id || !editAlert) {
26
- return null;
27
- }
28
- const classes = cx("gd-alerts-configuration-panel", "configuration-scrollable-panel", "s-configuration-scrollable-panel", `s-alert-${editAlert.id}`);
29
- return (_jsx(ConfigurationBubble, { alignPoints: defaultAlignPoints, arrowOffsets: defaultArrowOffsets, alignTo: `#${anchorEl.id}`, onClose: onCancel, overlayPositionType: "fixed", classNames: "gd-alerts-configuration-panel-management", children: _jsx(ScrollablePanel, { className: classes, children: _jsx(OverlayControllerProvider, { overlayController: overlayController, children: _jsx(EditAlert, { canManageAttributes: canManageAttributes, canManageComparison: canManageComparison, execResult: execResult, alert: editAlert, hasAlerts: hasAlerts, destinations: destinations, measures: supportedMeasures, attributes: supportedAttributes, users: users ?? [], onUpdate: (alert) => {
30
- updateExistingAlert(alert);
31
- onUpdate(alert);
32
- }, onCancel: () => {
33
- cancelAlertEditing();
34
- onCancel();
35
- }, onClose: onCancel, overlayPositionType: "fixed", measureFormatMap: measureFormatMap, catalogAttributes: catalogAttributes, catalogDateDatasets: catalogDateDatasets, maxAutomationsRecipients: maxAutomationsRecipients, isExecutionTimestampMode: isExecutionTimestampMode }) }) }) }));
36
- }
@@ -1,17 +0,0 @@
1
- import { type IAttributeMetadataObject, type ICatalogAttribute, type ICatalogDateDataset } from "@gooddata/sdk-model";
2
- import { type AlertAttribute } from "../../types.js";
3
- import { type AttributeValue } from "../hooks/useAttributeValuesFromExecResults.js";
4
- export interface IAlertAttributeSelectOldProps {
5
- id: string;
6
- selectedAttribute: AlertAttribute | undefined;
7
- selectedValue: string | null | undefined;
8
- onAttributeChange: (attribute: AlertAttribute | undefined, value: AttributeValue | undefined) => void;
9
- attributes: AlertAttribute[];
10
- catalogAttributes: ICatalogAttribute[];
11
- catalogDateDatasets: ICatalogDateDataset[];
12
- getAttributeValues: (attr: IAttributeMetadataObject) => AttributeValue[];
13
- isResultLoading?: boolean;
14
- showLabel?: boolean;
15
- closeOnParentScroll?: boolean;
16
- }
17
- export declare function AlertAttributeSelectOld({ id, selectedAttribute: selectedAttributeProp, getAttributeValues, isResultLoading, selectedValue, onAttributeChange, attributes, catalogAttributes, catalogDateDatasets, showLabel, closeOnParentScroll }: IAlertAttributeSelectOldProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,103 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // (C) 2019-2026 GoodData Corporation
3
- import { useMemo, useRef, useState } from "react";
4
- import cx from "classnames";
5
- import { FormattedMessage, useIntl } from "react-intl";
6
- import { Button, InvertableSelectSearchBar, Item, ItemsWrapper, Menu, Separator, SubMenu, } from "@gooddata/sdk-ui-kit";
7
- import { IGNORED_CONFIGURATION_MENU_CLICK_CLASS } from "../../../constants/classes.js";
8
- import { DASHBOARD_DIALOG_OVERS_Z_INDEX } from "../../../constants/zIndex.js";
9
- import { getSelectedCatalogAttribute, getSelectedCatalogAttributeValue } from "../utils/getters.js";
10
- export function AlertAttributeSelectOld({ id, selectedAttribute: selectedAttributeProp, getAttributeValues, isResultLoading, selectedValue, onAttributeChange, attributes, catalogAttributes, catalogDateDatasets, showLabel = true, closeOnParentScroll, }) {
11
- const intl = useIntl();
12
- const ref = useRef(null);
13
- const availableAttributes = useMemo(() => {
14
- return attributes.filter((attr) => attr.type === "attribute");
15
- }, [attributes]);
16
- const [searchString, setSearchString] = useState("");
17
- const [isOpen, setIsOpen] = useState(false);
18
- const [isOpenAttribute, setIsOpenAttribute] = useState(null);
19
- const selectedAttribute = useMemo(() => {
20
- return (selectedAttributeProp &&
21
- getSelectedCatalogAttribute(catalogAttributes, catalogDateDatasets, selectedAttributeProp));
22
- }, [selectedAttributeProp, catalogAttributes, catalogDateDatasets]);
23
- const selectedAttributeValue = useMemo(() => getSelectedCatalogAttributeValue(selectedAttribute, getAttributeValues, selectedValue), [selectedAttribute, getAttributeValues, selectedValue]);
24
- const opened = Boolean(isOpen && !isResultLoading);
25
- // if there are no attributes, return null
26
- if (availableAttributes.length === 0) {
27
- return null;
28
- }
29
- return (_jsxs(_Fragment, { children: [showLabel ? (_jsx("label", { htmlFor: id, className: "gd-edit-alert__measure-label", children: _jsx(FormattedMessage, { id: "insightAlert.config.for" }) })) : null, _jsx("div", { className: "gd-alert-attribute-select", children: _jsx(Menu, { closeOnScroll: closeOnParentScroll, toggler: _jsx("div", { ref: (item) => {
30
- ref.current = item;
31
- }, children: _jsx(Button, { id: id, className: cx("gd-alert-attribute-select__button s-alert-attribute-select", {
32
- "is-active": opened,
33
- }), size: "small", disabled: isResultLoading, variant: "secondary", iconLeft: "gd-icon-attribute", iconRight: `gd-icon-navigate${opened ? "up" : "down"}`, onClick: () => {
34
- if (isResultLoading) {
35
- return;
36
- }
37
- setIsOpen(!isOpen);
38
- setIsOpenAttribute(null);
39
- }, children: selectedAttribute ? (_jsxs("span", { children: [selectedAttribute?.title, _jsxs("span", { children: ["\u00A0", "/", "\u00A0"] }), selectedAttributeValue
40
- ? (selectedAttributeValue.title ?? selectedAttributeValue.name) ||
41
- `(${intl.formatMessage({ id: "empty_value" })})`
42
- : intl.formatMessage({
43
- id: "insightAlert.config.selectAttribute",
44
- })] })) : (_jsx(_Fragment, { children: intl.formatMessage({ id: "insightAlert.config.selectAttribute" }) })) }) }), togglerWrapperClassName: "gd-alert-attribute-select__button_wrapper", opened: opened, onOpenedChange: ({ opened }) => {
45
- setIsOpen(opened);
46
- }, openAction: "click", children: _jsx(ItemsWrapper, { style: {
47
- width: ref.current?.offsetWidth ?? 0,
48
- zIndex: DASHBOARD_DIALOG_OVERS_Z_INDEX,
49
- }, className: IGNORED_CONFIGURATION_MENU_CLICK_CLASS, children: _jsxs("div", { className: "gd-alert-attribute-select__submenu s-alert-attribute-menu-content", children: [
50
- _jsx(Item, { className: "gd-alert-attribute-select__menu-item_wrapper", checked: !selectedAttribute, onClick: (e) => {
51
- onAttributeChange(undefined, undefined);
52
- setIsOpen(false);
53
- setIsOpenAttribute(null);
54
- e.preventDefault();
55
- e.stopPropagation();
56
- }, children: _jsx("div", { className: "gd-alert-attribute-select__menu-item s-menu-alert-attribute-item-value", children: intl.formatMessage({ id: "insightAlert.config.selectAttribute" }) }) }), _jsx(Separator, {}), availableAttributes.map((attribute, i) => {
57
- const item = getSelectedCatalogAttribute(catalogAttributes, catalogDateDatasets, attribute);
58
- if (!item) {
59
- return null;
60
- }
61
- const isSelected = selectedAttribute?.id === item.id;
62
- const values = getAttributeValues(item);
63
- return (_jsx(SubMenu, { toggler: _jsx(Item, { checked: isSelected, subMenu: true, className: "gd-alert-attribute-select__menu-item_wrapper", children: _jsx("div", { className: "gd-alert-attribute-select__menu-item s-menu-alert-attribute-item", children: item.title ||
64
- `(${intl.formatMessage({ id: "empty_value" })})` }) }), openAction: "click", opened: isOpenAttribute === attribute.attribute.attribute.localIdentifier, onOpenedChange: ({ opened }) => {
65
- setIsOpenAttribute(opened ? attribute.attribute.attribute.localIdentifier : null);
66
- setSearchString("");
67
- }, children: _jsx(ItemsWrapper, { style: {
68
- zIndex: DASHBOARD_DIALOG_OVERS_Z_INDEX + 1,
69
- }, className: IGNORED_CONFIGURATION_MENU_CLICK_CLASS, children: _jsxs("div", { className: cx("gd-alert-attribute-select__submenu-content", "s-alert-attribute-submenu-content"), children: [values.length > 5 && (_jsx("div", { children: _jsx(InvertableSelectSearchBar, { onSearch: setSearchString, searchString: searchString, searchPlaceholder: intl.formatMessage({
70
- id: "attributesDropdown.placeholder",
71
- }), className: "gd-alert-attribute-select__menu-item_search" }) })), _jsx(Item, { className: "gd-alert-attribute-select__menu-item_wrapper", checked: Boolean(isSelected && !selectedAttributeValue), onClick: (e) => {
72
- onAttributeChange(attribute, undefined);
73
- setIsOpen(false);
74
- setIsOpenAttribute(null);
75
- e.preventDefault();
76
- e.stopPropagation();
77
- }, children: _jsxs("div", { className: "gd-alert-attribute-select__menu-item s-menu-alert-attribute-item-value", children: [intl.formatMessage({
78
- id: "insightAlert.config.selectAttribute",
79
- }), " ", "(", values.length, ")"] }) }), _jsx(Separator, {}), _jsx("div", { className: "gd-alert-attribute-select__menu-item__values", children: values
80
- .filter((item) => {
81
- if (searchString) {
82
- return item.title
83
- .toLowerCase()
84
- .includes(searchString.toLowerCase());
85
- }
86
- return true;
87
- })
88
- .map((value, j) => (_jsx(Item, { checked: Boolean(isSelected &&
89
- value.value ===
90
- selectedAttributeValue?.value), className: "gd-alert-attribute-select__menu-item_wrapper", onClick: (e) => {
91
- onAttributeChange(attribute, value);
92
- setIsOpen(false);
93
- setIsOpenAttribute(null);
94
- e.preventDefault();
95
- e.stopPropagation();
96
- }, children: _jsx("div", { className: "gd-alert-attribute-select__menu-item s-menu-alert-attribute-item-value", children: (value.title ?? value.name) ||
97
- `(${intl.formatMessage({
98
- id: "empty_value",
99
- })})` }) }, j))) })
100
- ] }) }) }, i));
101
- })] }) }) }) })
102
- ] }));
103
- }
@@ -1,5 +0,0 @@
1
- import { type IAlertingManagementDialogOldProps } from "../types.js";
2
- /**
3
- * @alpha
4
- */
5
- export declare function DefaultAlertingManagementDialogOld({ onPauseSuccess, onPauseError, onEdit, onDeleteSuccess, onDeleteError, onClose, isLoadingAlertingData, automations }: IAlertingManagementDialogOldProps): import("react/jsx-runtime").JSX.Element;
@@ -1,53 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // (C) 2022-2026 GoodData Corporation
3
- import { useCallback, useState } from "react";
4
- import { FormattedMessage, defineMessage, useIntl } from "react-intl";
5
- import { Button, Dialog, Hyperlink, Typography, useId } from "@gooddata/sdk-ui-kit";
6
- import { messages } from "../../../locales.js";
7
- import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
8
- import { selectIsWhiteLabeled } from "../../../model/store/config/configSelectors.js";
9
- import { isMobileView } from "../DefaultAlertingDialog/utils/responsive.js";
10
- import { AlertsOld } from "./components/AlertsListOld.js";
11
- import { DeleteAlertConfirmDialog } from "./components/DeleteAlertConfirmDialog.js";
12
- import { PauseAlertRunner } from "./components/PauseAlertRunner.js";
13
- /**
14
- * @alpha
15
- */
16
- export function DefaultAlertingManagementDialogOld({ onPauseSuccess, onPauseError, onEdit, onDeleteSuccess, onDeleteError, onClose, isLoadingAlertingData, automations, }) {
17
- const [alertToDelete, setAlertToDelete] = useState(null);
18
- const [alertToPause, setAlertToPause] = useState(null);
19
- const intl = useIntl();
20
- const isWhiteLabeled = useDashboardSelector(selectIsWhiteLabeled);
21
- const handleAlertDelete = useCallback((alert) => {
22
- setAlertToDelete(alert);
23
- }, []);
24
- const handleAlertEdit = useCallback((alert, widget, anchor, onClosed) => {
25
- onEdit?.(alert, widget, anchor, onClosed);
26
- }, [onEdit]);
27
- const handleAlertPause = useCallback((alert, pause) => {
28
- setAlertToPause([alert, pause]);
29
- }, []);
30
- const handleAlertDeleteSuccess = (alert) => {
31
- onDeleteSuccess?.(alert);
32
- setAlertToDelete(null);
33
- };
34
- const handleAlertPauseSuccess = (alert, pause) => {
35
- onPauseSuccess?.(alert, pause);
36
- setAlertToPause(null);
37
- };
38
- const handleAlertPauseError = (err, pause) => {
39
- onPauseError?.(err, pause);
40
- setAlertToPause(null);
41
- };
42
- const helpTextId = isMobileView()
43
- ? defineMessage({ id: "dialogs.alerting.footer.title.short" }).id
44
- : defineMessage({ id: "dialogs.alerting.footer.title" }).id;
45
- const titleElementId = useId();
46
- return (_jsxs(_Fragment, { children: [
47
- _jsxs(Dialog, { displayCloseButton: true, onCancel: onClose, shouldCloseOnClick: () => false, className: "gd-notifications-channels-management-dialog s-alerting-management-dialog", accessibilityConfig: { titleElementId, isModal: true }, children: [
48
- _jsx("div", { className: "gd-notifications-channels-management-dialog-title", children: _jsx(Typography, { tagName: "h3", className: "gd-dialog-header", id: titleElementId, children: _jsx(FormattedMessage, { id: "dialogs.alerting.management.title" }) }) }), _jsxs("div", { className: "gd-notifications-channels-content", children: [
49
- _jsx("div", { className: "gd-notifications-channels-content-header", children: _jsx(Typography, { tagName: "h3", children: _jsx(FormattedMessage, { id: messages.alertingManagementListTitle.id }) }) }), _jsx(AlertsOld, { onDelete: handleAlertDelete, onEdit: handleAlertEdit, onPause: handleAlertPause, isLoading: isLoadingAlertingData, alerts: automations, noAlertsMessageId: messages.alertingManagementNoAlerts.id })
50
- ] }), _jsx("div", { className: "gd-content-divider" }), _jsxs("div", { className: "gd-buttons", children: [isWhiteLabeled ? null : (_jsx(Hyperlink, { text: intl.formatMessage({ id: helpTextId }), href: "https://www.gooddata.com/docs/cloud/create-dashboards/automation/alerts/", iconClass: "gd-icon-circle-question" })), _jsx(Button, { onClick: onClose, className: "gd-button-secondary s-close-button", value: intl.formatMessage({ id: "close" }) })
51
- ] })
52
- ] }), alertToDelete ? (_jsx(DeleteAlertConfirmDialog, { alert: alertToDelete, onCancel: () => setAlertToDelete(null), onSuccess: handleAlertDeleteSuccess, onError: onDeleteError })) : null, alertToPause ? (_jsx(PauseAlertRunner, { alert: alertToPause[0], pause: alertToPause[1], onSuccess: handleAlertPauseSuccess, onError: handleAlertPauseError })) : null] }));
53
- }
@@ -1,9 +0,0 @@
1
- import { type IAutomationMetadataObject, type IInsightWidget } from "@gooddata/sdk-model";
2
- interface IAlertProps {
3
- onDelete: (alert: IAutomationMetadataObject) => void;
4
- onEdit: (alert: IAutomationMetadataObject, widget: IInsightWidget | undefined, anchor: HTMLElement | null, onClosed: () => void) => void;
5
- onPause: (alert: IAutomationMetadataObject, pause: boolean) => void;
6
- alert: IAutomationMetadataObject;
7
- }
8
- export declare function AlertOld({ alert, onDelete, onEdit, onPause }: IAlertProps): import("react/jsx-runtime").JSX.Element;
9
- export {};