@gooddata/sdk-ui-dashboard 11.51.0-alpha.4 → 11.51.0-alpha.5

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 (167) hide show
  1. package/NOTICE +3 -3
  2. package/esm/__version.d.ts +1 -1
  3. package/esm/__version.js +1 -1
  4. package/esm/index.d.ts +3 -1
  5. package/esm/index.d.ts.map +1 -1
  6. package/esm/index.js +3 -1
  7. package/esm/model/commandHandlers/index.d.ts.map +1 -1
  8. package/esm/model/commandHandlers/index.js +2 -0
  9. package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.d.ts +6 -0
  10. package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.d.ts.map +1 -0
  11. package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.js +39 -0
  12. package/esm/model/commands/base.d.ts +1 -1
  13. package/esm/model/commands/base.d.ts.map +1 -1
  14. package/esm/model/commands/index.d.ts +2 -1
  15. package/esm/model/commands/index.d.ts.map +1 -1
  16. package/esm/model/commands/timezone.d.ts +42 -0
  17. package/esm/model/commands/timezone.d.ts.map +1 -0
  18. package/esm/model/commands/timezone.js +29 -0
  19. package/esm/model/events/base.d.ts +1 -1
  20. package/esm/model/events/base.d.ts.map +1 -1
  21. package/esm/model/events/index.d.ts +2 -1
  22. package/esm/model/events/index.d.ts.map +1 -1
  23. package/esm/model/events/timezone.d.ts +50 -0
  24. package/esm/model/events/timezone.d.ts.map +1 -0
  25. package/esm/model/events/timezone.js +31 -0
  26. package/esm/model/react/useDashboardCommand.d.ts +1 -0
  27. package/esm/model/react/useDashboardCommand.d.ts.map +1 -1
  28. package/esm/model/react/useDashboardCommandProcessing.d.ts +4 -0
  29. package/esm/model/react/useDashboardCommandProcessing.d.ts.map +1 -1
  30. package/esm/model/store/meta/metaSelectors.d.ts +6 -4
  31. package/esm/model/store/meta/metaSelectors.d.ts.map +1 -1
  32. package/esm/model/store/meta/metaSelectors.js +17 -6
  33. package/esm/model/store/ui/index.d.ts +3 -0
  34. package/esm/model/store/ui/index.d.ts.map +1 -1
  35. package/esm/model/store/ui/uiReducers.d.ts +6 -0
  36. package/esm/model/store/ui/uiReducers.d.ts.map +1 -1
  37. package/esm/model/store/ui/uiReducers.js +15 -0
  38. package/esm/model/store/ui/uiSelectors.d.ts +15 -0
  39. package/esm/model/store/ui/uiSelectors.d.ts.map +1 -1
  40. package/esm/model/store/ui/uiSelectors.js +15 -0
  41. package/esm/model/store/ui/uiState.d.ts +12 -0
  42. package/esm/model/store/ui/uiState.d.ts.map +1 -1
  43. package/esm/model/store/ui/uiState.js +4 -0
  44. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
  45. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +4 -23
  46. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts +17 -8
  47. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts.map +1 -1
  48. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.js +19 -7
  49. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts +7 -8
  50. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts.map +1 -1
  51. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.js +14 -4
  52. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
  53. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +4 -44
  54. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +25 -26
  55. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
  56. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +20 -9
  57. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts +37 -15
  58. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts.map +1 -1
  59. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.js +41 -19
  60. package/esm/presentation/automations/shared/filters/conversions.d.ts +1 -1
  61. package/esm/presentation/automations/shared/filters/conversions.js +1 -1
  62. package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.d.ts.map +1 -1
  63. package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.js +2 -1
  64. package/esm/presentation/dashboard/DashboardHeader/TimezoneDialogProvider.d.ts +6 -0
  65. package/esm/presentation/dashboard/DashboardHeader/TimezoneDialogProvider.d.ts.map +1 -0
  66. package/esm/presentation/dashboard/DashboardHeader/TimezoneDialogProvider.js +14 -0
  67. package/esm/presentation/dashboard/components/DashboardLoading.js +1 -1
  68. package/esm/presentation/dashboardSettingsDialog/TimezoneOption.d.ts.map +1 -1
  69. package/esm/presentation/dashboardSettingsDialog/TimezoneOption.js +9 -7
  70. package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +11 -0
  71. package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
  72. package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +13 -2
  73. package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +11 -0
  74. package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
  75. package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +13 -2
  76. package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +11 -0
  77. package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
  78. package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +13 -2
  79. package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +40 -0
  80. package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
  81. package/esm/presentation/localization/bundles/en-US.localization-bundle.js +45 -5
  82. package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +11 -0
  83. package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
  84. package/esm/presentation/localization/bundles/es-419.localization-bundle.js +13 -2
  85. package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +11 -0
  86. package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
  87. package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +13 -2
  88. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +11 -0
  89. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
  90. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +13 -2
  91. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +11 -0
  92. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
  93. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +13 -2
  94. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +11 -0
  95. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
  96. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +13 -2
  97. package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +11 -0
  98. package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
  99. package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +13 -2
  100. package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +11 -0
  101. package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
  102. package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +13 -2
  103. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +11 -0
  104. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
  105. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +13 -2
  106. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +11 -0
  107. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
  108. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +13 -2
  109. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +11 -0
  110. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
  111. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +13 -2
  112. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +11 -0
  113. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
  114. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +13 -2
  115. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +11 -0
  116. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
  117. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +13 -2
  118. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +11 -0
  119. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
  120. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +13 -2
  121. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +11 -0
  122. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
  123. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +13 -2
  124. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +11 -0
  125. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
  126. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +13 -2
  127. package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +11 -0
  128. package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
  129. package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +13 -2
  130. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +11 -0
  131. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
  132. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +13 -2
  133. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +11 -0
  134. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
  135. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +13 -2
  136. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +11 -0
  137. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
  138. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +13 -2
  139. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +11 -0
  140. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
  141. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +13 -2
  142. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +11 -0
  143. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
  144. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +13 -2
  145. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +11 -0
  146. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
  147. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +13 -2
  148. package/esm/presentation/timezoneDialog/TimezoneDialog.d.ts +15 -0
  149. package/esm/presentation/timezoneDialog/TimezoneDialog.d.ts.map +1 -0
  150. package/esm/presentation/timezoneDialog/TimezoneDialog.js +80 -0
  151. package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
  152. package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +22 -3
  153. package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts.map +1 -1
  154. package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.js +2 -2
  155. package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts +5 -3
  156. package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts.map +1 -1
  157. package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.js +6 -4
  158. package/esm/presentation/topBar/topBar/DefaultTopBar.d.ts.map +1 -1
  159. package/esm/presentation/topBar/topBar/DefaultTopBar.js +5 -3
  160. package/esm/sdk-ui-dashboard.d.ts +140 -11
  161. package/package.json +21 -21
  162. package/styles/css/main.css +23 -0
  163. package/styles/css/main.css.map +1 -1
  164. package/styles/css/timezoneDialog.css +24 -0
  165. package/styles/css/timezoneDialog.css.map +1 -0
  166. package/styles/scss/main.scss +1 -0
  167. package/styles/scss/timezoneDialog.scss +31 -0
@@ -11,8 +11,6 @@ import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
11
11
  import { RecipientsSelect } from "../../scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/RecipientsSelect.js";
12
12
  import { ApplyCurrentFiltersConfirmDialog } from "../../shared/automationFilters/components/ApplyLatestFiltersConfirmDialog.js";
13
13
  import { AutomationFiltersSelect } from "../../shared/automationFilters/components/AutomationFiltersSelect.js";
