@gooddata/sdk-ui-dashboard 11.50.0-alpha.3 → 11.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -3
- package/esm/__version.d.ts +1 -1
- package/esm/__version.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.js +5 -10
- package/esm/model/store/config/configSelectors.d.ts +1 -17
- package/esm/model/store/config/configSelectors.d.ts.map +1 -1
- package/esm/model/store/config/configSelectors.js +7 -31
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts +2 -3
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +3 -12
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts +6 -4
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.js +6 -4
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSelectedValues.d.ts +5 -5
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSelectedValues.js +5 -5
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSupportedMetrics.d.ts +5 -5
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertSupportedMetrics.js +5 -5
- package/esm/presentation/automations/connectors/AlertingConnector.d.ts +5 -7
- package/esm/presentation/automations/connectors/AlertingConnector.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/AlertingConnector.js +5 -7
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts +4 -4
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.js +4 -4
- package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts +3 -3
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts +4 -2
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +3 -30
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.d.ts +8 -10
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.js +8 -10
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.d.ts +3 -11
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.js +21 -3
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts +6 -7
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.js +6 -7
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.d.ts +6 -9
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.js +11 -10
- package/esm/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.js +1 -15
- package/esm/sdk-ui-dashboard.d.ts +2 -3
- package/package.json +21 -21
- package/styles/css/main.css +4 -1
- package/styles/css/main.css.map +1 -1
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { useCallback, useRef } from "react";
|
|
3
|
-
import { DEFAULT_CSV_DELIMITER, } 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 { toNormalizedStartDate } from "../../utils/date.js";
|
|
8
3
|
import { useScheduledEmailEffectiveFilters } from "./useScheduledEmailEffectiveFilters.js";
|
|
9
4
|
import { useScheduledEmailExportSettings } from "./useScheduledEmailExportSettings.js";
|
|
10
5
|
import { useScheduledEmailFilters } from "./useScheduledEmailFilters.js";
|
|
11
6
|
import { useScheduledEmailFormState } from "./useScheduledEmailFormState.js";
|
|
12
7
|
import { useScheduledEmailFormValidity } from "./useScheduledEmailFormValidity.js";
|
|
13
8
|
export function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, users, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab, }) {
|
|
14
|
-
const {
|
|
15
|
-
const { dashboardId, dashboardTitle, widgetLocalIdToTabIdMap: widgetTabMap, } = useScheduledEmailDialogContext();
|
|
16
|
-
// Dashboard
|
|
17
|
-
const resolvedDefaultCsvDelimiter = settings?.exportCsvCustomDelimiter ?? DEFAULT_CSV_DELIMITER;
|
|
9
|
+
const { features: { enableAutomationEvaluationMode }, } = useAutomationsContext();
|
|
18
10
|
const areDashboardFiltersChanged = !!dashboardFilters;
|
|
19
|
-
// Determine target tab ID if widget is present
|
|
20
|
-
const targetTabId = widget?.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
|
|
21
11
|
const { effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, } = useScheduledEmailEffectiveFilters({
|
|
22
12
|
widget,
|
|
23
13
|
insight,
|
|
@@ -28,7 +18,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
28
18
|
filtersDataByTab,
|
|
29
19
|
storeFilters,
|
|
30
20
|
});
|
|
31
|
-
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({
|
|
32
22
|
scheduledExportToEdit,
|
|
33
23
|
widget,
|
|
34
24
|
insight,
|
|
@@ -44,34 +34,18 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
44
34
|
effectiveVisibleDashboardFiltersByTab,
|
|
45
35
|
parametersByTabForNewAutomation,
|
|
46
36
|
defaultPdfPageSize,
|
|
47
|
-
targetTabId,
|
|
48
37
|
});
|
|
49
|
-
|
|
50
|
-
// with no definitions `setExportParametersByTab` has nowhere to store it.
|
|
51
|
-
// Seeded from the stored wire.
|
|
52
|
-
const latestParametersWireRef = useRef(getAutomationExportParametersByTab(editedAutomation));
|
|
53
|
-
// The user-edit path into `content.parametersByTab`: re-encoded wire in, every export definition
|
|
54
|
-
// patched. Handed to `useAutomationExportParameters`, which owns when to call it. Definition
|
|
55
|
-
// rebuilds preserve the wire separately via `withRebuiltExportDefinitions`.
|
|
56
|
-
const setParametersWire = useCallback((wire) => {
|
|
57
|
-
latestParametersWireRef.current = wire;
|
|
58
|
-
setEditedAutomation((automation) => setExportParametersByTab(automation, wire));
|
|
59
|
-
}, [setEditedAutomation]);
|
|
60
|
-
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({
|
|
61
39
|
editedAutomation,
|
|
62
40
|
setEditedAutomation,
|
|
63
41
|
insight,
|
|
64
42
|
widget,
|
|
65
|
-
dashboardId,
|
|
66
|
-
dashboardTitle,
|
|
67
43
|
storeFilters,
|
|
68
44
|
effectiveDashboardFilters,
|
|
69
45
|
effectiveDashboardFiltersByTab,
|
|
70
46
|
effectiveWidgetFilters,
|
|
71
47
|
effectiveWidgetFiltersWithInsight,
|
|
72
48
|
defaultPdfPageSize,
|
|
73
|
-
resolvedDefaultCsvDelimiter,
|
|
74
|
-
latestParametersWireRef,
|
|
75
49
|
});
|
|
76
50
|
const { onFiltersChange, onFiltersByTabChange, onApplyCurrentFilters, onStoreFiltersChange } = useScheduledEmailFilters({
|
|
77
51
|
setEditedAutomation,
|
|
@@ -86,7 +60,6 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
86
60
|
setStoreFilters,
|
|
87
61
|
filtersForNewAutomation,
|
|
88
62
|
});
|
|
89
|
-
const startDate = toNormalizedStartDate(editedAutomation.schedule?.firstRun, editedAutomation.schedule?.timezone);
|
|
90
63
|
const { isSubmitDisabled, validationErrorMessage, isParentValid, allowExternalRecipients, allowOnlyLoggedUserRecipients, } = useScheduledEmailFormValidity({
|
|
91
64
|
editedAutomation,
|
|
92
65
|
originalAutomation,
|
|
@@ -11,17 +11,15 @@ export interface IUseScheduledEmailEffectiveFiltersProps {
|
|
|
11
11
|
storeFilters?: boolean;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Derives the
|
|
15
|
-
*
|
|
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
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* `useScheduledEmailFilters` (slice B) owns the four filters handlers, which run after `formState` (they
|
|
24
|
-
* 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
|
|
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;;;;;;;;;;;;GAYG;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"}
|
|
@@ -4,17 +4,15 @@ import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmail
|
|
|
4
4
|
import { shouldStoreExportParameters } from "../../../shared/automationFilters/automationParameters.js";
|
|
5
5
|
import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/automationFilters/utils.js";
|
|
6
6
|
/**
|
|
7
|
-
* Derives the
|
|
8
|
-
*
|
|
7
|
+
* Derives the filter sets a scheduled export actually runs with: the widget and dashboard filters left
|
|
8
|
+
* after hidden filters are removed, their visible-filter counterparts for display, and the per-tab
|
|
9
|
+
* variants used by multi-tab dashboards.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `useScheduledEmailFilters` (slice B) owns the four filters handlers, which run after `formState` (they
|
|
17
|
-
* need `setEditedAutomation`); this derivation cluster runs before it, hence the split.
|
|
11
|
+
* This has to run before the draft exists, because `useScheduledEmailFormState` and
|
|
12
|
+
* `useScheduledEmailExportSettings` consume these values while initializing it. The handlers that
|
|
13
|
+
* *change* filters live in {@link useScheduledEmailFilters} and necessarily run later — they write
|
|
14
|
+
* through the draft's setter. That ordering is why reading and writing filters are two hooks rather
|
|
15
|
+
* than one.
|
|
18
16
|
*
|
|
19
17
|
* @internal
|
|
20
18
|
*/
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import { type Dispatch, type
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
2
|
import { type DashboardAttachmentType, type FilterContextItem, type IAutomationMetadataObjectDefinition, type IDashboardExportParameter, type IExportDefinitionVisualizationObjectSettings, type IFilter, type IInsight, type IWidget, type WidgetAttachmentType } from "@gooddata/sdk-model";
|
|
3
3
|
export interface IUseScheduledEmailExportSettingsProps {
|
|
4
4
|
editedAutomation: IAutomationMetadataObjectDefinition;
|
|
5
5
|
setEditedAutomation: Dispatch<SetStateAction<IAutomationMetadataObjectDefinition>>;
|
|
6
6
|
insight?: IInsight;
|
|
7
7
|
widget?: IWidget;
|
|
8
|
-
dashboardId?: string;
|
|
9
|
-
dashboardTitle: string;
|
|
10
8
|
storeFilters?: boolean;
|
|
11
9
|
effectiveDashboardFilters: FilterContextItem[] | undefined;
|
|
12
10
|
effectiveDashboardFiltersByTab: Record<string, FilterContextItem[]> | undefined;
|
|
13
11
|
effectiveWidgetFilters: IFilter[];
|
|
14
12
|
effectiveWidgetFiltersWithInsight: IFilter[];
|
|
15
13
|
defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
|
|
16
|
-
resolvedDefaultCsvDelimiter: string;
|
|
17
|
-
/**
|
|
18
|
-
* Holds the wire outside the automation so it survives a rebuild from zero export definitions —
|
|
19
|
-
* with no definitions `setExportParametersByTab` has nowhere to store it. Owned by the parent
|
|
20
|
-
* (`useEditScheduledEmail`); read here (never written) at attachment-change time.
|
|
21
|
-
*/
|
|
22
|
-
latestParametersWireRef: RefObject<Record<string, IDashboardExportParameter[]> | undefined>;
|
|
23
14
|
}
|
|
24
|
-
export declare function useScheduledEmailExportSettings({ editedAutomation, setEditedAutomation, insight, widget,
|
|
15
|
+
export declare function useScheduledEmailExportSettings({ editedAutomation, setEditedAutomation, insight, widget, storeFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, defaultPdfPageSize }: IUseScheduledEmailExportSettingsProps): {
|
|
25
16
|
selectedAttachments: ("CSV" | "CSV_RAW" | "HTML" | "PDF" | "PDF_SLIDES" | "PDF_TABULAR" | "PNG" | "PPTX" | "XLSX")[];
|
|
26
17
|
isDashboardExportSelected: boolean;
|
|
27
18
|
isCsvExportSelected: boolean;
|
|
@@ -53,5 +44,6 @@ export declare function useScheduledEmailExportSettings({ editedAutomation, setE
|
|
|
53
44
|
onCsvSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
54
45
|
onCsvRawSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
55
46
|
onSlidesTemplateIdChange: (templateId: string | undefined, format: "PDF" | "PDF_SLIDES" | "PPTX") => void;
|
|
47
|
+
setParametersWire: (wire: Record<string, IDashboardExportParameter[]> | undefined) => void;
|
|
56
48
|
};
|
|
57
49
|
//# sourceMappingURL=useScheduledEmailExportSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduledEmailExportSettings.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useScheduledEmailExportSettings.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAgC,MAAM,OAAO,CAAC;AAIzF,OAAO,EAEH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,yBAAyB,EAC9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAG5B,MAAM,qBAAqB,CAAC;AAc7B,MAAM,WAAW,qCAAqC;IAClD,gBAAgB,EAAE,mCAAmC,CAAC;IACtD,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,CAAC,CAAC,CAAC;IACnF,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yBAAyB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAC3D,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GAAG,SAAS,CAAC;IAChF,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClC,iCAAiC,EAAE,OAAO,EAAE,CAAC;IAC7C,kBAAkB,CAAC,EAAE,4CAA4C,CAAC,UAAU,CAAC,CAAC;CACjF;AAED,wBAAgB,+BAA+B,CAAC,EAC5C,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,YAAY,EACZ,yBAAyB,EACzB,8BAA8B,EAC9B,sBAAsB,EACtB,iCAAiC,EACjC,kBAAkB,EACrB,EAAE,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsWvC"}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { useCallback, useMemo } from "react";
|
|
2
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
3
3
|
import { invariant } from "ts-invariant";
|
|
4
|
-
import { isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, } from "@gooddata/sdk-model";
|
|
4
|
+
import { DEFAULT_CSV_DELIMITER, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, } from "@gooddata/sdk-model";
|
|
5
|
+
import { getAutomationExportParametersByTab, setExportParametersByTab, } from "../../../../../_staging/automation/index.js";
|
|
6
|
+
import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
|
|
7
|
+
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
5
8
|
import { newDashboardExportDefinitionMetadataObjectDefinition, newWidgetExportDefinitionMetadataObjectDefinition, withRebuiltExportDefinitions, } from "../utils/exportDefinitions.js";
|
|
6
|
-
export function useScheduledEmailExportSettings({ editedAutomation, setEditedAutomation, insight, widget,
|
|
9
|
+
export function useScheduledEmailExportSettings({ editedAutomation, setEditedAutomation, insight, widget, storeFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, defaultPdfPageSize, }) {
|
|
10
|
+
const { settings } = useAutomationsContext();
|
|
11
|
+
const { dashboardId, dashboardTitle } = useScheduledEmailDialogContext();
|
|
12
|
+
const resolvedDefaultCsvDelimiter = settings?.exportCsvCustomDelimiter ?? DEFAULT_CSV_DELIMITER;
|
|
13
|
+
// Holds the wire outside the automation so it survives a rebuild from zero export definitions —
|
|
14
|
+
// with no definitions `setExportParametersByTab` has nowhere to store it.
|
|
15
|
+
// Seeded from the stored wire.
|
|
16
|
+
const latestParametersWireRef = useRef(getAutomationExportParametersByTab(editedAutomation));
|
|
17
|
+
// The user-edit path into `content.parametersByTab`: re-encoded wire in, every export definition
|
|
18
|
+
// patched. Handed to `useAutomationExportParameters`, which owns when to call it. Definition
|
|
19
|
+
// rebuilds preserve the wire separately via `withRebuiltExportDefinitions`.
|
|
20
|
+
const setParametersWire = useCallback((wire) => {
|
|
21
|
+
latestParametersWireRef.current = wire;
|
|
22
|
+
setEditedAutomation((automation) => setExportParametersByTab(automation, wire));
|
|
23
|
+
}, [setEditedAutomation]);
|
|
7
24
|
// Re-derived locally (not passed as a prop) so that `invariant(isWidget, ...)` below narrows
|
|
8
25
|
// `widget`/`insight` via TS's aliased-condition control-flow analysis — this requires the boolean
|
|
9
26
|
// to be declared from those exact variables in this same scope, same as in the parent.
|
|
@@ -237,5 +254,6 @@ export function useScheduledEmailExportSettings({ editedAutomation, setEditedAut
|
|
|
237
254
|
onCsvSettingsChange,
|
|
238
255
|
onCsvRawSettingsChange,
|
|
239
256
|
onSlidesTemplateIdChange,
|
|
257
|
+
setParametersWire,
|
|
240
258
|
};
|
|
241
259
|
}
|
|
@@ -15,14 +15,13 @@ export interface IUseScheduledEmailFiltersProps {
|
|
|
15
15
|
filtersForNewAutomation: FilterContextItem[];
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Owns the
|
|
19
|
-
* result into the draft
|
|
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.
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `hiddenFilters`/`commonDateFilterId` from {@link useScheduledEmailDialogContext} internally, same as
|
|
25
|
-
* slice A and as the parent (`useEditScheduledEmail`) did before.
|
|
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}.
|
|
26
25
|
*
|
|
27
26
|
* @internal
|
|
28
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduledEmailFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAe,MAAM,OAAO,CAAC;AAExE,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,OAAO,EAIf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAU3F,MAAM,WAAW,8BAA8B;IAC3C,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,CAAC,CAAC,CAAC;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,+BAA+B,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KAAK,IAAI,CAAC;IACzF,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;IACvB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;CAChD;AAED
|
|
1
|
+
{"version":3,"file":"useScheduledEmailFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAe,MAAM,OAAO,CAAC;AAExE,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,OAAO,EAIf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAU3F,MAAM,WAAW,8BAA8B;IAC3C,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,CAAC,CAAC,CAAC;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,+BAA+B,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KAAK,IAAI,CAAC;IACzF,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;IACvB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;CAChD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,qCAAqC,EACrC,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,uBAAuB,EAC1B,EAAE,8BAA8B;;;;;EAqPhC"}
|
|
@@ -5,14 +5,13 @@ import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmail
|
|
|
5
5
|
import { getDefaultSelectedFiltersFromFiltersByTab } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
|
|
6
6
|
import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/automationFilters/utils.js";
|
|
7
7
|
/**
|
|
8
|
-
* Owns the
|
|
9
|
-
* result into the draft
|
|
8
|
+
* Owns the scheduled-email dialog's filter changes. Each handler updates the edited filter state and
|
|
9
|
+
* mirrors the result into the draft — rewriting the filters on its export definitions along with the
|
|
10
|
+
* `metadata.visibleFilters`/`visibleFiltersByTab` used to render them back to the user.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `hiddenFilters`/`commonDateFilterId` from {@link useScheduledEmailDialogContext} internally, same as
|
|
15
|
-
* slice A and as the parent (`useEditScheduledEmail`) did before.
|
|
12
|
+
* Runs after `useScheduledEmailFormState`, because every handler writes through `setEditedAutomation`.
|
|
13
|
+
* The filter sets these handlers start from are derived earlier, in
|
|
14
|
+
* {@link useScheduledEmailEffectiveFilters}.
|
|
16
15
|
*
|
|
17
16
|
* @internal
|
|
18
17
|
*/
|
|
@@ -16,7 +16,6 @@ export interface IUseScheduledEmailFormStateProps {
|
|
|
16
16
|
effectiveVisibleDashboardFiltersByTab: Record<string, IAutomationVisibleFilter[]> | undefined;
|
|
17
17
|
parametersByTabForNewAutomation: Record<string, IDashboardExportParameter[]> | undefined;
|
|
18
18
|
defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
|
|
19
|
-
targetTabId?: string;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
21
|
* Owns the scheduled-email dialog's `editedAutomation` draft (initialized either from
|
|
@@ -24,17 +23,14 @@ export interface IUseScheduledEmailFormStateProps {
|
|
|
24
23
|
* baseline, the derived defaults (`defaultRecipient`, `defaultUser`), and the form's field/message
|
|
25
24
|
* change handlers and their validity UI state.
|
|
26
25
|
*
|
|
27
|
-
* `timezone`
|
|
28
|
-
* `dashboardId`/`dashboardTitle` from {@link useScheduledEmailDialogContext}
|
|
29
|
-
* derivations, `parametersByTabForNewAutomation`,
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* Part 2 of 2 (mirrors the alerting `useAlertFormState` part 2): completes the hook by folding in the
|
|
33
|
-
* draft init that part 1 left in the parent.
|
|
26
|
+
* Values only this hook needs — `timezone` and `currentUser` from {@link useAutomationsContext},
|
|
27
|
+
* `dashboardId`/`dashboardTitle`/`widgetLocalIdToTabIdMap` from {@link useScheduledEmailDialogContext} —
|
|
28
|
+
* are read here directly. The effective-filters derivations, `parametersByTabForNewAutomation`, and
|
|
29
|
+
* `defaultPdfPageSize` arrive as params instead, because the parent shares them with other consumers.
|
|
34
30
|
*
|
|
35
31
|
* @internal
|
|
36
32
|
*/
|
|
37
|
-
export declare function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels, users, externalRecipientOverride, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, defaultPdfPageSize
|
|
33
|
+
export declare function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels, users, externalRecipientOverride, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, defaultPdfPageSize }: IUseScheduledEmailFormStateProps): {
|
|
38
34
|
editedAutomation: IAutomationMetadataObjectDefinition;
|
|
39
35
|
setEditedAutomation: import("react").Dispatch<import("react").SetStateAction<IAutomationMetadataObjectDefinition>>;
|
|
40
36
|
originalAutomation: IAutomationMetadataObjectDefinition;
|
|
@@ -51,5 +47,6 @@ export declare function useScheduledEmailFormState({ scheduledExportToEdit, widg
|
|
|
51
47
|
isTitleValid: boolean;
|
|
52
48
|
isSubjectValid: boolean;
|
|
53
49
|
isOnMessageValid: boolean;
|
|
50
|
+
startDate: Date;
|
|
54
51
|
};
|
|
55
52
|
//# sourceMappingURL=useScheduledEmailFormState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduledEmailFormState.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useScheduledEmailFormState.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,qBAAqB,CAAC;AAqB7B,MAAM,WAAW,gCAAgC;IAC7C,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAC9F,iFAAiF;IACjF,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,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;IACzF,kBAAkB,CAAC,EAAE,4CAA4C,CAAC,UAAU,CAAC,CAAC;CACjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,EACvC,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,oBAAoB,EACpB,KAAK,EACL,yBAAyB,EACzB,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,yBAAyB,EACzB,8BAA8B,EAC9B,gCAAgC,EAChC,qCAAqC,EACrC,+BAA+B,EAC/B,kBAAkB,EACrB,EAAE,gCAAgC;;;;;;;;;;;;;;;;;;EAqJlC"}
|
|
@@ -4,7 +4,7 @@ import { setExportParametersByTab } from "../../../../../_staging/automation/ind
|
|
|
4
4
|
import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
|
|
5
5
|
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
6
6
|
import { convertCurrentUserToAutomationRecipient, convertCurrentUserToWorkspaceUser, convertExternalRecipientToAutomationRecipient, } from "../../../shared/utils/automationUtils.js";
|
|
7
|
-
import { toModifiedISOStringToTimezone, toNormalizedFirstRunAndCron } from "../../utils/date.js";
|
|
7
|
+
import { toModifiedISOStringToTimezone, toNormalizedFirstRunAndCron, toNormalizedStartDate, } from "../../utils/date.js";
|
|
8
8
|
import { getUserTimezone } from "../../utils/timezone.js";
|
|
9
9
|
import { newDashboardExportDefinitionMetadataObjectDefinition, newWidgetExportDefinitionMetadataObjectDefinition, } from "../utils/exportDefinitions.js";
|
|
10
10
|
/**
|
|
@@ -13,20 +13,19 @@ import { newDashboardExportDefinitionMetadataObjectDefinition, newWidgetExportDe
|
|
|
13
13
|
* baseline, the derived defaults (`defaultRecipient`, `defaultUser`), and the form's field/message
|
|
14
14
|
* change handlers and their validity UI state.
|
|
15
15
|
*
|
|
16
|
-
* `timezone`
|
|
17
|
-
* `dashboardId`/`dashboardTitle` from {@link useScheduledEmailDialogContext}
|
|
18
|
-
* derivations, `parametersByTabForNewAutomation`,
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Part 2 of 2 (mirrors the alerting `useAlertFormState` part 2): completes the hook by folding in the
|
|
22
|
-
* draft init that part 1 left in the parent.
|
|
16
|
+
* Values only this hook needs — `timezone` and `currentUser` from {@link useAutomationsContext},
|
|
17
|
+
* `dashboardId`/`dashboardTitle`/`widgetLocalIdToTabIdMap` from {@link useScheduledEmailDialogContext} —
|
|
18
|
+
* are read here directly. The effective-filters derivations, `parametersByTabForNewAutomation`, and
|
|
19
|
+
* `defaultPdfPageSize` arrive as params instead, because the parent shares them with other consumers.
|
|
23
20
|
*
|
|
24
21
|
* @internal
|
|
25
22
|
*/
|
|
26
|
-
export function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels, users, externalRecipientOverride, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, defaultPdfPageSize,
|
|
23
|
+
export function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels, users, externalRecipientOverride, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, defaultPdfPageSize, }) {
|
|
27
24
|
const { timezone, currentUser } = useAutomationsContext();
|
|
28
|
-
const { dashboardId, dashboardTitle } = useScheduledEmailDialogContext();
|
|
25
|
+
const { dashboardId, dashboardTitle, widgetLocalIdToTabIdMap: widgetTabMap, } = useScheduledEmailDialogContext();
|
|
29
26
|
const isWidget = !!widget && !!insight;
|
|
27
|
+
// Determine target tab ID if widget is present
|
|
28
|
+
const targetTabId = widget?.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
|
|
30
29
|
const defaultUser = convertCurrentUserToWorkspaceUser(users ?? [], currentUser);
|
|
31
30
|
const defaultRecipient = externalRecipientOverride
|
|
32
31
|
? convertExternalRecipientToAutomationRecipient(externalRecipientOverride)
|
|
@@ -65,6 +64,7 @@ export function useScheduledEmailFormState({ scheduledExportToEdit, widget, insi
|
|
|
65
64
|
parametersByTab: parametersByTabForNewAutomation,
|
|
66
65
|
}));
|
|
67
66
|
const [originalAutomation] = useState(editedAutomation);
|
|
67
|
+
const startDate = toNormalizedStartDate(editedAutomation.schedule?.firstRun, editedAutomation.schedule?.timezone);
|
|
68
68
|
const [isCronValid, setIsCronValid] = useState(true);
|
|
69
69
|
const [isTitleValid, setIsTitleValid] = useState(true);
|
|
70
70
|
const [isSubjectValid, setIsSubjectValid] = useState(true);
|
|
@@ -139,6 +139,7 @@ export function useScheduledEmailFormState({ scheduledExportToEdit, widget, insi
|
|
|
139
139
|
isTitleValid,
|
|
140
140
|
isSubjectValid,
|
|
141
141
|
isOnMessageValid,
|
|
142
|
+
startDate,
|
|
142
143
|
};
|
|
143
144
|
}
|
|
144
145
|
function newAutomationMetadataObjectDefinition({ timezone, dashboardId, notificationChannel, title, insight, widget, recipient, dashboardFilters, filtersByTab, widgetFilters, widgetFiltersWithInsight, visibleFiltersMetadata, visibleFiltersByTab, defaultPdfPageSize, evaluationMode, targetTabId, parametersByTab, }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultDashboardFilterGroup.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultDashboardFilterGroup.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAwCpG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAY9E;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,0BAA0B,GAAG,SAAS,CA6NxF"}
|
|
@@ -8,7 +8,7 @@ import { AttributeFilterDependencyTooltip, FilterGroup, useDeepEqualRefStablizer
|
|
|
8
8
|
import { convertDashboardAttributeFilterElementsUrisToValues } from "../../../_staging/dashboard/legacyFilterConvertors.js";
|
|
9
9
|
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
10
10
|
import { selectBackendCapabilities, selectSupportsElementUris, } from "../../../model/store/backendCapabilities/backendCapabilitiesSelectors.js";
|
|
11
|
-
import {
|
|
11
|
+
import { selectIsApplyFiltersAllAtOnceEnabledAndSet } from "../../../model/store/config/configSelectors.js";
|
|
12
12
|
import { selectAttributeFilterConfigsDisplayAsLabelMap, selectEffectiveAttributeFiltersModeMap, } from "../../../model/store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
|
|
13
13
|
import { selectEffectiveMeasureValueFiltersModeMap } from "../../../model/store/tabs/measureValueFilterConfigs/measureValueFilterConfigsSelectors.js";
|
|
14
14
|
import { useDashboardComponentsContext } from "../../dashboardContexts/DashboardComponentsContext.js";
|
|
@@ -28,8 +28,6 @@ export function DefaultDashboardFilterGroup(props) {
|
|
|
28
28
|
const attributeFiltersDisplayAsLabelMap = useDashboardSelector(selectAttributeFilterConfigsDisplayAsLabelMap);
|
|
29
29
|
const attributeFiltersModeMap = useDashboardSelector(selectEffectiveAttributeFiltersModeMap);
|
|
30
30
|
const measureValueFiltersModeMap = useDashboardSelector(selectEffectiveMeasureValueFiltersModeMap);
|
|
31
|
-
const enableArbitraryFilter = useDashboardSelector(selectEnableArbitraryFilterKD);
|
|
32
|
-
const enableMatchFilter = useDashboardSelector(selectEnableMatchFilterKD);
|
|
33
31
|
const getFilterIdentifier = useCallback((filter) => {
|
|
34
32
|
if (isFilterBarAttributeFilter(filter)) {
|
|
35
33
|
return dashboardAttributeFilterItemLocalIdentifier(filter.filter);
|
|
@@ -116,24 +114,12 @@ export function DefaultDashboardFilterGroup(props) {
|
|
|
116
114
|
}
|
|
117
115
|
const localId = dashboardAttributeFilterItemLocalIdentifier(filter.filter);
|
|
118
116
|
return (attributeFiltersModeMap.get(localId) !== DashboardAttributeFilterConfigModeValues.HIDDEN);
|
|
119
|
-
})
|
|
120
|
-
.filter((filter) => {
|
|
121
|
-
// Gate text filter types by feature flags
|
|
122
|
-
if (isDashboardArbitraryAttributeFilter(filter.filter)) {
|
|
123
|
-
return enableArbitraryFilter;
|
|
124
|
-
}
|
|
125
|
-
if (isDashboardMatchAttributeFilter(filter.filter)) {
|
|
126
|
-
return enableMatchFilter;
|
|
127
|
-
}
|
|
128
|
-
return true;
|
|
129
117
|
});
|
|
130
118
|
}, [
|
|
131
119
|
groupItem.filters,
|
|
132
120
|
supportElementUris,
|
|
133
121
|
attributeFiltersModeMap,
|
|
134
122
|
measureValueFiltersModeMap,
|
|
135
|
-
enableArbitraryFilter,
|
|
136
|
-
enableMatchFilter,
|
|
137
123
|
onMeasureValueFilterChanged,
|
|
138
124
|
]);
|
|
139
125
|
const filterDependenciesByLocalIdUnstable = useMemo(() => {
|
|
@@ -3773,9 +3773,8 @@ export declare const DEFAULT_TAB_ID = "defaultTabId";
|
|
|
3773
3773
|
* wholesale slot replacement, inherit the contexts automatically and require no extra wiring.
|
|
3774
3774
|
*
|
|
3775
3775
|
* The providers are intentionally hoisted above the slot rather than built inside this component:
|
|
3776
|
-
* that is what lets a wholesale replacement receive the same contexts
|
|
3777
|
-
*
|
|
3778
|
-
* providers throws at runtime.
|
|
3776
|
+
* that is what lets a wholesale replacement receive the same contexts. Rendering this component
|
|
3777
|
+
* outside those providers throws at runtime.
|
|
3779
3778
|
*
|
|
3780
3779
|
* @alpha
|
|
3781
3780
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-dashboard",
|
|
3
|
-
"version": "11.50.0
|
|
3
|
+
"version": "11.50.0",
|
|
4
4
|
"description": "GoodData SDK - Dashboard Component",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -60,20 +60,20 @@
|
|
|
60
60
|
"ts-invariant": "0.10.3",
|
|
61
61
|
"tslib": "2.8.1",
|
|
62
62
|
"uuid": "11.1.1",
|
|
63
|
-
"@gooddata/sdk-backend-base": "11.50.0
|
|
64
|
-
"@gooddata/sdk-backend-spi": "11.50.0
|
|
65
|
-
"@gooddata/sdk-model": "11.50.0
|
|
66
|
-
"@gooddata/sdk-ui": "11.50.0
|
|
67
|
-
"@gooddata/sdk-ui-charts": "11.50.0
|
|
68
|
-
"@gooddata/sdk-ui-ext": "11.50.0
|
|
69
|
-
"@gooddata/sdk-ui-filters": "11.50.0
|
|
70
|
-
"@gooddata/sdk-ui-
|
|
71
|
-
"@gooddata/sdk-ui-
|
|
72
|
-
"@gooddata/sdk-ui-pivot": "11.50.0
|
|
73
|
-
"@gooddata/sdk-ui-semantic-search": "11.50.0
|
|
74
|
-
"@gooddata/
|
|
75
|
-
"@gooddata/sdk-ui-vis-commons": "11.50.0
|
|
76
|
-
"@gooddata/
|
|
63
|
+
"@gooddata/sdk-backend-base": "11.50.0",
|
|
64
|
+
"@gooddata/sdk-backend-spi": "11.50.0",
|
|
65
|
+
"@gooddata/sdk-model": "11.50.0",
|
|
66
|
+
"@gooddata/sdk-ui": "11.50.0",
|
|
67
|
+
"@gooddata/sdk-ui-charts": "11.50.0",
|
|
68
|
+
"@gooddata/sdk-ui-ext": "11.50.0",
|
|
69
|
+
"@gooddata/sdk-ui-filters": "11.50.0",
|
|
70
|
+
"@gooddata/sdk-ui-kit": "11.50.0",
|
|
71
|
+
"@gooddata/sdk-ui-geo": "11.50.0",
|
|
72
|
+
"@gooddata/sdk-ui-pivot": "11.50.0",
|
|
73
|
+
"@gooddata/sdk-ui-semantic-search": "11.50.0",
|
|
74
|
+
"@gooddata/util": "11.50.0",
|
|
75
|
+
"@gooddata/sdk-ui-vis-commons": "11.50.0",
|
|
76
|
+
"@gooddata/sdk-ui-theme-provider": "11.50.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -119,12 +119,12 @@
|
|
|
119
119
|
"typescript": "5.9.3",
|
|
120
120
|
"vitest": "4.1.8",
|
|
121
121
|
"vitest-dom": "0.1.1",
|
|
122
|
-
"@gooddata/eslint-config": "11.50.0
|
|
123
|
-
"@gooddata/i18n-toolkit": "11.50.0
|
|
124
|
-
"@gooddata/oxlint-config": "11.50.0
|
|
125
|
-
"@gooddata/reference-workspace": "11.50.0
|
|
126
|
-
"@gooddata/
|
|
127
|
-
"@gooddata/
|
|
122
|
+
"@gooddata/eslint-config": "11.50.0",
|
|
123
|
+
"@gooddata/i18n-toolkit": "11.50.0",
|
|
124
|
+
"@gooddata/oxlint-config": "11.50.0",
|
|
125
|
+
"@gooddata/reference-workspace": "11.50.0",
|
|
126
|
+
"@gooddata/sdk-backend-mockingbird": "11.50.0",
|
|
127
|
+
"@gooddata/stylelint-config": "11.50.0"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
130
|
"react": "^18.0.0 || ^19.0.0",
|
package/styles/css/main.css
CHANGED
|
@@ -10132,7 +10132,6 @@ a.gd-button-link:hover .gd-button-text, a.gd-button-link-dimmed:hover .gd-button
|
|
|
10132
10132
|
}
|
|
10133
10133
|
|
|
10134
10134
|
.bubble .bubble-content .content a:not(.gd-ui-kit-link) {
|
|
10135
|
-
color: var(--gd-palette-complementary-0, #fff);
|
|
10136
10135
|
opacity: 0.8;
|
|
10137
10136
|
text-decoration: underline;
|
|
10138
10137
|
-moz-transition-property: all;
|
|
@@ -10164,6 +10163,10 @@ a.gd-button-link:hover .gd-button-text, a.gd-button-link-dimmed:hover .gd-button
|
|
|
10164
10163
|
margin-top: 0.5em;
|
|
10165
10164
|
}
|
|
10166
10165
|
|
|
10166
|
+
.bubble .content a:not(.gd-ui-kit-link) {
|
|
10167
|
+
color: inherit;
|
|
10168
|
+
}
|
|
10169
|
+
|
|
10167
10170
|
.bubble.bubble-primary {
|
|
10168
10171
|
padding: 0;
|
|
10169
10172
|
border-radius: 3px;
|