@gooddata/sdk-ui-dashboard 11.50.0-alpha.2 → 11.50.0-alpha.4

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 (73) 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/_staging/dateFilterConfig/dateFilterConfigConverters.d.ts +1 -9
  5. package/esm/_staging/dateFilterConfig/dateFilterConfigConverters.d.ts.map +1 -1
  6. package/esm/_staging/dateFilterConfig/dateFilterConfigConverters.js +3 -88
  7. package/esm/_staging/dateFilterConfig/dateFilterOptionMapping.d.ts +1 -33
  8. package/esm/_staging/dateFilterConfig/dateFilterOptionMapping.d.ts.map +1 -1
  9. package/esm/_staging/dateFilterConfig/dateFilterOptionMapping.js +3 -260
  10. package/esm/_staging/dateFilterConfig/defaultConfig.d.ts +1 -11
  11. package/esm/_staging/dateFilterConfig/defaultConfig.d.ts.map +1 -1
  12. package/esm/_staging/dateFilterConfig/defaultConfig.js +3 -436
  13. package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.d.ts.map +1 -1
  14. package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.js +5 -10
  15. package/esm/model/store/config/configSelectors.d.ts +1 -17
  16. package/esm/model/store/config/configSelectors.d.ts.map +1 -1
  17. package/esm/model/store/config/configSelectors.js +9 -40
  18. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts +2 -3
  19. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
  20. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +3 -12
  21. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts +6 -4
  22. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts.map +1 -1
  23. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.js +6 -4
  24. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSelectedValues.d.ts +5 -5
  25. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSelectedValues.js +5 -5
  26. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSupportedMetrics.d.ts +5 -5
  27. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSupportedMetrics.js +5 -5
  28. package/esm/presentation/automations/connectors/AlertingConnector.d.ts +5 -7
  29. package/esm/presentation/automations/connectors/AlertingConnector.d.ts.map +1 -1
  30. package/esm/presentation/automations/connectors/AlertingConnector.js +5 -7
  31. package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts +4 -4
  32. package/esm/presentation/automations/connectors/ScheduledEmailConnector.js +4 -4
  33. package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts +3 -3
  34. package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts +4 -2
  35. package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts.map +1 -1
  36. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +2 -2
  37. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
  38. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +10 -190
  39. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.d.ts +8 -10
  40. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.d.ts.map +1 -1
  41. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.js +8 -10
  42. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.d.ts +3 -11
  43. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.d.ts.map +1 -1
  44. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.js +21 -3
  45. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts +34 -0
  46. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts.map +1 -0
  47. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.js +194 -0
  48. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.d.ts +6 -9
  49. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.d.ts.map +1 -1
  50. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.js +11 -10
  51. package/esm/presentation/automations/shared/dateFilterConfig/dateFilterConfigConverters.d.ts +1 -9
  52. package/esm/presentation/automations/shared/dateFilterConfig/dateFilterConfigConverters.d.ts.map +1 -1
  53. package/esm/presentation/automations/shared/dateFilterConfig/dateFilterConfigConverters.js +3 -88
  54. package/esm/presentation/automations/shared/dateFilterConfig/dateFilterOptionMapping.d.ts +1 -33
  55. package/esm/presentation/automations/shared/dateFilterConfig/dateFilterOptionMapping.d.ts.map +1 -1
  56. package/esm/presentation/automations/shared/dateFilterConfig/dateFilterOptionMapping.js +3 -260
  57. package/esm/presentation/automations/shared/dateFilterConfig/defaultConfig.d.ts +1 -11
  58. package/esm/presentation/automations/shared/dateFilterConfig/defaultConfig.d.ts.map +1 -1
  59. package/esm/presentation/automations/shared/dateFilterConfig/defaultConfig.js +3 -436
  60. package/esm/presentation/dashboardList/DashboardList.d.ts.map +1 -1
  61. package/esm/presentation/dashboardList/DashboardList.js +6 -0
  62. package/esm/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.d.ts.map +1 -1
  63. package/esm/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.js +1 -15
  64. package/esm/presentation/widget/common/InsightDropdown.d.ts.map +1 -1
  65. package/esm/presentation/widget/common/InsightDropdown.js +14 -0
  66. package/esm/presentation/widget/common/configuration/ConfigurationBubble.d.ts.map +1 -1
  67. package/esm/presentation/widget/common/configuration/ConfigurationBubble.js +2 -0
  68. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuBubble.d.ts.map +1 -1
  69. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuBubble.js +1 -1
  70. package/esm/sdk-ui-dashboard.d.ts +2 -3
  71. package/package.json +21 -21
  72. package/styles/css/main.css +4 -1
  73. package/styles/css/main.css.map +1 -1