14
- import { useValidateExistingAutomationFilters } from "../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
15
- import { useAutomationFiltersSelect } from "../../shared/automationFilters/useAutomationFiltersSelect.js";
16
14
  import { DeleteAlertConfirmDialog } from "../DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.js";
17
15
  import { AlertingDialogHeader } from "./AlertingDialogHeader.js";
18
16
  import { AlertAttributeSelect } from "./components/AlertAttributeSelect.js";
@@ -41,34 +39,17 @@ export function AlertingDialogRenderer({ onCancel, onDeleteSuccess, onDeleteErro
41
39
  const intl = useIntl();
42
40
  const dialogTitleRef = useRef(null);
43
41
  const { isWhiteLabeled, isSecondaryTitleVisible, externalRecipient: externalRecipientOverride, maxAutomationsRecipients, isExecutionTimestampMode, features: { enableAlertOncePerInterval, enableAnomalyDetectionAlert, canUseAiAssistant: enableAiAssistant, }, } = useAutomationsContext();
44
- // Read from context because this component calls useAutomationFiltersSelect and
45
- // useValidateExistingAutomationFilters directly, and the filter-select call must run before
46
- // useEditAlert, which consumes its output. Removed with the filter read-model consolidation
47
- // (EB-867), which retires these call sites.
48
- const { widgetTitle, alertToEdit, widget, insight } = useAlertingDialogContext();
42
+ const { widgetTitle, alertToEdit } = useAlertingDialogContext();
49
43
  const [alertToDelete, setAlertToDelete] = useState(null);
50
44
  const handleAlertDeleteSuccess = (alert) => {
51
45
  onDeleteSuccess?.(alert);
52
46
  setAlertToDelete(null);
53
47
  };
54
- const { editedAutomationFilters, setEditedAutomationFilters, availableFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, } = useAutomationFiltersSelect({
55
- automationToEdit: alertToEdit,
56
- widget,
57
- });
58
- const { onTitleChange, onRecipientsChange, onFiltersChange, onApplyCurrentFilters, dropStaleParameters, automationParameters, availableParameters, onParameterChange, onParameterDelete, onParameterAdd, onMeasureChange, getAttributeValues, onAttributeChange, onComparisonOperatorChange, onRelativeOperatorChange, onAnomalyDetectionChange, onChange, onBlur, onComparisonTypeChange, onDestinationChange, onTriggerModeChange, onTriggerIntervalChange, selectedMeasure, canChangeMeasure, supportedMeasures, selectedAttribute, selectedValue, supportedAttributes, catalogAttributes, catalogDateDatasets, isResultLoading, selectedComparisonOperator, selectedRelativeOperator, selectedAiOperator, value, selectedComparator, selectedSensitivity, onSensitivityChange, selectedGranularity, onGranularityChange, separators, defaultUser, originalAutomation, editedAutomation, allowOnlyLoggedUserRecipients, allowExternalRecipients, warningMessage, validationErrorMessage, isInvalidConnectionToInsight, isSubmitDisabled, isParentValid, thresholdErrorMessage, allowHourlyRecurrence, users, usersError, notificationChannels, } = useEditAlert({
59
- editedAutomationFilters,
48
+ const { onTitleChange, onRecipientsChange, selectedFilters, availableFilters, onFiltersChange, onApplyCurrentFilters, automationIsValid, filtersAreStale, dropStaleParameters, automationParameters, availableParameters, onParameterChange, onParameterDelete, onParameterAdd, onMeasureChange, getAttributeValues, onAttributeChange, onComparisonOperatorChange, onRelativeOperatorChange, onAnomalyDetectionChange, onChange, onBlur, onComparisonTypeChange, onDestinationChange, onTriggerModeChange, onTriggerIntervalChange, selectedMeasure, canChangeMeasure, supportedMeasures, selectedAttribute, selectedValue, supportedAttributes, catalogAttributes, catalogDateDatasets, isResultLoading, selectedComparisonOperator, selectedRelativeOperator, selectedAiOperator, value, selectedComparator, selectedSensitivity, onSensitivityChange, selectedGranularity, onGranularityChange, separators, defaultUser, originalAutomation, editedAutomation, allowOnlyLoggedUserRecipients, allowExternalRecipients, warningMessage, validationErrorMessage, isInvalidConnectionToInsight, isSubmitDisabled, isParentValid, thresholdErrorMessage, allowHourlyRecurrence, users, usersError, notificationChannels, } = useEditAlert({
60
49
  maxAutomationsRecipients,
61
- availableFiltersAsVisibleFilters,
62
- setEditedAutomationFilters,
63
- filtersForNewAutomation,
64
50
  externalRecipientOverride,
65
51
  });
66
- const { isValid, filtersAreStale = false } = useValidateExistingAutomationFilters({
67
- automationToEdit: alertToEdit,
68
- widget,
69
- insight,
70
- });
71
- const [isApplyCurrentFiltersDialogOpen, setIsApplyCurrentFiltersDialogOpen] = useState(!isValid);
52
+ const [isApplyCurrentFiltersDialogOpen, setIsApplyCurrentFiltersDialogOpen] = useState(!automationIsValid);
72
53
  const { isSaving, submit } = useAlertSubmit({
73
54
  editedAutomation,
74
55
  supportedMeasures,
@@ -134,7 +115,7 @@ export function AlertingDialogRenderer({ onCancel, onDeleteSuccess, onDeleteErro
134
115
  }), ref: dialogTitleRef, secondaryTitle: secondaryTitle, secondaryTitleIcon: secondaryTitleIcon, isSecondaryTitleVisible: isSecondaryTitleVisible ? isParentValid : undefined })), children: [
135
116
  _jsx("h2", { className: "sr-only", id: titleElementId, children: intl.formatMessage({ id: "dialogs.alert.accessibility.label.title" }) }), _jsxs(ScrollablePanel, { className: "gd-notifications-channel-dialog-content-wrapper gd-notification-channel-dialog-with-automation-filters", children: [
136
117
  _jsx("div", { className: "gd-divider-with-margin" }), _jsxs(_Fragment, { children: [
137
- _jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: editedAutomationFilters, onFiltersChange: onFiltersChange, storeFilters: true, onStoreFiltersChange: () => { }, isDashboardAutomation: false, overlayPositionType: OVERLAY_POSITION_TYPE, disableDateFilters: isAnomalyDetection(editedAutomation?.alert), parameters: automationParameters, onParameterChange: onParameterChange, onParameterDelete: onParameterDelete, availableParameters: availableParameters, onParameterAdd: onParameterAdd }), _jsx(ContentDivider, { className: "gd-divider-with-margin" })
118
+ _jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: selectedFilters, onFiltersChange: onFiltersChange, storeFilters: true, onStoreFiltersChange: () => { }, isDashboardAutomation: false, overlayPositionType: OVERLAY_POSITION_TYPE, disableDateFilters: isAnomalyDetection(editedAutomation?.alert), parameters: automationParameters, onParameterChange: onParameterChange, onParameterDelete: onParameterDelete, availableParameters: availableParameters, onParameterAdd: onParameterAdd }), _jsx(ContentDivider, { className: "gd-divider-with-margin" })
138
119
  ] }), _jsxs(FormFieldGroup, { label: _jsx(FormattedMessage, { id: "insightAlert.config.when" }), children: [
139
120
  _jsx(FormField, { label: intl.formatMessage({ id: "insightAlert.config.metric" }), htmlFor: "alert.measure", children: _jsx(AlertMeasureSelect, { selectedMeasure: selectedMeasure, onMeasureChange: onMeasureChange, measures: supportedMeasures, disabled: !canChangeMeasure, overlayPositionType: OVERLAY_POSITION_TYPE, id: "alert.measure", closeOnParentScroll: CLOSE_ON_PARENT_SCROLL }) }), supportedAttributes.filter((a) => a.type === "attribute").length > 0 && (_jsx(FormField, { label: _jsx(FormattedMessage, { id: "insightAlert.config.for" }), htmlFor: "alert.attribute", children: _jsx(AlertAttributeSelect, { id: "alert.attribute", disabled: !canChangeMeasure, selectedAttribute: selectedAttribute, selectedValue: selectedValue, onAttributeChange: onAttributeChange, attributes: supportedAttributes, catalogAttributes: catalogAttributes, catalogDateDatasets: catalogDateDatasets, getAttributeValues: getAttributeValues, isResultLoading: isResultLoading, showLabel: false, closeOnParentScroll: CLOSE_ON_PARENT_SCROLL }) })), _jsx(FormField, { label: _jsx(FormattedMessage, { id: "insightAlert.config.condition" }), htmlFor: "alert.condition", children: _jsx(AlertComparisonOperatorSelect, { id: "alert.condition", measure: selectedMeasure, enableAnomalyDetectionAlert: enableAnomalyDetectionAlert ? enableAiAssistant : false, selectedComparisonOperator: selectedComparisonOperator, selectedRelativeOperator: selectedRelativeOperator, selectedAiOperator: selectedAiOperator, onAnomalyDetectionChange: onAnomalyDetectionChange, onComparisonOperatorChange: onComparisonOperatorChange, onRelativeOperatorChange: onRelativeOperatorChange, overlayPositionType: OVERLAY_POSITION_TYPE, closeOnParentScroll: CLOSE_ON_PARENT_SCROLL }) }), !isAnomalyDetection(editedAutomation?.alert) && (_jsx(FormField, { label: _jsx(FormattedMessage, { id: "insightAlert.config.threshold" }), htmlFor: "alert.value", children: _jsx(AlertThresholdInput, { id: "alert.value", value: value, onChange: onChange, onBlur: onBlur, suffix: getValueSuffix(editedAutomation?.alert), errorMessage: thresholdErrorMessage }) })), isChangeOrDifferenceOperator(editedAutomation?.alert) && (_jsx(FormField, { label: _jsx(FormattedMessage, { id: "insightAlert.config.comparison" }), htmlFor: "alert.comparison", children: _jsx(AlertComparisonPeriodSelect, { id: "alert.comparison", measure: selectedMeasure, alert: editedAutomation, selectedComparison: selectedComparator?.comparator, selectedGranularity: selectedComparator?.granularity, onComparisonChange: (comparisonType, granularity) => {
140
121
  onComparisonTypeChange(selectedMeasure, selectedRelativeOperator, comparisonType, granularity);
@@ -1,5 +1,5 @@
1
1
  import { type Dispatch, type SetStateAction } from "react";
2
- import { type FilterContextItem, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IInsight, type IWidget, type WeekStart } from "@gooddata/sdk-model";
2
+ import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IInsight, type IWidget, type WeekStart } from "@gooddata/sdk-model";
3
3
  import { type AlertAttribute, type AlertMetric } from "../../types.js";
4
4
  import { type IMeasureFormatMap } from "../utils/getters.js";
5
5
  /**
@@ -8,7 +8,10 @@ import { type IMeasureFormatMap } from "../utils/getters.js";
8
8
  */
9
9
  export interface IUseAlertFiltersProps {
10
10
  setEditedAutomation: Dispatch<SetStateAction<IAutomationMetadataObjectDefinition | undefined>>;
11
+ alertToEdit?: IAutomationMetadataObject;
12
+ editedAutomationFilters: FilterContextItem[];
11
13
  setEditedAutomationFilters: (filters: FilterContextItem[]) => void;
14
+ availableFilters?: FilterContextItem[];
12
15
  filtersForNewAutomation: FilterContextItem[];
13
16
  availableFiltersAsVisibleFilters?: IAutomationVisibleFilter[] | undefined;
14
17
  dashboardHiddenFilters: FilterContextItem[];
@@ -25,18 +28,24 @@ export interface IUseAlertFiltersProps {
25
28
  timezone: string | undefined;
26
29
  }
27
30
  /**
28
- * Owns the alerting dialog's filter changes: `onFiltersChange` and `onApplyCurrentFilters` update the
29
- * edited filters and mirror the result into the alert draft.
31
+ * Owns the alerting dialog's single filter model: the current selection and available filters,
32
+ * `onFiltersChange`/`onApplyCurrentFilters` to mutate the edited filters and mirror the result into
33
+ * the alert draft. `automationIsValid` gates the repair / apply-current-filters dialog: it is false
34
+ * whenever the saved filters no longer match the dashboard, or the automation's saved parameters
35
+ * are stale, or both — it does not distinguish which. `filtersAreStale` reports only whether saved
36
+ * filters no longer match the dashboard.
30
37
  *
31
- * Mutation only. The matching read model lives elsewhere — the renderer derives it through
32
- * `useAutomationFiltersSelect` — so the two directions are not yet unified behind a single hook.
33
- *
34
- * All inputs are params; this hook reads no context.
38
+ * All inputs are params; this hook reads no context directly — `useValidateExistingAutomationFilters`
39
+ * reads context internally.
35
40
  *
36
41
  * @internal
37
42
  */
38
- export declare function useAlertFilters({ setEditedAutomation, setEditedAutomationFilters, filtersForNewAutomation, availableFiltersAsVisibleFilters, dashboardHiddenFilters, commonDateFilterId, widget, insight, supportedMeasures, supportedAttributes, measureFormatMap, selectedMeasure, selectedAttribute, selectedValue, weekStart, timezone }: IUseAlertFiltersProps): {
43
+ export declare function useAlertFilters({ setEditedAutomation, alertToEdit, editedAutomationFilters, setEditedAutomationFilters, availableFilters, filtersForNewAutomation, availableFiltersAsVisibleFilters, dashboardHiddenFilters, commonDateFilterId, widget, insight, supportedMeasures, supportedAttributes, measureFormatMap, selectedMeasure, selectedAttribute, selectedValue, weekStart, timezone }: IUseAlertFiltersProps): {
44
+ selectedFilters: FilterContextItem[];
45
+ availableFilters: FilterContextItem[] | undefined;
39
46
  onFiltersChange: (filters: FilterContextItem[]) => void;
40
47
  onApplyCurrentFilters: () => void;
48
+ automationIsValid: boolean;
49
+ filtersAreStale: boolean;
41
50
  };
42
51
  //# sourceMappingURL=useAlertFilters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAlertFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAe,MAAM,OAAO,CAAC;AAExE,OAAO,EACH,KAAK,iBAAiB,EAEtB,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,SAAS,EACjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,GAAG,SAAS,CAAC,CAAC,CAAC;IAC/F,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,sBAAsB,EAAE,iBAAiB,EAAE,CAAC;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,iBAAiB,EAAE,WAAW,EAAE,CAAC;IACjC,mBAAmB,EAAE,cAAc,EAAE,CAAC;IACtC,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,eAAe,EAAE,WAAW,GAAG,SAAS,CAAC;IACzC,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC;IAC9C,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC5B,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,kBAAkB,EAClB,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,QAAQ,EACX,EAAE,qBAAqB,GAAG;IACvB,eAAe,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACxD,qBAAqB,EAAE,MAAM,IAAI,CAAC;CACrC,CA4FA"}
1
+ {"version":3,"file":"useAlertFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAe,MAAM,OAAO,CAAC;AAExE,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,SAAS,EACjB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,GAAG,SAAS,CAAC,CAAC,CAAC;IAC/F,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,sBAAsB,EAAE,iBAAiB,EAAE,CAAC;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,iBAAiB,EAAE,WAAW,EAAE,CAAC;IACjC,mBAAmB,EAAE,cAAc,EAAE,CAAC;IACtC,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,eAAe,EAAE,WAAW,GAAG,SAAS,CAAC;IACzC,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC;IAC9C,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,EAC5B,mBAAmB,EACnB,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,EAChB,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,kBAAkB,EAClB,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,QAAQ,EACX,EAAE,qBAAqB,GAAG;IACvB,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAClD,eAAe,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACxD,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC5B,CAsGA"}
@@ -1,19 +1,22 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { useCallback } from "react";
3
+ import { useValidateExistingAutomationFilters } from "../../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
3
4
  import { getAppliedWidgetFilters, getVisibleFiltersByFilters } from "../../../shared/filters/index.js";
4
5
  import { transformAlertByAttribute, transformAlertByMetric } from "../utils/transformation.js";
5
6
  /**
6
- * Owns the alerting dialog's filter changes: `onFiltersChange` and `onApplyCurrentFilters` update the
7
- * edited filters and mirror the result into the alert draft.
7
+ * Owns the alerting dialog's single filter model: the current selection and available filters,
8
+ * `onFiltersChange`/`onApplyCurrentFilters` to mutate the edited filters and mirror the result into
9
+ * the alert draft. `automationIsValid` gates the repair / apply-current-filters dialog: it is false
10
+ * whenever the saved filters no longer match the dashboard, or the automation's saved parameters
11
+ * are stale, or both — it does not distinguish which. `filtersAreStale` reports only whether saved
12
+ * filters no longer match the dashboard.
8
13
  *
9
- * Mutation only. The matching read model lives elsewhere — the renderer derives it through
10
- * `useAutomationFiltersSelect` — so the two directions are not yet unified behind a single hook.
11
- *
12
- * All inputs are params; this hook reads no context.
14
+ * All inputs are params; this hook reads no context directly — `useValidateExistingAutomationFilters`
15
+ * reads context internally.
13
16
  *
14
17
  * @internal
15
18
  */
16
- export function useAlertFilters({ setEditedAutomation, setEditedAutomationFilters, filtersForNewAutomation, availableFiltersAsVisibleFilters, dashboardHiddenFilters, commonDateFilterId, widget, insight, supportedMeasures, supportedAttributes, measureFormatMap, selectedMeasure, selectedAttribute, selectedValue, weekStart, timezone, }) {
19
+ export function useAlertFilters({ setEditedAutomation, alertToEdit, editedAutomationFilters, setEditedAutomationFilters, availableFilters, filtersForNewAutomation, availableFiltersAsVisibleFilters, dashboardHiddenFilters, commonDateFilterId, widget, insight, supportedMeasures, supportedAttributes, measureFormatMap, selectedMeasure, selectedAttribute, selectedValue, weekStart, timezone, }) {
17
20
  const onFiltersChange = useCallback((filters) => {
18
21
  setEditedAutomationFilters(filters);
19
22
  setEditedAutomation((s) => {
@@ -68,8 +71,17 @@ export function useAlertFilters({ setEditedAutomation, setEditedAutomationFilter
68
71
  const onApplyCurrentFilters = useCallback(() => {
69
72
  onFiltersChange(filtersForNewAutomation);
70
73
  }, [filtersForNewAutomation, onFiltersChange]);
74
+ const { isValid: automationIsValid, filtersAreStale = false } = useValidateExistingAutomationFilters({
75
+ automationToEdit: alertToEdit,
76
+ widget,
77
+ insight,
78
+ });
71
79
  return {
80
+ selectedFilters: editedAutomationFilters,
81
+ availableFilters,
72
82
  onFiltersChange,
73
83
  onApplyCurrentFilters,
84
+ automationIsValid,
85
+ filtersAreStale,
74
86
  };
75
87
  }
@@ -1,17 +1,16 @@
1
- import { type FilterContextItem, type IAutomationVisibleFilter } from "@gooddata/sdk-model";
2
1
  export interface IUseEditAlertProps {
3
2
  maxAutomationsRecipients: number;
4
- editedAutomationFilters?: FilterContextItem[];
5
- setEditedAutomationFilters: (filters: FilterContextItem[]) => void;
6
- availableFiltersAsVisibleFilters?: IAutomationVisibleFilter[] | undefined;
7
- filtersForNewAutomation: FilterContextItem[];
8
3
  externalRecipientOverride?: string;
9
4
  }
10
- export declare function useEditAlert({ editedAutomationFilters, maxAutomationsRecipients, setEditedAutomationFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, externalRecipientOverride }: IUseEditAlertProps): {
5
+ export declare function useEditAlert({ maxAutomationsRecipients, externalRecipientOverride }: IUseEditAlertProps): {
6
+ selectedFilters: import("@gooddata/sdk-model").FilterContextItem[];
7
+ availableFilters: import("@gooddata/sdk-model").FilterContextItem[] | undefined;
8
+ onFiltersChange: (filters: import("@gooddata/sdk-model").FilterContextItem[]) => void;
9
+ onApplyCurrentFilters: () => void;
10
+ automationIsValid: boolean;
11
+ filtersAreStale: boolean;
11
12
  onTitleChange: (value: string, isValid: boolean) => void;
12
13
  onRecipientsChange: (updatedRecipients: import("@gooddata/sdk-model").IAutomationRecipient[]) => void;
13
- onFiltersChange: (filters: FilterContextItem[]) => void;
14
- onApplyCurrentFilters: () => void;
15
14
  automationParameters: import("../../../shared/automationFilters/automationParameters.js").IAutomationParameter[];
16
15
  availableParameters: import("../../../shared/automationFilters/automationParameters.js").IAutomationParameter[];
17
16
  onParameterChange: (ref: import("@gooddata/sdk-model").IdentifierRef, value: string | number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useEditAlert.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAY5F,MAAM,WAAW,kBAAkB;IAC/B,wBAAwB,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAE9C,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,wBAAgB,YAAY,CAAC,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,uBAAuB,EACvB,yBAAyB,EAC5B,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkMpB"}
1
+ {"version":3,"file":"useEditAlert.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,kBAAkB;IAC/B,wBAAwB,EAAE,MAAM,CAAC;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,wBAAgB,YAAY,CAAC,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkNvG"}
@@ -1,15 +1,17 @@
1
1
  // (C) 2019-2026 GoodData Corporation
2
2
  import { useAlertingDialogContext } from "../../../contexts/AlertingDialogContext.js";
3
3
  import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
4
+ import { useAutomationFiltersSelect } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
4
5
  import { useAlertFilters } from "./useAlertFilters.js";
5
6
  import { useAlertFormState } from "./useAlertFormState.js";
6
7
  import { useAlertFormValidation } from "./useAlertFormValidation.js";
7
8
  import { useAlertSelectedValues } from "./useAlertSelectedValues.js";
8
9
  import { useAlertSupportedMetrics } from "./useAlertSupportedMetrics.js";
9
10
  import { useAlertThreshold } from "./useAlertThreshold.js";
10
- export function useEditAlert({ editedAutomationFilters, maxAutomationsRecipients, setEditedAutomationFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, externalRecipientOverride, }) {
11
+ export function useEditAlert({ maxAutomationsRecipients, externalRecipientOverride }) {
11
12
  const { catalogDateDatasets, catalogAttributes, separators, weekStart, timezone, allowHourlyRecurrence } = useAutomationsContext();
12
13
  const { hiddenFilters: dashboardHiddenFilters, commonDateFilterId, alertToEdit, users, usersError, notificationChannels, widget, insight, } = useAlertingDialogContext();
14
+ const { editedAutomationFilters, setEditedAutomationFilters, availableFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, } = useAutomationFiltersSelect({ automationToEdit: alertToEdit, widget });
13
15
  const isInvalidConnectionToInsight = alertToEdit?.metadata?.widget && !insight;
14
16
  const { measureFormatMap, supportedMeasures, supportedAttributes, isResultLoading, getAttributeValues, getMetricValue, } = useAlertSupportedMetrics({ insight, widget, alertToEdit });
15
17
  const { editedAutomation, setEditedAutomation, originalAutomation, defaultUser, defaultRecipient, automationParameters, availableParameters, onParameterChange, onParameterDelete, onParameterAdd, dropStaleParameters, onTitleChange, onMeasureChange, onAttributeChange, onComparisonOperatorChange, onRelativeOperatorChange, onAnomalyDetectionChange, onComparisonTypeChange, onSensitivityChange, onTriggerIntervalChange, onGranularityChange, onDestinationChange, onTriggerModeChange, onRecipientsChange, warningMessage, isTitleValid, } = useAlertFormState({
@@ -34,9 +36,15 @@ export function useEditAlert({ editedAutomationFilters, maxAutomationsRecipients
34
36
  supportedAttributes,
35
37
  notificationChannels,
36
38
  });
37
- const { onFiltersChange, onApplyCurrentFilters } = useAlertFilters({
39
+ // Kept whole rather than destructured: every member is re-exposed unchanged, so spreading it into
40
+ // the return means a member can never be dropped by forgetting to re-list it. What the model may
41
+ // contain is gated by its own shape test, not here.
42
+ const filterModel = useAlertFilters({
38
43
  setEditedAutomation,
44
+ alertToEdit,
45
+ editedAutomationFilters,
39
46
  setEditedAutomationFilters,
47
+ availableFilters,
40
48
  filtersForNewAutomation,
41
49
  availableFiltersAsVisibleFilters,
42
50
  dashboardHiddenFilters,
@@ -80,8 +88,10 @@ export function useEditAlert({ editedAutomationFilters, maxAutomationsRecipients
80
88
  return {
81
89
  onTitleChange,
82
90
  onRecipientsChange,
83
- onFiltersChange,
84
- onApplyCurrentFilters,
91
+ // Filter model, absorbed from `useAlertFilters`. Spread rather than re-listed so a member
92
+ // cannot be dropped by omission; its `availableFilters` is the model's, not the raw
93
+ // selection hook's.
94
+ ...filterModel,
85
95
  automationParameters,
86
96
  availableParameters,
87
97
  onParameterChange,
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultScheduledEmailDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,aAAa,CAAC;AA+D9D,wBAAgB,2BAA2B,CAAC,EACxC,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,OAAO,EACP,MAAM,EACN,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACZ,EAAE,0BAA0B,2CAskB5B;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,0BAA0B,2CAY5E"}
1
+ {"version":3,"file":"DefaultScheduledEmailDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.tsx"],"names":[],"mappings":"AAwCA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,aAAa,CAAC;AA+D9D,wBAAgB,2BAA2B,CAAC,EACxC,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,OAAO,EACP,MAAM,EACN,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACZ,EAAE,0BAA0B,2CAygB5B;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,0BAA0B,2CAY5E"}
@@ -11,9 +11,6 @@ import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
11
11
  import { useScheduledEmailDialogContext } from "../../contexts/ScheduledEmailDialogContext.js";
12
12
  import { ApplyCurrentFiltersConfirmDialog } from "../../shared/automationFilters/components/ApplyLatestFiltersConfirmDialog.js";
13
13
  import { AutomationFiltersSelect } from "../../shared/automationFilters/components/AutomationFiltersSelect.js";
14
- import { useValidateExistingAutomationFilters } from "../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
15
- import { useAutomationExportParameters } from "../../shared/automationFilters/useAutomationExportParameters.js";
16
- import { useAutomationFiltersSelect } from "../../shared/automationFilters/useAutomationFiltersSelect.js";
17
14
  import { DeleteScheduleConfirmDialog } from "../DefaultScheduledEmailManagementDialog/components/DeleteScheduleConfirmDialog.js";
18
15
  import { useScheduleEmailDialogAccessibility } from "../hooks/useScheduleEmailDialogAccessibility.js";
19
16
  import { getDefaultCronExpression } from "../utils/cron.js";
@@ -48,54 +45,17 @@ export function ScheduledMailDialogRenderer({ onBack, onCancel, onDeleteSuccess,
48
45
  const [scheduledEmailToDelete, setScheduledEmailToDelete] = useState(null);
49
46
  const [selectedTabId, setSelectedTabId] = useState("general");
50
47
  const { isWhiteLabeled, externalRecipient: externalRecipientOverride, isSecondaryTitleVisible, } = useAutomationsContext();
51
- // Read from context because this component calls useAutomationFiltersSelect,
52
- // useAutomationExportParameters and useValidateExistingAutomationFilters directly, and the
53
- // filter-select call must run before useEditScheduledEmail, which consumes its output. Removed
54
- // with the filter read-model consolidation (EB-867), which retires these call sites.
55
- const { exportTemplates, widgetTitle, hasMultipleTabs, scheduledExportToEdit, widget, insight, dashboardFilters, } = useScheduledEmailDialogContext();
48
+ const { exportTemplates, widgetTitle, hasMultipleTabs, scheduledExportToEdit, widget, dashboardFilters } = useScheduledEmailDialogContext();
56
49
  const handleScheduleDeleteSuccess = () => {
57
50
  onDeleteSuccess?.();
58
51
  setScheduledEmailToDelete(null);
59
52
  };
60
- const { editedAutomationFilters, setEditedAutomationFilters, storeFilters, setStoreFilters, availableFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation,
61
- // filter by tab data
62
- filtersByTab, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, } = useAutomationFiltersSelect({
63
- automationToEdit: scheduledExportToEdit,
64
- widget,
65
- });
66
53
  const { locale, dashboardTitle, dateFormat, weekStart, maxAutomationsRecipients, allowHourlyRecurrence, isCrossFiltering, isExecutionTimestampMode, isSlidesExportEnabled, isAccessibilityModeEnabled, defaultPdfPageSize, } = useDefaultScheduledEmailDialogData();
67
- const { defaultUser, editedAutomation, originalAutomation, isSubmitDisabled, xlsxSettings, pdfSettings, csvSettings, csvRawSettings, startDate, allowExternalRecipients, allowOnlyLoggedUserRecipients, validationErrorMessage, selectedAttachments, isParentValid, onDashboardAttachmentsChange, onWidgetAttachmentsChange, onXlsxSettingsChange, onPdfSettingsChange, onCsvSettingsChange, onCsvRawSettingsChange, slidesTemplateIds, onSlidesTemplateIdChange, onDestinationChange, onMessageChange, onRecipientsChange, onRecurrenceChange, onEvaluationModeChange, onSubjectChange, onTitleChange, onFiltersChange, onApplyCurrentFilters, onStoreFiltersChange, onFiltersByTabChange, setParametersWire, enableAutomationEvaluationMode, users, usersError, notificationChannels, } = useEditScheduledEmail({
68
- storeFilters,
69
- editedAutomationFilters,
54
+ const { defaultUser, editedAutomation, originalAutomation, isSubmitDisabled, xlsxSettings, pdfSettings, csvSettings, csvRawSettings, startDate, allowExternalRecipients, allowOnlyLoggedUserRecipients, validationErrorMessage, selectedAttachments, isParentValid, onDashboardAttachmentsChange, onWidgetAttachmentsChange, onXlsxSettingsChange, onPdfSettingsChange, onCsvSettingsChange, onCsvRawSettingsChange, slidesTemplateIds, onSlidesTemplateIdChange, onDestinationChange, onMessageChange, onRecipientsChange, onRecurrenceChange, onEvaluationModeChange, onSubjectChange, onTitleChange, onFiltersChange, onApplyCurrentFilters, onStoreFiltersChange, onFiltersByTabChange, enableAutomationEvaluationMode, users, usersError, notificationChannels, selectedFilters, availableFilters, storeFilters, filtersByTab, editedFiltersByTab, automationIsValid, parametersEnabled, visibleParametersByTab, availableParametersByTab, flatTabId, onParameterAdd, onParameterChange, onParameterDelete, onParameterAddByTab, onParameterChangeByTab, onParameterDeleteByTab, applyLatest: applyLatestParameters, } = useEditScheduledEmail({
70
55
  maxAutomationsRecipients,
71
- setEditedAutomationFilters,
72
- setStoreFilters,
73
- availableFiltersAsVisibleFilters,
74
- filtersForNewAutomation,
75
56
  externalRecipientOverride,
76
- filtersDataByTab: filtersByTab,
77
- editedAutomationFiltersByTab,
78
- setEditedAutomationFiltersByTab,
79
- availableFiltersAsVisibleFiltersByTab,
80
- });
81
- const { parametersEnabled, visibleParametersByTab, availableParametersByTab, flatTabId, onParameterAdd, onParameterChange, onParameterDelete, onParameterAddByTab, onParameterChangeByTab, onParameterDeleteByTab, applyLatest: applyLatestParameters, onStoreParametersChange, } = useAutomationExportParameters({
82
- automationToEdit: scheduledExportToEdit,
83
- widget,
84
- storeParameters: storeFilters,
85
- setParametersWire,
86
- });
87
- // The store-filters checkbox gates parameter persistence too; the new value is passed to both
88
- // sides because the `storeFilters` prop still holds the old one at call time.
89
- const handleStoreFiltersChange = useCallback((value, filters, filtersByTabParam) => {
90
- onStoreFiltersChange(value, filters, filtersByTabParam);
91
- onStoreParametersChange(value);
92
- }, [onStoreFiltersChange, onStoreParametersChange]);
93
- const { isValid } = useValidateExistingAutomationFilters({
94
- automationToEdit: scheduledExportToEdit,
95
- widget,
96
- insight,
97
57
  });
98
- const [isApplyCurrentFiltersDialogOpen, setIsApplyCurrentFiltersDialogOpen] = useState(!isValid);
58
+ const [isApplyCurrentFiltersDialogOpen, setIsApplyCurrentFiltersDialogOpen] = useState(!automationIsValid);
99
59
  const { handleSaveScheduledEmail, isSavingScheduledEmail, savingErrorMessage } = useSaveScheduledEmailToBackend(editedAutomation, {
100
60
  onSuccess,
101
61
  onError,
@@ -198,7 +158,7 @@ export function ScheduledMailDialogRenderer({ onBack, onCancel, onDeleteSuccess,
198
158
  }), children: [
199
159
  _jsx("div", { className: "gd-divider-with-margin" }), selectedTabId === "filters" ? (_jsx("div", { ref: filtersTabContentRef, className: "gd-schedule-dialog-tab-content", style: tabContentHeight
200
160
  ? { minHeight: `${tabContentHeight}px` }
201
- : undefined, children: _jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: editedAutomationFilters, onFiltersChange: onFiltersChange, storeFilters: storeFilters, onStoreFiltersChange: handleStoreFiltersChange, isDashboardAutomation: !widget, overlayPositionType: OVERLAY_POSITION_TYPE, hideTitle: true, showAllFilters: true, filtersByTab: filtersByTab, editedFiltersByTab: editedAutomationFiltersByTab, onFiltersByTabChange: onFiltersByTabChange, parameters: flatTabId ? visibleParametersByTab[flatTabId] : undefined, availableParameters: flatTabId ? availableParametersByTab[flatTabId] : undefined, onParameterChange: onParameterChange, onParameterDelete: onParameterDelete, onParameterAdd: onParameterAdd, parametersByTab: visibleParametersByTab, availableParametersByTab: availableParametersByTab, onParameterChangeByTab: onParameterChangeByTab, onParameterDeleteByTab: onParameterDeleteByTab, onParameterAddByTab: onParameterAddByTab, parametersEnabled: parametersEnabled }) })) : (_jsxs("div", { ref: generalTabContentRef, className: "gd-schedule-dialog-tab-content", children: [!widget && hasMultipleTabs ? (_jsx(Message, { type: "progress", className: "gd-schedule-dialog-tab-content-info", children: intl.formatMessage({
161
+ : undefined, children: _jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: selectedFilters, onFiltersChange: onFiltersChange, storeFilters: storeFilters, onStoreFiltersChange: onStoreFiltersChange, isDashboardAutomation: !widget, overlayPositionType: OVERLAY_POSITION_TYPE, hideTitle: true, showAllFilters: true, filtersByTab: filtersByTab, editedFiltersByTab: editedFiltersByTab, onFiltersByTabChange: onFiltersByTabChange, parameters: flatTabId ? visibleParametersByTab[flatTabId] : undefined, availableParameters: flatTabId ? availableParametersByTab[flatTabId] : undefined, onParameterChange: onParameterChange, onParameterDelete: onParameterDelete, onParameterAdd: onParameterAdd, parametersByTab: visibleParametersByTab, availableParametersByTab: availableParametersByTab, onParameterChangeByTab: onParameterChangeByTab, onParameterDeleteByTab: onParameterDeleteByTab, onParameterAddByTab: onParameterAddByTab, parametersEnabled: parametersEnabled }) })) : (_jsxs("div", { ref: generalTabContentRef, className: "gd-schedule-dialog-tab-content", children: [!widget && hasMultipleTabs ? (_jsx(Message, { type: "progress", className: "gd-schedule-dialog-tab-content-info", children: intl.formatMessage({
202
162
  id: "dialogs.schedule.email.tabs.info",
203
163
  }) })) : null, _jsx(RecurrenceForm, { startDate: startDate, cronExpression: editedAutomation.schedule?.cron ??
204
164
  getDefaultCronExpression(startDate), cronDescription: editedAutomation.schedule?.cronDescription, timezone: editedAutomation.schedule?.timezone ??
@@ -1,29 +1,33 @@
1
- import { type FilterContextItem, type IAutomationVisibleFilter, type IExportDefinitionVisualizationObjectSettings } from "@gooddata/sdk-model";
2
- import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
1
+ import { type IExportDefinitionVisualizationObjectSettings } from "@gooddata/sdk-model";
3
2
  export interface IUseEditScheduledEmailProps {
4
3
  maxAutomationsRecipients: number;
5
- editedAutomationFilters?: FilterContextItem[];
6
- setEditedAutomationFilters: (filters: FilterContextItem[]) => void;
7
- /**
8
- * Edited filters structured by tab ID for dashboard automations with tabs enabled.
9
- * When provided, these are used instead of dashboardFilters for per-tab filter storage.
10
- */
11
- editedAutomationFiltersByTab?: Record<string, FilterContextItem[]>;
12
- /**
13
- * Setter for editedFiltersByTab state.
14
- * Used to update filters for a specific tab.
15
- */
16
- setEditedAutomationFiltersByTab?: (filters: Record<string, FilterContextItem[]>) => void;
17
- filtersDataByTab?: IAutomationFiltersTab[] | undefined;
18
- availableFiltersAsVisibleFilters?: IAutomationVisibleFilter[] | undefined;
19
- availableFiltersAsVisibleFiltersByTab?: Record<string, IAutomationVisibleFilter[]>;
20
- storeFilters?: boolean;
21
- setStoreFilters: (storeFilters: boolean) => void;
22
- filtersForNewAutomation: FilterContextItem[];
23
4
  externalRecipientOverride?: string;
24
5
  defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
25
6
  }
26
- export declare function useEditScheduledEmail({ editedAutomationFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab }: IUseEditScheduledEmailProps): {
7
+ export declare function useEditScheduledEmail({ maxAutomationsRecipients, externalRecipientOverride, defaultPdfPageSize }: IUseEditScheduledEmailProps): {
8
+ parametersEnabled: boolean;
9
+ visibleParametersByTab: import("../../../shared/automationFilters/useAutomationExportParameters.js").EditedParametersByTab;
10
+ availableParametersByTab: import("../../../shared/automationFilters/useAutomationExportParameters.js").EditedParametersByTab;
11
+ flatTabId: string | undefined;
12
+ onParameterAdd: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
13
+ onParameterChange: (ref: import("@gooddata/sdk-model").IdentifierRef, value: string | number) => void;
14
+ onParameterDelete: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
15
+ onParameterAddByTab: (tabId: string, ref: import("@gooddata/sdk-model").IdentifierRef) => void;
16
+ onParameterChangeByTab: (tabId: string, ref: import("@gooddata/sdk-model").IdentifierRef, value: string | number) => void;
17
+ onParameterDeleteByTab: (tabId: string, ref: import("@gooddata/sdk-model").IdentifierRef) => void;
18
+ applyLatest: () => void;
19
+ onStoreParametersChange: (storeParameters: boolean) => void;
20
+ selectedFilters: import("@gooddata/sdk-model").FilterContextItem[];
21
+ availableFilters: import("@gooddata/sdk-model").FilterContextItem[] | undefined;
22
+ storeFilters: boolean;
23
+ filtersByTab: import("../../../../../index.js").IAutomationFiltersTab[] | undefined;
24
+ editedFiltersByTab: Record<string, import("@gooddata/sdk-model").FilterContextItem[]> | undefined;
25
+ onFiltersChange: (filters: import("@gooddata/sdk-model").FilterContextItem[], storeFiltersParam?: boolean | undefined) => void;
26
+ onFiltersByTabChange: (newFiltersByTab: Record<string, import("@gooddata/sdk-model").FilterContextItem[]>, storeFiltersParam?: boolean | undefined) => void;
27
+ onApplyCurrentFilters: () => void;
28
+ onStoreFiltersChange: (value: boolean, filters?: import("@gooddata/sdk-model").FilterContextItem[] | undefined, filtersByTabParam?: Record<string, import("@gooddata/sdk-model").FilterContextItem[]> | undefined) => void;
29
+ automationIsValid: boolean;
30
+ filtersAreStale: boolean;
27
31
  defaultUser: import("@gooddata/sdk-model").IWorkspaceUser;
28
32
  areDashboardFiltersChanged: boolean;
29
33
  originalAutomation: import("@gooddata/sdk-model").IAutomationMetadataObjectDefinition;
@@ -55,7 +59,6 @@ export declare function useEditScheduledEmail({ editedAutomationFilters, editedA
55
59
  allowExternalRecipients: boolean;
56
60
  validationErrorMessage: string | undefined;
57
61
  isSubmitDisabled: boolean | undefined;
58
- storeFilters: boolean | undefined;
59
62
  selectedAttachments: ("CSV" | "CSV_RAW" | "HTML" | "PDF" | "PDF_SLIDES" | "PDF_TABULAR" | "PNG" | "PPTX" | "XLSX")[];
60
63
  isParentValid: boolean;
61
64
  onTitleChange: (value: string, isValid: boolean) => void;
@@ -77,10 +80,6 @@ export declare function useEditScheduledEmail({ editedAutomationFilters, editedA
77
80
  PDF: string | undefined;
78
81
  };
79
82
  onSlidesTemplateIdChange: (templateId: string | undefined, format: "PDF" | "PDF_SLIDES" | "PPTX") => void;
80
- onFiltersChange: (filters: FilterContextItem[], storeFiltersParam?: boolean | undefined) => void;
81
- onApplyCurrentFilters: () => void;
82
- onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[] | undefined, filtersByTabParam?: Record<string, FilterContextItem[]> | undefined) => void;
83
- onFiltersByTabChange: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean | undefined) => void;
84
83
  setParametersWire: (wire: Record<string, import("@gooddata/sdk-model").IDashboardExportParameter[]> | undefined) => void;
85
84
  enableAutomationEvaluationMode: boolean;
86
85
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useEditScheduledEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,4CAA4C,EACpD,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAU3F,MAAM,WAAW,2BAA2B;IACxC,wBAAwB,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9C,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACnE;;;OAGG;IACH,+BAA+B,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KAAK,IAAI,CAAC;IACzF,gBAAgB,CAAC,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IACvD,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,qCAAqC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAEnF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,4CAA4C,CAAC,UAAU,CAAC,CAAC;CACjF;AAED,wBAAgB,qBAAqB,CAAC,EAClC,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,qCAAqC,EACxC,EAAE,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwL7B"}
1
+ {"version":3,"file":"useEditScheduledEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,4CAA4C,EAAE,MAAM,qBAAqB,CAAC;AAYxF,MAAM,WAAW,2BAA2B;IACxC,wBAAwB,EAAE,MAAM,CAAC;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,4CAA4C,CAAC,UAAU,CAAC,CAAC;CACjF;AAED,wBAAgB,qBAAqB,CAAC,EAClC,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EACrB,EAAE,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8M7B"}
@@ -1,15 +1,17 @@
1
1
  // (C) 2019-2026 GoodData Corporation
2
2
  import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
3
3
  import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
4
+ import { useAutomationFiltersSelect } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
4
5
  import { useScheduledEmailEffectiveFilters } from "./useScheduledEmailEffectiveFilters.js";
5
6
  import { useScheduledEmailExportSettings } from "./useScheduledEmailExportSettings.js";
6
7
  import { useScheduledEmailFilters } from "./useScheduledEmailFilters.js";
7
8
  import { useScheduledEmailFormState } from "./useScheduledEmailFormState.js";
8
9
  import { useScheduledEmailFormValidity } from "./useScheduledEmailFormValidity.js";
9
- export function useEditScheduledEmail({ editedAutomationFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab, }) {
10
+ export function useEditScheduledEmail({ maxAutomationsRecipients, externalRecipientOverride, defaultPdfPageSize, }) {
10
11
  const { features: { enableAutomationEvaluationMode }, } = useAutomationsContext();
11
12
  const { scheduledExportToEdit, widget, insight, users, usersError, notificationChannels, dashboardFilters, } = useScheduledEmailDialogContext();
12
13
  const areDashboardFiltersChanged = !!dashboardFilters;
14
+ const { editedAutomationFilters, setEditedAutomationFilters, availableFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, storeFilters, setStoreFilters, filtersByTab, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, } = useAutomationFiltersSelect({ automationToEdit: scheduledExportToEdit, widget });
13
15
  const { effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, } = useScheduledEmailEffectiveFilters({
14
16
  widget,
15
17
  insight,
@@ -17,7 +19,7 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
17
19
  editedAutomationFiltersByTab,
18
20
  availableFiltersAsVisibleFilters,
19
21
  availableFiltersAsVisibleFiltersByTab,
20
- filtersDataByTab,
22
+ filtersDataByTab: filtersByTab,
21
23
  storeFilters,
22
24
  });
23
25
  const { editedAutomation, setEditedAutomation, originalAutomation, defaultRecipient, defaultUser, onTitleChange, onRecurrenceChange, onEvaluationModeChange, onDestinationChange, onRecipientsChange, onSubjectChange, onMessageChange, isCronValid, isTitleValid, isSubjectValid, isOnMessageValid, startDate, } = useScheduledEmailFormState({
@@ -49,18 +51,26 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
49
51
  effectiveWidgetFiltersWithInsight,
50
52
  defaultPdfPageSize,
51
53
  });
52
- const { onFiltersChange, onFiltersByTabChange, onApplyCurrentFilters, onStoreFiltersChange } = useScheduledEmailFilters({
54
+ // Kept whole rather than destructured: every member is re-exposed unchanged, so spreading it into
55
+ // the return means a member can never be dropped by forgetting to re-list it. What the model may
56
+ // contain is gated by its own shape test, not here.
57
+ const filterModel = useScheduledEmailFilters({
53
58
  setEditedAutomation,
59
+ scheduledExportToEdit,
54
60
  widget,
55
61
  insight,
62
+ editedAutomationFilters,
56
63
  setEditedAutomationFilters,
64
+ editedAutomationFiltersByTab,
57
65
  setEditedAutomationFiltersByTab,
66
+ availableFilters,
58
67
  availableFiltersAsVisibleFilters,
59
68
  availableFiltersAsVisibleFiltersByTab,
60
- filtersDataByTab,
69
+ filtersByTab,
61
70
  storeFilters,
62
71
  setStoreFilters,
63
72
  filtersForNewAutomation,
73
+ setParametersWire,
64
74
  });
65
75
  const { isSubmitDisabled, validationErrorMessage, isParentValid, allowExternalRecipients, allowOnlyLoggedUserRecipients, } = useScheduledEmailFormValidity({
66
76
  editedAutomation,
@@ -95,7 +105,6 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
95
105
  allowExternalRecipients,
96
106
  validationErrorMessage,
97
107
  isSubmitDisabled,
98
- storeFilters,
99
108
  selectedAttachments,
100
109
  isParentValid,
101
110
  onTitleChange,
@@ -113,11 +122,13 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
113
122
  onCsvRawSettingsChange,
114
123
  slidesTemplateIds,
115
124
  onSlidesTemplateIdChange,
116
- onFiltersChange,
117
- onApplyCurrentFilters,
118
- onStoreFiltersChange,
119
- onFiltersByTabChange,
120
125
  setParametersWire,
121
126
  enableAutomationEvaluationMode,
127
+ // Filter and export-parameter model, absorbed from `useScheduledEmailFilters` (which itself
128
+ // absorbs `useAutomationExportParameters` and `useValidateExistingAutomationFilters`) — the
129
+ // renderer calls none of those three hooks itself, it takes their output from here. Spread
130
+ // last: its `availableFilters`, `storeFilters` and `filtersByTab` are the model's, not the
131
+ // raw selection hook's.
132
+ ...filterModel,
122
133
  };
123
134
  }
@@ -1,34 +1,56 @@
1
1
  import { type Dispatch, type SetStateAction } from "react";
2
- import { type FilterContextItem, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IInsight, type IWidget } from "@gooddata/sdk-model";
2
+ import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IDashboardExportParameter, type IInsight, type IWidget } from "@gooddata/sdk-model";
3
3
  import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
4
+ import { type IUseAutomationExportParameters } from "../../../shared/automationFilters/useAutomationExportParameters.js";
4
5
  export interface IUseScheduledEmailFiltersProps {
5
6
  setEditedAutomation: Dispatch<SetStateAction<IAutomationMetadataObjectDefinition>>;
7
+ scheduledExportToEdit?: IAutomationMetadataObject;
6
8
  widget?: IWidget;
7
9
  insight?: IInsight;
10
+ editedAutomationFilters: FilterContextItem[];
8
11
  setEditedAutomationFilters: (filters: FilterContextItem[]) => void;
12
+ editedAutomationFiltersByTab?: Record<string, FilterContextItem[]>;
9
13
  setEditedAutomationFiltersByTab?: (filters: Record<string, FilterContextItem[]>) => void;
14
+ availableFilters?: FilterContextItem[];
10
15
  availableFiltersAsVisibleFilters?: IAutomationVisibleFilter[] | undefined;
11
16
  availableFiltersAsVisibleFiltersByTab?: Record<string, IAutomationVisibleFilter[]>;
12
- filtersDataByTab?: IAutomationFiltersTab[] | undefined;
13
- storeFilters?: boolean;
17
+ filtersByTab?: IAutomationFiltersTab[] | undefined;
18
+ storeFilters: boolean;
14
19
  setStoreFilters: (storeFilters: boolean) => void;
15
20
  filtersForNewAutomation: FilterContextItem[];
21
+ setParametersWire: (wire: Record<string, IDashboardExportParameter[]> | undefined) => void;
16
22
  }
17
23
  /**
18
- * Owns the scheduled-email dialog's filter changes. Each handler updates the edited filter state and
19
- * mirrors the result into the draft — rewriting the filters on its export definitions along with the
20
- * `metadata.visibleFilters`/`visibleFiltersByTab` used to render them back to the user.
21
- *
22
- * Runs after `useScheduledEmailFormState`, because every handler writes through `setEditedAutomation`.
23
- * The filter sets these handlers start from are derived earlier, in
24
- * {@link useScheduledEmailEffectiveFilters}.
24
+ * The scheduled-email dialog's single filter model: the current selection and available filters
25
+ * (flat and per-tab), the handlers that mutate them and mirror the result into the draft, the
26
+ * `automationIsValid`/`filtersAreStale` staleness gate for a saved schedule, and the absorbed
27
+ * export-parameters model (chips, add/change/delete handlers, apply-latest and store-toggle).
28
+ * `automationIsValid` gates the repair / apply-current-filters dialog: it is false whenever the
29
+ * saved filters no longer match the dashboard, or the saved parameters are stale, or both — it does
30
+ * not distinguish which. `filtersAreStale` reports only whether saved filters no longer match.
31
+ * Parameters live here — rather than in form-state, as on the alerting side — because they have no
32
+ * draft dependency of their own; they only need `storeFilters` (the read model) and `setParametersWire`
33
+ * (from {@link useScheduledEmailExportSettings}).
25
34
  *
26
35
  * @internal
27
36
  */
28
- export declare function useScheduledEmailFilters({ setEditedAutomation, widget, insight, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersDataByTab, storeFilters, setStoreFilters, filtersForNewAutomation }: IUseScheduledEmailFiltersProps): {
29
- onFiltersChange: (filters: FilterContextItem[], storeFiltersParam?: boolean | undefined) => void;
30
- onFiltersByTabChange: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean | undefined) => void;
37
+ export declare function useScheduledEmailFilters({ setEditedAutomation, scheduledExportToEdit, widget, insight, editedAutomationFilters, setEditedAutomationFilters, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, storeFilters, setStoreFilters, filtersForNewAutomation, setParametersWire }: IUseScheduledEmailFiltersProps): IUseScheduledEmailFilters;
38
+ /**
39
+ * Return type of {@link useScheduledEmailFilters}: its own filter model plus the whole absorbed
40
+ * {@link useAutomationExportParameters} model, spread in verbatim so its member names stay canonical.
41
+ * @internal
42
+ */
43
+ export interface IUseScheduledEmailFilters extends IUseAutomationExportParameters {
44
+ selectedFilters: FilterContextItem[];
45
+ availableFilters: FilterContextItem[] | undefined;
46
+ storeFilters: boolean;
47
+ filtersByTab: IAutomationFiltersTab[] | undefined;
48
+ editedFiltersByTab: Record<string, FilterContextItem[]> | undefined;
49
+ onFiltersChange: (filters: FilterContextItem[], storeFiltersParam?: boolean) => void;
50
+ onFiltersByTabChange: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean) => void;
31
51
  onApplyCurrentFilters: () => void;
32
- onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[] | undefined, filtersByTabParam?: Record<string, FilterContextItem[]> | undefined) => void;
33
- };
52
+ onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[], filtersByTabParam?: Record<string, FilterContextItem[]>) => void;
53
+ automationIsValid: boolean;
54
+ filtersAreStale: boolean;
55
+ }
34
56
  //# sourceMappingURL=useScheduledEmailFilters.d.ts.map