@@ -40,14 +40,13 @@ const overlayController = OverlayController.getInstance(DASHBOARD_DIALOG_OVERS_Z
40
40
  export function AlertingDialogRenderer({ alertToEdit, users, usersError, notificationChannels, insight, widget, onCancel, onDeleteSuccess, onDeleteError, onError, onSuccess, onSaveError, onSaveSuccess, }) {
41
41
  const intl = useIntl();
42
42
  const dialogTitleRef = useRef(null);
43
- const { isWhiteLabeled, isSecondaryTitleVisible, externalRecipient: externalRecipientOverride, features: { enableAlertOncePerInterval, enableAnomalyDetectionAlert, canUseAiAssistant: enableAiAssistant, }, } = useAutomationsContext();
43
+ const { isWhiteLabeled, isSecondaryTitleVisible, externalRecipient: externalRecipientOverride, maxAutomationsRecipients, isExecutionTimestampMode, features: { enableAlertOncePerInterval, enableAnomalyDetectionAlert, canUseAiAssistant: enableAiAssistant, }, } = useAutomationsContext();
44
44
  const { widgetTitle } = useAlertingDialogContext();
45
45
  const [alertToDelete, setAlertToDelete] = useState(null);
46
46
  const handleAlertDeleteSuccess = (alert) => {
47
47
  onDeleteSuccess?.(alert);
48
48
  setAlertToDelete(null);
49
49
  };
50
- const { maxAutomationsRecipients, isExecutionTimestampMode } = useDefaultAlertingDialogData();
51
50
  const { editedAutomationFilters, setEditedAutomationFilters, availableFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, } = useAutomationFiltersSelect({
52
51
  automationToEdit: alertToEdit,
53
52
  widget,
@@ -171,9 +170,8 @@ export function AlertingDialogRenderer({ alertToEdit, users, usersError, notific
171
170
  * wholesale slot replacement, inherit the contexts automatically and require no extra wiring.
172
171
  *
173
172
  * The providers are intentionally hoisted above the slot rather than built inside this component:
174
- * that is what lets a wholesale replacement receive the same contexts (see the Phase-2 boundary in
175
- * `docs/tasks/26Q1 - Automation Dialog Separation.md`). Rendering this component outside those
176
- * providers throws at runtime.
173
+ * that is what lets a wholesale replacement receive the same contexts. Rendering this component
174
+ * outside those providers throws at runtime.
177
175
  *
178
176
  * @alpha
179
177
  */
@@ -185,13 +183,6 @@ export function DefaultAlertingDialog(props) {
185
183
  }
186
184
  return (_jsx(IntlWrapper, { locale: locale, children: _jsx(AlertingDialogRenderer, { ...props }) }));
187
185
  }
188
- function useDefaultAlertingDialogData() {
189
- const { maxAutomationsRecipients, isExecutionTimestampMode } = useAutomationsContext();
190
- return {
191
- maxAutomationsRecipients,
192
- isExecutionTimestampMode,
193
- };
194
- }
195
186
  function AlertingDialogFooter({ isWhiteLabeled, helpTextId, alertToEdit, isSavingAlert, onDeleteClick, }) {
196
187
  const intl = useIntl();
197
188
  return (_jsxs("div", { className: "gd-notifications-channels-dialog-footer-link", 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" })), alertToEdit ? (_jsx(Button, { className: "gd-button-link-dimmed", value: intl.formatMessage({ id: "delete" }), onClick: onDeleteClick, disabled: isSavingAlert })) : null] }));
@@ -25,11 +25,13 @@ export interface IUseAlertFiltersProps {
25
25
  timezone: string | undefined;
26
26
  }
27
27
  /**
28
- * Extracts the alerting dialog's filter-change reconciliation out of `useEditAlert` into a focused
29
- * hook. Pure refactor — scope is the mutation path only (`onFiltersChange` / `onApplyCurrentFilters`);
30
- * the filter *read* model (`useAutomationFiltersSelect` in the renderer) is intentionally unchanged.
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
30
  *
32
- * All inputs are params — the hook reads nothing from context.
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.
33
35
  *
34
36
  * @internal
35
37
  */
@@ -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;AAM7B,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;;;;;;;;GAQG;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,EAEtB,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,SAAS,EACjB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,KAAK,cA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KAAK,IAAI,CAAC;IACxD,qBAAqB,EAAE,MAAM,IAAI,CAAC;CACrC,CA4FA"}
@@ -3,11 +3,13 @@ import { useCallback } from "react";
3
3
  import { getAppliedWidgetFilters, getVisibleFiltersByFilters, } from "../../../shared/automationFilters/utils.js";
4
4
  import { transformAlertByAttribute, transformAlertByMetric } from "../utils/transformation.js";
5
5
  /**
6
- * Extracts the alerting dialog's filter-change reconciliation out of `useEditAlert` into a focused
7
- * hook. Pure refactor — scope is the mutation path only (`onFiltersChange` / `onApplyCurrentFilters`);
8
- * the filter *read* model (`useAutomationFiltersSelect` in the renderer) is intentionally unchanged.
6
+ * Owns the alerting dialog's filter changes: `onFiltersChange` and `onApplyCurrentFilters` update the
7
+ * edited filters and mirror the result into the alert draft.
9
8
  *
10
- * All inputs are params — the hook reads nothing from context.
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.
11
13
  *
12
14
  * @internal
13
15
  */
@@ -11,12 +11,12 @@ export interface IUseAlertSelectedValuesProps {
11
11
  notificationChannels: INotificationChannelIdentifier[] | INotificationChannelMetadataObject[];
12
12
  }
13
13
  /**
14
- * Pure selector hook that derives the currently-selected values from the edited automation draft.
14
+ * Derives the currently-selected form values from the edited alert draft.
15
15
  *
16
- * No memoization is intentionally added — values are recomputed on every render to preserve the
17
- * referential behaviour of the original inline code in `useEditAlert` (the returned objects flow
18
- * into `useCallback` dep arrays and `useThresholdValue` args; memoizing them would be a behaviour
19
- * change, not an optimisation). The hook therefore contains no internal React hooks.
16
+ * Deliberately unmemoized. The returned objects flow into `useCallback` dependency arrays and
17
+ * `useThresholdValue` arguments, so recomputing them every render is what keeps those consumers
18
+ * behaving correctly — memoizing here would be a behaviour change, not an optimisation. The hook
19
+ * therefore calls no React hooks of its own.
20
20
  *
21
21
  * @internal
22
22
  */
@@ -1,12 +1,12 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { getAlertAiOperator, getAlertAttribute, getAlertCompareOperator, getAlertComparison, getAlertGranularity, getAlertMeasure, getAlertRelativeOperator, getAlertSensitivity, } from "../utils/getters.js";
3
3
  /**
4
- * Pure selector hook that derives the currently-selected values from the edited automation draft.
4
+ * Derives the currently-selected form values from the edited alert draft.
5
5
  *
6
- * No memoization is intentionally added — values are recomputed on every render to preserve the
7
- * referential behaviour of the original inline code in `useEditAlert` (the returned objects flow
8
- * into `useCallback` dep arrays and `useThresholdValue` args; memoizing them would be a behaviour
9
- * change, not an optimisation). The hook therefore contains no internal React hooks.
6
+ * Deliberately unmemoized. The returned objects flow into `useCallback` dependency arrays and
7
+ * `useThresholdValue` arguments, so recomputing them every render is what keeps those consumers
8
+ * behaving correctly — memoizing here would be a behaviour change, not an optimisation. The hook
9
+ * therefore calls no React hooks of its own.
10
10
  *
11
11
  * @internal
12
12
  */
@@ -8,12 +8,12 @@ export interface IUseAlertSupportedMetricsProps {
8
8
  alertToEdit?: IAutomationMetadataObject;
9
9
  }
10
10
  /**
11
- * Extracts the supported-metrics derivation cluster from useEditAlert into a focused hook.
11
+ * Derives which measures and attributes the alerting dialog may offer for the current widget: it
12
+ * resolves the effective insight and its execution result, then narrows the catalog down to the
13
+ * metrics alerting actually supports.
12
14
  *
13
- * Reads `locale`, `catalogDateDatasets`, `catalogAttributes` from `useAutomationsContext()`, and
14
- * `executionResultByRef` from `useAlertingDialogContext()`.
15
- *
16
- * `execResult` and `effectiveInsight` are internal — not returned.
15
+ * `execResult` and `effectiveInsight` stay internal — they are implementation detail rather than part
16
+ * of the returned contract.
17
17
  *
18
18
  * @internal
19
19
  */
@@ -7,12 +7,12 @@ import { getMeasureFormatsFromExecution } from "../utils/getters.js";
7
7
  import { getSupportedInsightAttributesByInsight, getSupportedInsightMeasuresByInsight, } from "../utils/items.js";
8
8
  import { useAttributeValuesFromExecResults } from "./useAttributeValuesFromExecResults.js";
9
9
  /**
10
- * Extracts the supported-metrics derivation cluster from useEditAlert into a focused hook.
10
+ * Derives which measures and attributes the alerting dialog may offer for the current widget: it
11
+ * resolves the effective insight and its execution result, then narrows the catalog down to the
12
+ * metrics alerting actually supports.
11
13
  *
12
- * Reads `locale`, `catalogDateDatasets`, `catalogAttributes` from `useAutomationsContext()`, and
13
- * `executionResultByRef` from `useAlertingDialogContext()`.
14
- *
15
- * `execResult` and `effectiveInsight` are internal — not returned.
14
+ * `execResult` and `effectiveInsight` stay internal — they are implementation detail rather than part
15
+ * of the returned contract.
16
16
  *
17
17
  * @internal
18
18
  */
@@ -13,13 +13,11 @@ export declare function AlertingAutomationsProvider({ children }: {
13
13
  * Connector component that reads from the dashboard Redux store and wires up
14
14
  * the alerting dialog tree (create/edit and management) via context providers.
15
15
  *
16
- * This is the primary bridge between dashboard store state and the alerting
17
- * dialog tree. One transitive exception remains: useAutomationAlertParameters
18
- * (in shared/automationFilters) still reads the store via useDashboardSelector,
19
- * so alerting is not yet fully decoupled. That coupling is an explicit
20
- * carve-out frozen in the `automationFilters` allowlist of .dependency-cruiser.js
21
- * (see the GDP-3167 note there) and is tracked for a Phase 3 move behind this
22
- * connector.
16
+ * This is the primary bridge between dashboard store state and the alerting dialog tree. One
17
+ * transitive exception remains: `useAutomationAlertParameters` (in `shared/automationFilters`) still
18
+ * reads the store via `useDashboardSelector`, so alerting is not yet fully decoupled. That coupling is
19
+ * an explicit carve-out frozen in the `automationFilters` allowlist of `.dependency-cruiser.js` (see
20
+ * the note there); moving it behind this connector is tracked on GDP-3167.
23
21
  *
24
22
  * AutomationsContext is provided by AlertingAutomationsProvider, which wraps this
25
23
  * connector (see AlertingDialogProvider).
@@ -1 +1 @@
1
- {"version":3,"file":"AlertingConnector.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/connectors/AlertingConnector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoB1D;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,CAG/F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,GAAG,IAAI,CAMvD"}
1
+ {"version":3,"file":"AlertingConnector.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/connectors/AlertingConnector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoB1D;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,CAG/F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,GAAG,IAAI,CAMvD"}
@@ -26,13 +26,11 @@ export function AlertingAutomationsProvider({ children }) {
26
26
  * Connector component that reads from the dashboard Redux store and wires up
27
27
  * the alerting dialog tree (create/edit and management) via context providers.
28
28
  *
29
- * This is the primary bridge between dashboard store state and the alerting
30
- * dialog tree. One transitive exception remains: useAutomationAlertParameters
31
- * (in shared/automationFilters) still reads the store via useDashboardSelector,
32
- * so alerting is not yet fully decoupled. That coupling is an explicit
33
- * carve-out frozen in the `automationFilters` allowlist of .dependency-cruiser.js
34
- * (see the GDP-3167 note there) and is tracked for a Phase 3 move behind this
35
- * connector.
29
+ * This is the primary bridge between dashboard store state and the alerting dialog tree. One
30
+ * transitive exception remains: `useAutomationAlertParameters` (in `shared/automationFilters`) still
31
+ * reads the store via `useDashboardSelector`, so alerting is not yet fully decoupled. That coupling is
32
+ * an explicit carve-out frozen in the `automationFilters` allowlist of `.dependency-cruiser.js` (see
33
+ * the note there); moving it behind this connector is tracked on GDP-3167.
36
34
  *
37
35
  * AutomationsContext is provided by AlertingAutomationsProvider, which wraps this
38
36
  * connector (see AlertingDialogProvider).
@@ -13,10 +13,10 @@ export declare function ScheduledEmailAutomationsProvider({ children }: {
13
13
  * Connector component that reads from the dashboard Redux store and wires up
14
14
  * the scheduled-email dialog tree (create/edit and management) via context providers.
15
15
  *
16
- * This is the primary bridge between dashboard store state and the scheduled-email
17
- * dialog tree. The dialog still reads the store directly at this point —
18
- * contexts are provided but not yet consumed. Store reads migrate off the dialog
19
- * in subsequent Phase 2 tasks (A2/A3).
16
+ * This is the primary bridge between dashboard store state and the scheduled-email dialog tree, with one
17
+ * exception: the shared `automationFilters` hooks (`useAutomationFiltersSelect`,
18
+ * `useAutomationExportParameters`, `useValidateExistingAutomationFilters`) read the store directly via
19
+ * `useDashboardSelector`.
20
20
  *
21
21
  * AutomationsContext is provided by ScheduledEmailAutomationsProvider, which wraps this
22
22
  * connector (see ScheduledEmailAutomationsProvider in DashboardHeader).
@@ -31,10 +31,10 @@ export function ScheduledEmailAutomationsProvider({ children }) {
31
31
  * Connector component that reads from the dashboard Redux store and wires up
32
32
  * the scheduled-email dialog tree (create/edit and management) via context providers.
33
33
  *
34
- * This is the primary bridge between dashboard store state and the scheduled-email
35
- * dialog tree. The dialog still reads the store directly at this point —
36
- * contexts are provided but not yet consumed. Store reads migrate off the dialog
37
- * in subsequent Phase 2 tasks (A2/A3).
34
+ * This is the primary bridge between dashboard store state and the scheduled-email dialog tree, with one
35
+ * exception: the shared `automationFilters` hooks (`useAutomationFiltersSelect`,
36
+ * `useAutomationExportParameters`, `useValidateExistingAutomationFilters`) read the store directly via
37
+ * `useDashboardSelector`.
38
38
  *
39
39
  * AutomationsContext is provided by ScheduledEmailAutomationsProvider, which wraps this
40
40
  * connector (see ScheduledEmailAutomationsProvider in DashboardHeader).
@@ -2,10 +2,10 @@ import type { IExecutionResult } from "@gooddata/sdk-backend-spi";
2
2
  import type { FilterContextItem, IAutomationMetadataObject, IAutomationMetadataObjectDefinition, IInsight, IInsightParameterValue, IWidget, ObjRef } from "@gooddata/sdk-model";
3
3
  /**
4
4
  * Sub-context for the alerting create/edit dialog.
5
- * Shape grows during Phase 2 migration as DefaultAlertingDialog and its hooks are migrated.
6
5
  *
7
- * The connector hydrates this from dashboard state and provides the CRUD callbacks.
8
- * The dialog reads from this context instead of calling useDashboardSelector directly.
6
+ * The connector hydrates this from dashboard state and provides the CRUD callbacks; the dialog and its
7
+ * hooks read it instead of reaching into the dashboard store. That direction is enforced by the
8
+ * `no-model-imports-in-clean-alerting` rule in `.dependency-cruiser.js`.
9
9
  */
10
10
  export interface IAlertingDialogContextValue {
11
11
  mode: "create" | "edit";
@@ -1,8 +1,10 @@
1
1
  import type { DashboardAttributeFilterConfigMode, DashboardDateFilterConfigMode, FilterContextItem, IAutomationMetadataObject, IAutomationMetadataObjectDefinition, IDashboardExportParameter, IExportTemplate, IInsight, IWidget } from "@gooddata/sdk-model";
2
2
  /**
3
3
  * Sub-context for the scheduled-email create/edit dialog.
4
- * Shape grows during Phase 2 migration as DefaultScheduledEmailDialog and its hooks are migrated.
5
- * The connector hydrates this from dashboard state and provides the CRUD callbacks.
4
+ *
5
+ * The connector hydrates this from dashboard state and provides the CRUD callbacks; the dialog and its
6
+ * hooks read it instead of reaching into the dashboard store. That direction is enforced by the
7
+ * `no-model-imports-in-clean-scheduled-email` rule in `.dependency-cruiser.js`.
6
8
  */
7
9
  export interface IScheduledEmailDialogContextValue {
8
10
  widget?: IWidget;
@@ -1 +1 @@
1
- {"version":3,"file":"ScheduledEmailDialogContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/ScheduledEmailDialogContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,kCAAkC,EAClC,6BAA6B,EAC7B,iBAAiB,EACjB,yBAAyB,EACzB,mCAAmC,EACnC,yBAAyB,EACzB,eAAe,EACf,QAAQ,EACR,OAAO,EACV,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC;;;OAGG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;IACnE;;;OAGG;IACH,eAAe,EAAE,eAAe,EAAE,CAAC;IACnC,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,uFAAuF;IACvF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,eAAe,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,oBAAoB,EAAE,6BAA6B,CAAC;IACpD,kFAAgF;IAChF,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;IAC/D,2EAAyE;IACzE,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC;IAEzE,oBAAoB,CAAC,EAAE,EAAE,mCAAmC,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAClG,kBAAkB,CAAC,EAAE,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtF,oBAAoB,CAAC,EAAE,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE;AAID,eAAO,MAAM,mCAAmC,yEAAuC,CAAC;AAExF,wBAAgB,8BAA8B,IAAI,iCAAiC,CAQlF"}
1
+ {"version":3,"file":"ScheduledEmailDialogContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/ScheduledEmailDial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OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtF,oBAAoB,CAAC,EAAE,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE;AAID,eAAO,MAAM,mCAAmC,yEAAuC,CAAC;AAExF,wBAAgB,8BAA8B,IAAI,iCAAiC,CAQlF"}
@@ -1,4 +1,4 @@
1
- import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationVisibleFilter, type IDashboardExportParameter, type IExportDefinitionVisualizationObjectSettings, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget, type IWorkspaceUser } from "@gooddata/sdk-model";
1
+ import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationVisibleFilter, type IExportDefinitionVisualizationObjectSettings, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget, type IWorkspaceUser } from "@gooddata/sdk-model";
2
2
  import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
3
3
  export interface IUseEditScheduledEmailProps {
4
4
  scheduledExportToEdit?: IAutomationMetadataObject;
@@ -87,7 +87,7 @@ export declare function useEditScheduledEmail({ scheduledExportToEdit, notificat
87
87
  onApplyCurrentFilters: () => void;
88
88
  onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[] | undefined, filtersByTabParam?: Record<string, FilterContextItem[]> | undefined) => void;
89
89
  onFiltersByTabChange: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean | undefined) => void;
90
- setParametersWire: (wire: Record<string, IDashboardExportParameter[]> | undefined) => void;
90
+ setParametersWire: (wire: Record<string, import("@gooddata/sdk-model").IDashboardExportParameter[]> | undefined) => void;
91
91
  enableAutomationEvaluationMode: boolean;
92
92
  };
93
93
  //# sourceMappingURL=useEditScheduledEmail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEditScheduledEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/h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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,qBAAqB,EACrB,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,KAAK,EACL,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,qCAAqC,EACxC,EAAE,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8a7B"}
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,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAS3F,MAAM,WAAW,2BAA2B;IACxC,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAC9F,wBAAwB,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,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,qCAAqC,EACxC,EAAE,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4K7B"}
@@ -1,25 +1,13 @@
1
1
  // (C) 2019-2026 GoodData Corporation
2
- import { useCallback, useRef } from "react";
3
- import { DEFAULT_CSV_DELIMITER, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, } from "@gooddata/sdk-model";
4
- import { getAutomationExportParametersByTab, setExportParametersByTab, } from "../../../../../_staging/automation/index.js";
5
2
  import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
6
- import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
7
- import { getDefaultSelectedFiltersFromFiltersByTab } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
8
- import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/automationFilters/utils.js";
9
- import { toNormalizedStartDate } from "../../utils/date.js";
10
3
  import { useScheduledEmailEffectiveFilters } from "./useScheduledEmailEffectiveFilters.js";
11
4
  import { useScheduledEmailExportSettings } from "./useScheduledEmailExportSettings.js";
5
+ import { useScheduledEmailFilters } from "./useScheduledEmailFilters.js";
12
6
  import { useScheduledEmailFormState } from "./useScheduledEmailFormState.js";
13
7
  import { useScheduledEmailFormValidity } from "./useScheduledEmailFormValidity.js";
14
8
  export function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, users, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab, }) {
15
- const { settings, features: { enableAutomationEvaluationMode }, } = useAutomationsContext();
16
- const { dashboardId, dashboardTitle, hiddenFilters: dashboardHiddenFilters, commonDateFilterId, widgetLocalIdToTabIdMap: widgetTabMap, } = useScheduledEmailDialogContext();
17
- const isWidget = !!widget && !!insight;
18
- // Dashboard
19
- const resolvedDefaultCsvDelimiter = settings?.exportCsvCustomDelimiter ?? DEFAULT_CSV_DELIMITER;
9
+ const { features: { enableAutomationEvaluationMode }, } = useAutomationsContext();
20
10
  const areDashboardFiltersChanged = !!dashboardFilters;
21
- // Determine target tab ID if widget is present
22
- const targetTabId = widget?.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
23
11
  const { effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, } = useScheduledEmailEffectiveFilters({
24
12
  widget,
25
13
  insight,
@@ -30,7 +18,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
30
18
  filtersDataByTab,
31
19
  storeFilters,
32
20
  });
33
- const { editedAutomation, setEditedAutomation, originalAutomation, defaultRecipient, defaultUser, onTitleChange, onRecurrenceChange, onEvaluationModeChange, onDestinationChange, onRecipientsChange, onSubjectChange, onMessageChange, isCronValid, isTitleValid, isSubjectValid, isOnMessageValid, } = useScheduledEmailFormState({
21
+ const { editedAutomation, setEditedAutomation, originalAutomation, defaultRecipient, defaultUser, onTitleChange, onRecurrenceChange, onEvaluationModeChange, onDestinationChange, onRecipientsChange, onSubjectChange, onMessageChange, isCronValid, isTitleValid, isSubjectValid, isOnMessageValid, startDate, } = useScheduledEmailFormState({
34
22
  scheduledExportToEdit,
35
23
  widget,
36
24
  insight,
@@ -46,200 +34,32 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
46
34
  effectiveVisibleDashboardFiltersByTab,
47
35
  parametersByTabForNewAutomation,
48
36
  defaultPdfPageSize,
49
- targetTabId,
50
37
  });
51
- // Holds the wire outside the automation so it survives a rebuild from zero export definitions —
52
- // with no definitions `setExportParametersByTab` has nowhere to store it.
53
- // Seeded from the stored wire.
54
- const latestParametersWireRef = useRef(getAutomationExportParametersByTab(editedAutomation));
55
- // The user-edit path into `content.parametersByTab`: re-encoded wire in, every export definition
56
- // patched. Handed to `useAutomationExportParameters`, which owns when to call it. Definition
57
- // rebuilds preserve the wire separately via `withRebuiltExportDefinitions`.
58
- const setParametersWire = useCallback((wire) => {
59
- latestParametersWireRef.current = wire;
60
- setEditedAutomation((automation) => setExportParametersByTab(automation, wire));
61
- }, [setEditedAutomation]);
62
- const { selectedAttachments, isDashboardExportSelected, isCsvExportSelected, isXlsxExportSelected, xlsxSettings, pdfSettings, csvSettings, csvRawSettings, slidesTemplateIds, onDashboardAttachmentsChange, onWidgetAttachmentsChange, onXlsxSettingsChange, onPdfSettingsChange, onCsvSettingsChange, onCsvRawSettingsChange, onSlidesTemplateIdChange, } = useScheduledEmailExportSettings({
38
+ const { selectedAttachments, isDashboardExportSelected, isCsvExportSelected, isXlsxExportSelected, xlsxSettings, pdfSettings, csvSettings, csvRawSettings, slidesTemplateIds, onDashboardAttachmentsChange, onWidgetAttachmentsChange, onXlsxSettingsChange, onPdfSettingsChange, onCsvSettingsChange, onCsvRawSettingsChange, onSlidesTemplateIdChange, setParametersWire, } = useScheduledEmailExportSettings({
63
39
  editedAutomation,
64
40
  setEditedAutomation,
65
41
  insight,
66
42
  widget,
67
- dashboardId,
68
- dashboardTitle,
69
43
  storeFilters,
70
44
  effectiveDashboardFilters,
71
45
  effectiveDashboardFiltersByTab,
72
46
  effectiveWidgetFilters,
73
47
  effectiveWidgetFiltersWithInsight,
74
48
  defaultPdfPageSize,
75
- resolvedDefaultCsvDelimiter,
76
- latestParametersWireRef,
77
49
  });
78
- const onFiltersChange = useCallback((filters, storeFiltersParam) => {
79
- setEditedAutomationFilters(filters);
80
- const shouldStoreFilters = storeFiltersParam ?? storeFilters;
81
- if (isWidget) {
82
- if (!isInsightWidget(widget)) {
83
- return;
84
- }
85
- setEditedAutomation((s) => {
86
- const appliedDashboardFilters = getAppliedDashboardFilters(filters, dashboardHiddenFilters, true);
87
- const appliedWidgetFiltersWithInsight = getAppliedWidgetFilters(filters, dashboardHiddenFilters, widget, insight, commonDateFilterId, true);
88
- const appliedWidgetFiltersWithoutInsight = getAppliedWidgetFilters(filters, dashboardHiddenFilters, widget, insight, commonDateFilterId, false);
89
- const visibleFilters = getVisibleFiltersByFilters(filters, availableFiltersAsVisibleFilters, true);
90
- return {
91
- ...s,
92
- exportDefinitions: s.exportDefinitions?.map((exportDefinition) => {
93
- if (isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload)) {
94
- const format = exportDefinition.requestPayload.format;
95
- const shouldUseWidgetFiltersWithInsight = format === "CSV";
96
- const shouldUseWidgetFiltersWithoutInsight = format === "CSV_RAW";
97
- const appliedFilters = shouldUseWidgetFiltersWithInsight
98
- ? appliedWidgetFiltersWithInsight
99
- : shouldUseWidgetFiltersWithoutInsight
100
- ? appliedWidgetFiltersWithoutInsight
101
- : appliedDashboardFilters;
102
- return {
103
- ...exportDefinition,
104
- requestPayload: {
105
- ...exportDefinition.requestPayload,
106
- content: {
107
- ...exportDefinition.requestPayload.content,
108
- filters: appliedFilters,
109
- },
110
- },
111
- };
112
- }
113
- else {
114
- return exportDefinition;
115
- }
116
- }),
117
- metadata: {
118
- ...s.metadata,
119
- visibleFilters,
120
- },
121
- };
122
- });
123
- }
124
- else {
125
- setEditedAutomation((s) => {
126
- const appliedFilters = getAppliedDashboardFilters(filters, dashboardHiddenFilters, shouldStoreFilters);
127
- const visibleFilters = getVisibleFiltersByFilters(filters, availableFiltersAsVisibleFilters, shouldStoreFilters);
128
- return {
129
- ...s,
130
- exportDefinitions: s.exportDefinitions?.map((exportDefinition) => {
131
- if (isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload)) {
132
- return {
133
- ...exportDefinition,
134
- requestPayload: {
135
- ...exportDefinition.requestPayload,
136
- content: {
137
- ...exportDefinition.requestPayload.content,
138
- filters: appliedFilters,
139
- },
140
- },
141
- };
142
- }
143
- else {
144
- return exportDefinition;
145
- }
146
- }),
147
- metadata: {
148
- ...s.metadata,
149
- visibleFilters,
150
- },
151
- };
152
- });
153
- }
154
- }, [
155
- setEditedAutomationFilters,
50
+ const { onFiltersChange, onFiltersByTabChange, onApplyCurrentFilters, onStoreFiltersChange } = useScheduledEmailFilters({
156
51
  setEditedAutomation,
157
- dashboardHiddenFilters,
158
- availableFiltersAsVisibleFilters,
159
- storeFilters,
160
52
  widget,
161
53
  insight,
162
- isWidget,
163
- commonDateFilterId,
164
- ]);
165
- // Callback for per-tab filter changes - updates state AND syncs to export definitions
166
- const onFiltersByTabChange = useCallback((newFiltersByTab, storeFiltersParam) => {
167
- // Update the editedFiltersByTab state
168
- setEditedAutomationFiltersByTab?.(newFiltersByTab);
169
- const shouldStoreFilters = storeFiltersParam ?? storeFilters;
170
- const newEffectiveFiltersByTab = shouldStoreFilters
171
- ? Object.entries(newFiltersByTab).reduce((acc, [tabId, filters]) => {
172
- const tabHiddenFilters = filtersDataByTab?.find((tab) => tab.tabId === tabId)?.hiddenFilters ?? [];
173
- const appliedFilters = getAppliedDashboardFilters(filters ?? [], tabHiddenFilters, true);
174
- if (appliedFilters) {
175
- acc[tabId] = appliedFilters;
176
- }
177
- return acc;
178
- }, {})
179
- : undefined;
180
- const newVisibleFiltersByTab = getVisibleFiltersByFiltersByTab(newFiltersByTab, availableFiltersAsVisibleFiltersByTab, shouldStoreFilters);
181
- // Sync to export definitions AND metadata
182
- setEditedAutomation((s) => ({
183
- ...s,
184
- exportDefinitions: s.exportDefinitions?.map((exportDefinition) => {
185
- if (isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload)) {
186
- return {
187
- ...exportDefinition,
188
- requestPayload: {
189
- ...exportDefinition.requestPayload,
190
- content: {
191
- ...exportDefinition.requestPayload.content,
192
- filtersByTab: newEffectiveFiltersByTab,
193
- },
194
- },
195
- };
196
- }
197
- return exportDefinition;
198
- }),
199
- metadata: {
200
- ...s.metadata,
201
- visibleFiltersByTab: newVisibleFiltersByTab,
202
- },
203
- }));
204
- }, [
54
+ setEditedAutomationFilters,
205
55
  setEditedAutomationFiltersByTab,
206
- storeFilters,
207
- setEditedAutomation,
56
+ availableFiltersAsVisibleFilters,
208
57
  availableFiltersAsVisibleFiltersByTab,
209
58
  filtersDataByTab,
210
- ]);
211
- const onApplyCurrentFilters = useCallback(() => {
212
- // Widget schedules should never use per-tab filters, only dashboard schedules can have tabs
213
- const filtersByTabForNewAutomation = widget
214
- ? undefined
215
- : getDefaultSelectedFiltersFromFiltersByTab(filtersDataByTab);
216
- if (filtersByTabForNewAutomation) {
217
- onFiltersByTabChange(filtersByTabForNewAutomation);
218
- }
219
- else {
220
- onFiltersChange(filtersForNewAutomation ?? [], widget ? true : storeFilters);
221
- }
222
- }, [
223
- filtersForNewAutomation,
224
59
  storeFilters,
225
- onFiltersChange,
226
- onFiltersByTabChange,
227
- widget,
228
- filtersDataByTab,
229
- ]);
230
- const onStoreFiltersChange = useCallback((value, filters, filtersByTabParam) => {
231
- setStoreFilters(value);
232
- // If filtersByTab is provided, use onFiltersByTabChange, otherwise use onFiltersChange
233
- if (filtersByTabParam) {
234
- // Trigger filtersByTab change which handles the sync
235
- onFiltersByTabChange(filtersByTabParam, value);
236
- }
237
- if (filters) {
238
- // Use regular filters change
239
- onFiltersChange(filters, value);
240
- }
241
- }, [onFiltersChange, onFiltersByTabChange, setStoreFilters]);
242
- const startDate = toNormalizedStartDate(editedAutomation.schedule?.firstRun, editedAutomation.schedule?.timezone);
60
+ setStoreFilters,
61
+ filtersForNewAutomation,
62
+ });
243
63
  const { isSubmitDisabled, validationErrorMessage, isParentValid, allowExternalRecipients, allowOnlyLoggedUserRecipients, } = useScheduledEmailFormValidity({
244
64
  editedAutomation,
245
65
  originalAutomation,
@@ -11,17 +11,15 @@ export interface IUseScheduledEmailEffectiveFiltersProps {
11
11
  storeFilters?: boolean;
12
12
  }
13
13
  /**
14
- * Derives the effective-filters cluster consumed early by `useScheduledEmailFormState` (draft init) and
15
- * `useScheduledEmailExportSettings`, and later still by the (still-in-parent) filters handlers.
14
+ * Derives the filter sets a scheduled export actually runs with: the widget and dashboard filters left
15
+ * after hidden filters are removed, their visible-filter counterparts for display, and the per-tab
16
+ * variants used by multi-tab dashboards.
16
17
  *
17
- * Filters slice A of 2. Reads `hiddenFilters`/`commonDateFilterId`/`exportParametersByTab` from
18
- * {@link useScheduledEmailDialogContext} internally, same as the parent (`useEditScheduledEmail`) does
19
- * today. `isWidget` is re-derived internally (`!!widget && !!insight`) — if the parent still needs it for
20
- * the filters handlers, it keeps its own copy, a harmless identical re-derivation (mirrors the sibling
21
- * hooks).
22
- *
23
- * Slice B (`useScheduledEmailFilters`, next PR) will own the four filters handlers, which run after
24
- * `formState` (they need `setEditedAutomation`); this derivation cluster runs before it, hence the split.
18
+ * This has to run before the draft exists, because `useScheduledEmailFormState` and
19
+ * `useScheduledEmailExportSettings` consume these values while initializing it. The handlers that
20
+ * *change* filters live in {@link useScheduledEmailFilters} and necessarily run later — they write
21
+ * through the draft's setter. That ordering is why reading and writing filters are two hooks rather
22
+ * than one.
25
23
  *
26
24
  * @internal
27
25
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useScheduledEmailEffectiveFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,OAAO,EACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAU3F,MAAM,WAAW,uCAAuC;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,uBAAuB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9C,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACnE,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,qCAAqC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC;IACnF,gBAAgB,CAAC,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IACvD,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,CAAC,EAC9C,MAAM,EACN,OAAO,EACP,uBAAuB,EACvB,4BAA4B,EAC5B,gCAAgC,EAChC,qCAAqC,EACrC,gBAAgB,EAChB,YAAY,EACf,EAAE,uCAAuC,GAAG;IACzC,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClC,iCAAiC,EAAE,OAAO,EAAE,CAAC;IAC7C,6BAA6B,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IACtE,yBAAyB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAC3D,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GAAG,SAAS,CAAC;IAChF,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IACzE,qCAAqC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,GAAG,SAAS,CAAC;IAC9F,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,CAAC;CAC5F,CA4FA"}
1
+ {"version":3,"file":"useScheduledEmailEffectiveFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.ts"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