@gooddata/sdk-ui-dashboard 11.51.0-alpha.4 → 11.51.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/index.d.ts +3 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -1
- package/esm/model/commandHandlers/filterContext/filterViewHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/filterViewHandler.js +17 -4
- package/esm/model/commandHandlers/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/index.js +2 -0
- package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.d.ts +6 -0
- package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.d.ts.map +1 -0
- package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.js +39 -0
- package/esm/model/commands/base.d.ts +1 -1
- package/esm/model/commands/base.d.ts.map +1 -1
- package/esm/model/commands/index.d.ts +2 -1
- package/esm/model/commands/index.d.ts.map +1 -1
- package/esm/model/commands/timezone.d.ts +42 -0
- package/esm/model/commands/timezone.d.ts.map +1 -0
- package/esm/model/commands/timezone.js +29 -0
- package/esm/model/events/base.d.ts +1 -1
- package/esm/model/events/base.d.ts.map +1 -1
- package/esm/model/events/index.d.ts +2 -1
- package/esm/model/events/index.d.ts.map +1 -1
- package/esm/model/events/timezone.d.ts +50 -0
- package/esm/model/events/timezone.d.ts.map +1 -0
- package/esm/model/events/timezone.js +31 -0
- package/esm/model/react/useDashboardCommand.d.ts +1 -0
- package/esm/model/react/useDashboardCommand.d.ts.map +1 -1
- package/esm/model/react/useDashboardCommandProcessing.d.ts +4 -0
- package/esm/model/react/useDashboardCommandProcessing.d.ts.map +1 -1
- package/esm/model/store/filterViews/filterViewsReducers.d.ts +13 -1
- package/esm/model/store/filterViews/filterViewsReducers.d.ts.map +1 -1
- package/esm/model/store/filterViews/filterViewsReducers.js +46 -0
- package/esm/model/store/filterViews/filterViewsState.d.ts +22 -0
- package/esm/model/store/filterViews/filterViewsState.d.ts.map +1 -1
- package/esm/model/store/filterViews/index.d.ts +3 -0
- package/esm/model/store/filterViews/index.d.ts.map +1 -1
- package/esm/model/store/meta/metaSelectors.d.ts +6 -4
- package/esm/model/store/meta/metaSelectors.d.ts.map +1 -1
- package/esm/model/store/meta/metaSelectors.js +17 -6
- package/esm/model/store/ui/index.d.ts +3 -0
- package/esm/model/store/ui/index.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.d.ts +6 -0
- package/esm/model/store/ui/uiReducers.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.js +15 -0
- package/esm/model/store/ui/uiSelectors.d.ts +15 -0
- package/esm/model/store/ui/uiSelectors.d.ts.map +1 -1
- package/esm/model/store/ui/uiSelectors.js +15 -0
- package/esm/model/store/ui/uiState.d.ts +12 -0
- package/esm/model/store/ui/uiState.d.ts.map +1 -1
- package/esm/model/store/ui/uiState.js +4 -0
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +4 -23
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts +17 -8
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFilters.js +19 -7
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts +7 -8
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.js +14 -4
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +6 -45
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/AttachmentSettings.d.ts +1 -3
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/AttachmentSettings.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/AttachmentSettings.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/AttachmentsList.d.ts +1 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/AttachmentsList.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/AttachmentsList.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/DashboardAttachments.d.ts +1 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/DashboardAttachments.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/DashboardAttachments.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/WidgetAttachments.d.ts +1 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/WidgetAttachments.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/WidgetAttachments.js +2 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +34 -30
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +20 -9
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.js +12 -3
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts +37 -15
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.js +41 -19
- package/esm/presentation/automations/scheduledEmail/utils/pdfPageSize.d.ts +1 -2
- package/esm/presentation/automations/scheduledEmail/utils/pdfPageSize.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/utils/pdfPageSize.js +12 -3
- package/esm/presentation/automations/shared/filters/conversions.d.ts +1 -1
- package/esm/presentation/automations/shared/filters/conversions.js +1 -1
- package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.js +2 -1
- package/esm/presentation/dashboard/DashboardHeader/TimezoneDialogProvider.d.ts +6 -0
- package/esm/presentation/dashboard/DashboardHeader/TimezoneDialogProvider.d.ts.map +1 -0
- package/esm/presentation/dashboard/DashboardHeader/TimezoneDialogProvider.js +14 -0
- package/esm/presentation/dashboard/components/DashboardLoading.js +1 -1
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.js +9 -7
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js +1 -6
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js +19 -16
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +40 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +45 -5
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +13 -2
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +11 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +13 -2
- package/esm/presentation/timezoneDialog/TimezoneDialog.d.ts +15 -0
- package/esm/presentation/timezoneDialog/TimezoneDialog.d.ts.map +1 -0
- package/esm/presentation/timezoneDialog/TimezoneDialog.js +80 -0
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +22 -3
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts.map +1 -1
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.js +2 -2
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts +5 -3
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.d.ts.map +1 -1
- package/esm/presentation/topBar/timezoneIndicator/resolveDashboardTimezoneInfo.js +6 -4
- package/esm/presentation/topBar/topBar/DefaultTopBar.d.ts.map +1 -1
- package/esm/presentation/topBar/topBar/DefaultTopBar.js +5 -3
- package/esm/sdk-ui-dashboard.d.ts +140 -11
- package/package.json +21 -21
- package/styles/css/filterBar.css +15 -44
- package/styles/css/filterBar.css.map +1 -1
- package/styles/css/main.css +38 -44
- package/styles/css/main.css.map +1 -1
- package/styles/css/timezoneDialog.css +24 -0
- package/styles/css/timezoneDialog.css.map +1 -0
- package/styles/scss/filterBar.scss +17 -62
- package/styles/scss/main.scss +1 -0
- package/styles/scss/timezoneDialog.scss +31 -0
|
@@ -4,12 +4,12 @@ import { useIntl } from "react-intl";
|
|
|
4
4
|
import { AttachmentSettings } from "./AttachmentSettings.js";
|
|
5
5
|
import { attachmentIcons, dashboardAttachmentLabels, widgetAttachmentLabels } from "./AttachmentsSelect.js";
|
|
6
6
|
import { SlidesTemplateSettings } from "./SlidesTemplateSettings.js";
|
|
7
|
-
export function AttachmentsList({ attachments, onDelete, xlsxSettings, onXlsxSettingsChange, pdfSettings, onPdfSettingsChange, csvSettings, onCsvSettingsChange, csvRawSettings, onCsvRawSettingsChange,
|
|
7
|
+
export function AttachmentsList({ attachments, onDelete, xlsxSettings, onXlsxSettingsChange, pdfSettings, onPdfSettingsChange, csvSettings, onCsvSettingsChange, csvRawSettings, onCsvRawSettingsChange, mode, exportTemplates, slidesTemplateIds, onSlidesTemplateIdChange, }) {
|
|
8
8
|
const intl = useIntl();
|
|
9
9
|
return (_jsx(_Fragment, { children: attachments.map((attachment) => (_jsxs("div", { className: "gd-attachment-chip", children: [
|
|
10
10
|
_jsx("span", { className: `gd-attachment-chip-label ${attachmentIcons[attachment]}`, children: mode === "widget"
|
|
11
11
|
? widgetAttachmentLabels[attachment]
|
|
12
|
-
: dashboardAttachmentLabels[attachment] }), attachment === "XLSX" && (_jsx(AttachmentSettings, { type: "XLSX", settings: xlsxSettings, onSettingsChange: onXlsxSettingsChange })), attachment === "PDF_TABULAR" && pdfSettings && onPdfSettingsChange ? (_jsx(AttachmentSettings, { type: "PDF_TABULAR", settings: pdfSettings, onSettingsChange: onPdfSettingsChange
|
|
12
|
+
: dashboardAttachmentLabels[attachment] }), attachment === "XLSX" && (_jsx(AttachmentSettings, { type: "XLSX", settings: xlsxSettings, onSettingsChange: onXlsxSettingsChange })), attachment === "PDF_TABULAR" && pdfSettings && onPdfSettingsChange ? (_jsx(AttachmentSettings, { type: "PDF_TABULAR", settings: pdfSettings, onSettingsChange: onPdfSettingsChange })) : null, attachment === "CSV" && csvSettings && onCsvSettingsChange ? (_jsx(AttachmentSettings, { type: "CSV", settings: csvSettings, onSettingsChange: onCsvSettingsChange })) : null, attachment === "CSV_RAW" && csvRawSettings && onCsvRawSettingsChange ? (_jsx(AttachmentSettings, { type: "CSV_RAW", settings: csvRawSettings, onSettingsChange: onCsvRawSettingsChange })) : null, attachment === "PPTX" && exportTemplates && onSlidesTemplateIdChange ? (_jsx(SlidesTemplateSettings, { templates: exportTemplates, templateId: slidesTemplateIds?.PPTX, onTemplateIdChange: (id) => onSlidesTemplateIdChange(id, "PPTX") })) : null, attachment === "PDF_SLIDES" && exportTemplates && onSlidesTemplateIdChange ? (_jsx(SlidesTemplateSettings, { templates: exportTemplates, templateId: slidesTemplateIds?.PDF_SLIDES, onTemplateIdChange: (id) => onSlidesTemplateIdChange(id, "PDF_SLIDES") })) : null, attachment === "PDF" &&
|
|
13
13
|
mode === "widget" &&
|
|
14
14
|
exportTemplates &&
|
|
15
15
|
onSlidesTemplateIdChange ? (_jsx(SlidesTemplateSettings, { templates: exportTemplates, templateId: slidesTemplateIds?.PDF, onTemplateIdChange: (id) => onSlidesTemplateIdChange(id, "PDF") })) : null, _jsx("button", { className: "gd-attachment-chip-button gd-attachment-chip-delete", "aria-label": intl.formatMessage({ id: "dialogs.schedule.management.attachments.delete" }, { format: attachment }), onClick: () => onDelete(attachment), children: _jsx("svg", { width: "14", height: "14", viewBox: "0 0 20 20", "aria-hidden": "true", fill: "currentColor", children: _jsx("path", { d: "M10.7031 10.0049L16.3574 15.6494C16.4551 15.7471 16.5039 15.8643 16.5039 16.001C16.5039 16.1377 16.4551 16.2549 16.3574 16.3525C16.3053 16.4046 16.2467 16.4437 16.1816 16.4697C16.123 16.4893 16.0612 16.499 15.9961 16.499C15.9375 16.499 15.8757 16.4893 15.8105 16.4697C15.752 16.4437 15.6966 16.4046 15.6445 16.3525L10 10.708L4.35547 16.3525C4.30339 16.4046 4.24479 16.4437 4.17969 16.4697C4.12109 16.4893 4.0625 16.499 4.00391 16.499C3.9388 16.499 3.8737 16.4893 3.80859 16.4697C3.75 16.4437 3.69466 16.4046 3.64258 16.3525C3.54492 16.2549 3.49609 16.1377 3.49609 16.001C3.49609 15.8643 3.54492 15.7471 3.64258 15.6494L9.29688 10.0049L3.64258 4.35059C3.54492 4.25293 3.49609 4.13574 3.49609 3.99902C3.49609 3.8623 3.54492 3.74512 3.64258 3.64746C3.74023 3.5498 3.85742 3.50098 3.99414 3.50098C4.13737 3.50098 4.25781 3.5498 4.35547 3.64746L10 9.29199L15.6445 3.64746C15.7422 3.5498 15.8594 3.50098 15.9961 3.50098C16.1393 3.50098 16.2598 3.5498 16.3574 3.64746C16.4551 3.74512 16.5039 3.8623 16.5039 3.99902C16.5039 4.13574 16.4551 4.25293 16.3574 4.35059L10.7031 10.0049Z" }) }) })
|
|
@@ -7,7 +7,6 @@ export interface IDashboardAttachmentsProps {
|
|
|
7
7
|
xlsxSettings: IExportDefinitionVisualizationObjectSettings;
|
|
8
8
|
onXlsxSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
9
9
|
isSlidesExportEnabled: boolean;
|
|
10
|
-
defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
|
|
11
10
|
exportTemplates?: IExportTemplate[];
|
|
12
11
|
slidesTemplateIds?: {
|
|
13
12
|
PPTX?: string;
|
|
@@ -16,5 +15,5 @@ export interface IDashboardAttachmentsProps {
|
|
|
16
15
|
};
|
|
17
16
|
onSlidesTemplateIdChange?: (templateId: string | undefined, format: "PPTX" | "PDF_SLIDES" | "PDF") => void;
|
|
18
17
|
}
|
|
19
|
-
export declare function DashboardAttachments({ dashboardFilters, isCrossFiltering, onDashboardAttachmentsChange, selectedAttachments, xlsxSettings, onXlsxSettingsChange, isSlidesExportEnabled,
|
|
18
|
+
export declare function DashboardAttachments({ dashboardFilters, isCrossFiltering, onDashboardAttachmentsChange, selectedAttachments, xlsxSettings, onXlsxSettingsChange, isSlidesExportEnabled, exportTemplates, slidesTemplateIds, onSlidesTemplateIdChange }: IDashboardAttachmentsProps): import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
//# sourceMappingURL=DashboardAttachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardAttachments.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/DashboardAttachments.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,4CAA4C,EACjD,KAAK,eAAe,EACvB,MAAM,qBAAqB,CAAC;AAa7B,MAAM,WAAW,0BAA0B;IACvC,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;IAC/C,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4BAA4B,EAAE,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAC1G,YAAY,EAAE,4CAA4C,CAAC;IAC3D,oBAAoB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACvF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,
|
|
1
|
+
{"version":3,"file":"DashboardAttachments.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/DashboardAttachments.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,4CAA4C,EACjD,KAAK,eAAe,EACvB,MAAM,qBAAqB,CAAC;AAa7B,MAAM,WAAW,0BAA0B;IACvC,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;IAC/C,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4BAA4B,EAAE,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAC1G,YAAY,EAAE,4CAA4C,CAAC;IAC3D,oBAAoB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACvF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,iBAAiB,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE,wBAAwB,CAAC,EAAE,CACvB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,KAAK,KACpC,IAAI,CAAC;CACb;AAED,wBAAgB,oBAAoB,CAAC,EACjC,gBAAgB,EAChB,gBAAgB,EAChB,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EAC3B,EAAE,0BAA0B,2CA4H5B"}
|
|
@@ -10,7 +10,7 @@ import { AttachmentsSelect } from "./AttachmentsSelect.js";
|
|
|
10
10
|
import { AttachmentsWrapper } from "./AttachmentsWrapper.js";
|
|
11
11
|
const ALL_DASHBOARD_ATTACHMENTS = ["PDF", "PDF_SLIDES", "PPTX", "XLSX"];
|
|
12
12
|
const SLIDE_DASHBOARD_ATTACHMENTS = ["PDF_SLIDES", "PPTX"];
|
|
13
|
-
export function DashboardAttachments({ dashboardFilters, isCrossFiltering, onDashboardAttachmentsChange, selectedAttachments, xlsxSettings, onXlsxSettingsChange, isSlidesExportEnabled,
|
|
13
|
+
export function DashboardAttachments({ dashboardFilters, isCrossFiltering, onDashboardAttachmentsChange, selectedAttachments, xlsxSettings, onXlsxSettingsChange, isSlidesExportEnabled, exportTemplates, slidesTemplateIds, onSlidesTemplateIdChange, }) {
|
|
14
14
|
const intl = useIntl();
|
|
15
15
|
const { available: availableAttachments, visibleSelected: visibleSelectedAttachments, buildNextSelection, } = partitionAttachments({
|
|
16
16
|
all: ALL_DASHBOARD_ATTACHMENTS,
|
|
@@ -71,7 +71,7 @@ export function DashboardAttachments({ dashboardFilters, isCrossFiltering, onDas
|
|
|
71
71
|
};
|
|
72
72
|
return (_jsxs(_Fragment, { children: [
|
|
73
73
|
_jsx(AttachmentsWrapper, { children: _jsxs("div", { className: "gd-attachment-list", role: "group", "aria-labelledby": AUTOMATION_ATTACHMENTS_GROUP_LABEL_ID, ref: attachmentListRef, onBlur: makeAttachmentGroupUnfocusable, children: [
|
|
74
|
-
_jsx(AttachmentsList, { attachments: visibleSelectedAttachments, onDelete: handleDelete, xlsxSettings: xlsxSettings, onXlsxSettingsChange: onXlsxSettingsChange,
|
|
74
|
+
_jsx(AttachmentsList, { attachments: visibleSelectedAttachments, onDelete: handleDelete, xlsxSettings: xlsxSettings, onXlsxSettingsChange: onXlsxSettingsChange, mode: "dashboard", exportTemplates: exportTemplates, slidesTemplateIds: slidesTemplateIds, onSlidesTemplateIdChange: onSlidesTemplateIdChange }), _jsx(AttachmentsSelect, { attachments: availableAttachments.map((format) => ({
|
|
75
75
|
type: format,
|
|
76
76
|
selected: selectedAttachments.includes(format),
|
|
77
77
|
})), onChange: handleChange, mode: "dashboard", onAddButtonRef: (ref) => {
|
|
@@ -12,7 +12,6 @@ export interface IWidgetAttachmentsProps {
|
|
|
12
12
|
onCsvRawSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
13
13
|
isSlidesExportEnabled: boolean;
|
|
14
14
|
isAccessibilityModeEnabled: boolean;
|
|
15
|
-
defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
|
|
16
15
|
exportTemplates?: IExportTemplate[];
|
|
17
16
|
slidesTemplateIds?: {
|
|
18
17
|
PPTX?: string;
|
|
@@ -21,5 +20,5 @@ export interface IWidgetAttachmentsProps {
|
|
|
21
20
|
};
|
|
22
21
|
onSlidesTemplateIdChange?: (templateId: string | undefined, format: "PPTX" | "PDF_SLIDES" | "PDF") => void;
|
|
23
22
|
}
|
|
24
|
-
export declare function WidgetAttachments({ selectedAttachments, onWidgetAttachmentsChange, xlsxSettings, onXlsxSettingsChange, pdfSettings, onPdfSettingsChange, csvSettings, onCsvSettingsChange, csvRawSettings, onCsvRawSettingsChange, isSlidesExportEnabled, isAccessibilityModeEnabled,
|
|
23
|
+
export declare function WidgetAttachments({ selectedAttachments, onWidgetAttachmentsChange, xlsxSettings, onXlsxSettingsChange, pdfSettings, onPdfSettingsChange, csvSettings, onCsvSettingsChange, csvRawSettings, onCsvRawSettingsChange, isSlidesExportEnabled, isAccessibilityModeEnabled, exportTemplates, slidesTemplateIds, onSlidesTemplateIdChange }: IWidgetAttachmentsProps): import("react/jsx-runtime").JSX.Element;
|
|
25
24
|
//# sourceMappingURL=WidgetAttachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetAttachments.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/WidgetAttachments.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,4CAA4C,EACjD,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC5B,MAAM,qBAAqB,CAAC;AAqB7B,MAAM,WAAW,uBAAuB;IACpC,mBAAmB,EAAE,oBAAoB,EAAE,CAAC;IAC5C,yBAAyB,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IACrE,YAAY,EAAE,4CAA4C,CAAC;IAC3D,oBAAoB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACvF,WAAW,EAAE,4CAA4C,CAAC;IAC1D,mBAAmB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACtF,WAAW,EAAE,4CAA4C,CAAC;IAC1D,mBAAmB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACtF,cAAc,EAAE,4CAA4C,CAAC;IAC7D,sBAAsB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACzF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,0BAA0B,EAAE,OAAO,CAAC;IACpC,
|
|
1
|
+
{"version":3,"file":"WidgetAttachments.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/Attachments/WidgetAttachments.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,4CAA4C,EACjD,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC5B,MAAM,qBAAqB,CAAC;AAqB7B,MAAM,WAAW,uBAAuB;IACpC,mBAAmB,EAAE,oBAAoB,EAAE,CAAC;IAC5C,yBAAyB,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IACrE,YAAY,EAAE,4CAA4C,CAAC;IAC3D,oBAAoB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACvF,WAAW,EAAE,4CAA4C,CAAC;IAC1D,mBAAmB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACtF,WAAW,EAAE,4CAA4C,CAAC;IAC1D,mBAAmB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACtF,cAAc,EAAE,4CAA4C,CAAC;IAC7D,sBAAsB,EAAE,CAAC,QAAQ,EAAE,4CAA4C,KAAK,IAAI,CAAC;IACzF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,0BAA0B,EAAE,OAAO,CAAC;IACpC,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,iBAAiB,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE,wBAAwB,CAAC,EAAE,CACvB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,KAAK,KACpC,IAAI,CAAC;CACb;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EAC3B,EAAE,uBAAuB,2CA4HzB"}
|
|
@@ -18,7 +18,7 @@ const ALL_WIDGET_ATTACHMENTS = [
|
|
|
18
18
|
];
|
|
19
19
|
const SLIDE_WIDGET_ATTACHMENTS = ["PDF", "PPTX"];
|
|
20
20
|
const ACCESSIBILITY_MODE_EXCLUDED_WIDGET_ATTACHMENTS = ["PDF_TABULAR"];
|
|
21
|
-
export function WidgetAttachments({ selectedAttachments, onWidgetAttachmentsChange, xlsxSettings, onXlsxSettingsChange, pdfSettings, onPdfSettingsChange, csvSettings, onCsvSettingsChange, csvRawSettings, onCsvRawSettingsChange, isSlidesExportEnabled, isAccessibilityModeEnabled,
|
|
21
|
+
export function WidgetAttachments({ selectedAttachments, onWidgetAttachmentsChange, xlsxSettings, onXlsxSettingsChange, pdfSettings, onPdfSettingsChange, csvSettings, onCsvSettingsChange, csvRawSettings, onCsvRawSettingsChange, isSlidesExportEnabled, isAccessibilityModeEnabled, exportTemplates, slidesTemplateIds, onSlidesTemplateIdChange, }) {
|
|
22
22
|
const intl = useIntl();
|
|
23
23
|
const { available: availableAttachments, visibleSelected: visibleSelectedAttachments, buildNextSelection, } = partitionAttachments({
|
|
24
24
|
all: ALL_WIDGET_ATTACHMENTS,
|
|
@@ -83,7 +83,7 @@ export function WidgetAttachments({ selectedAttachments, onWidgetAttachmentsChan
|
|
|
83
83
|
};
|
|
84
84
|
return (_jsxs(_Fragment, { children: [
|
|
85
85
|
_jsx(AttachmentsWrapper, { children: _jsxs("div", { className: "gd-attachment-list", role: "group", "aria-labelledby": AUTOMATION_ATTACHMENTS_GROUP_LABEL_ID, ref: attachmentListRef, onBlur: makeAttachmentGroupUnfocusable, children: [
|
|
86
|
-
_jsx(AttachmentsList, { attachments: visibleSelectedAttachments, onDelete: handleDelete, xlsxSettings: xlsxSettings, onXlsxSettingsChange: onXlsxSettingsChange, pdfSettings: pdfSettings, onPdfSettingsChange: onPdfSettingsChange, csvSettings: csvSettings, onCsvSettingsChange: onCsvSettingsChange, csvRawSettings: csvRawSettings, onCsvRawSettingsChange: onCsvRawSettingsChange,
|
|
86
|
+
_jsx(AttachmentsList, { attachments: visibleSelectedAttachments, onDelete: handleDelete, xlsxSettings: xlsxSettings, onXlsxSettingsChange: onXlsxSettingsChange, pdfSettings: pdfSettings, onPdfSettingsChange: onPdfSettingsChange, csvSettings: csvSettings, onCsvSettingsChange: onCsvSettingsChange, csvRawSettings: csvRawSettings, onCsvRawSettingsChange: onCsvRawSettingsChange, mode: "widget", exportTemplates: exportTemplates, slidesTemplateIds: slidesTemplateIds, onSlidesTemplateIdChange: onSlidesTemplateIdChange }), _jsx(AttachmentsSelect, { attachments: availableAttachments.map((format) => ({
|
|
87
87
|
type: format,
|
|
88
88
|
selected: selectedAttachments.includes(format),
|
|
89
89
|
})), onChange: handleChange, mode: "widget", onAddButtonRef: (ref) => {
|
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
|
|
1
|
+
import { type PdfPageSize } from "../../utils/pdfPageSize.js";
|
|
3
2
|
export interface IUseEditScheduledEmailProps {
|
|
4
3
|
maxAutomationsRecipients: number;
|
|
5
|
-
|
|
6
|
-
setEditedAutomationFilters: (filters: FilterContextItem[]) => void;
|
|
7
|
-
/**
|
|
8
|
-
* Edited filters structured by tab ID for dashboard automations with tabs enabled.
|
|
9
|
-
* When provided, these are used instead of dashboardFilters for per-tab filter storage.
|
|
10
|
-
*/
|
|
11
|
-
editedAutomationFiltersByTab?: Record<string, FilterContextItem[]>;
|
|
4
|
+
externalRecipientOverride?: string;
|
|
12
5
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
6
|
+
* Locale-derived default page size for new PDF attachments. Required and non-nullable: it
|
|
7
|
+
* reaches the saved export definition through {@link useScheduledEmailExportSettings}, so a caller
|
|
8
|
+
* that omits it silently saves `A4` where the locale asks for `LETTER`.
|
|
15
9
|
*/
|
|
16
|
-
|
|
17
|
-
filtersDataByTab?: IAutomationFiltersTab[] | undefined;
|
|
18
|
-
availableFiltersAsVisibleFilters?: IAutomationVisibleFilter[] | undefined;
|
|
19
|
-
availableFiltersAsVisibleFiltersByTab?: Record<string, IAutomationVisibleFilter[]>;
|
|
20
|
-
storeFilters?: boolean;
|
|
21
|
-
setStoreFilters: (storeFilters: boolean) => void;
|
|
22
|
-
filtersForNewAutomation: FilterContextItem[];
|
|
23
|
-
externalRecipientOverride?: string;
|
|
24
|
-
defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
|
|
10
|
+
defaultPdfPageSize: PdfPageSize;
|
|
25
11
|
}
|
|
26
|
-
export declare function useEditScheduledEmail({
|
|
12
|
+
export declare function useEditScheduledEmail({ maxAutomationsRecipients, externalRecipientOverride, defaultPdfPageSize }: IUseEditScheduledEmailProps): {
|
|
13
|
+
parametersEnabled: boolean;
|
|
14
|
+
visibleParametersByTab: import("../../../shared/automationFilters/useAutomationExportParameters.js").EditedParametersByTab;
|
|
15
|
+
availableParametersByTab: import("../../../shared/automationFilters/useAutomationExportParameters.js").EditedParametersByTab;
|
|
16
|
+
flatTabId: string | undefined;
|
|
17
|
+
onParameterAdd: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
18
|
+
onParameterChange: (ref: import("@gooddata/sdk-model").IdentifierRef, value: string | number) => void;
|
|
19
|
+
onParameterDelete: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
20
|
+
onParameterAddByTab: (tabId: string, ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
21
|
+
onParameterChangeByTab: (tabId: string, ref: import("@gooddata/sdk-model").IdentifierRef, value: string | number) => void;
|
|
22
|
+
onParameterDeleteByTab: (tabId: string, ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
23
|
+
applyLatest: () => void;
|
|
24
|
+
onStoreParametersChange: (storeParameters: boolean) => void;
|
|
25
|
+
selectedFilters: import("@gooddata/sdk-model").FilterContextItem[];
|
|
26
|
+
availableFilters: import("@gooddata/sdk-model").FilterContextItem[] | undefined;
|
|
27
|
+
storeFilters: boolean;
|
|
28
|
+
filtersByTab: import("../../../../../index.js").IAutomationFiltersTab[] | undefined;
|
|
29
|
+
editedFiltersByTab: Record<string, import("@gooddata/sdk-model").FilterContextItem[]> | undefined;
|
|
30
|
+
onFiltersChange: (filters: import("@gooddata/sdk-model").FilterContextItem[], storeFiltersParam?: boolean | undefined) => void;
|
|
31
|
+
onFiltersByTabChange: (newFiltersByTab: Record<string, import("@gooddata/sdk-model").FilterContextItem[]>, storeFiltersParam?: boolean | undefined) => void;
|
|
32
|
+
onApplyCurrentFilters: () => void;
|
|
33
|
+
onStoreFiltersChange: (value: boolean, filters?: import("@gooddata/sdk-model").FilterContextItem[] | undefined, filtersByTabParam?: Record<string, import("@gooddata/sdk-model").FilterContextItem[]> | undefined) => void;
|
|
34
|
+
automationIsValid: boolean;
|
|
35
|
+
filtersAreStale: boolean;
|
|
27
36
|
defaultUser: import("@gooddata/sdk-model").IWorkspaceUser;
|
|
28
37
|
areDashboardFiltersChanged: boolean;
|
|
29
38
|
originalAutomation: import("@gooddata/sdk-model").IAutomationMetadataObjectDefinition;
|
|
@@ -55,7 +64,6 @@ export declare function useEditScheduledEmail({ editedAutomationFilters, editedA
|
|
|
55
64
|
allowExternalRecipients: boolean;
|
|
56
65
|
validationErrorMessage: string | undefined;
|
|
57
66
|
isSubmitDisabled: boolean | undefined;
|
|
58
|
-
storeFilters: boolean | undefined;
|
|
59
67
|
selectedAttachments: ("CSV" | "CSV_RAW" | "HTML" | "PDF" | "PDF_SLIDES" | "PDF_TABULAR" | "PNG" | "PPTX" | "XLSX")[];
|
|
60
68
|
isParentValid: boolean;
|
|
61
69
|
onTitleChange: (value: string, isValid: boolean) => void;
|
|
@@ -67,20 +75,16 @@ export declare function useEditScheduledEmail({ editedAutomationFilters, editedA
|
|
|
67
75
|
onMessageChange: (value: string, isValid: boolean) => void;
|
|
68
76
|
onDashboardAttachmentsChange: (formats: import("@gooddata/sdk-model").DashboardAttachmentType[]) => void;
|
|
69
77
|
onWidgetAttachmentsChange: (formats: import("@gooddata/sdk-model").WidgetAttachmentType[]) => void;
|
|
70
|
-
onXlsxSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
71
|
-
onPdfSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
72
|
-
onCsvSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
73
|
-
onCsvRawSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
|
|
78
|
+
onXlsxSettingsChange: (settings: import("@gooddata/sdk-model").IExportDefinitionVisualizationObjectSettings) => void;
|
|
79
|
+
onPdfSettingsChange: (settings: import("@gooddata/sdk-model").IExportDefinitionVisualizationObjectSettings) => void;
|
|
80
|
+
onCsvSettingsChange: (settings: import("@gooddata/sdk-model").IExportDefinitionVisualizationObjectSettings) => void;
|
|
81
|
+
onCsvRawSettingsChange: (settings: import("@gooddata/sdk-model").IExportDefinitionVisualizationObjectSettings) => void;
|
|
74
82
|
slidesTemplateIds: {
|
|
75
83
|
PPTX: string | undefined;
|
|
76
84
|
PDF_SLIDES: string | undefined;
|
|
77
85
|
PDF: string | undefined;
|
|
78
86
|
};
|
|
79
87
|
onSlidesTemplateIdChange: (templateId: string | undefined, format: "PDF" | "PDF_SLIDES" | "PPTX") => void;
|
|
80
|
-
onFiltersChange: (filters: FilterContextItem[], storeFiltersParam?: boolean | undefined) => void;
|
|
81
|
-
onApplyCurrentFilters: () => void;
|
|
82
|
-
onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[] | undefined, filtersByTabParam?: Record<string, FilterContextItem[]> | undefined) => void;
|
|
83
|
-
onFiltersByTabChange: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean | undefined) => void;
|
|
84
88
|
setParametersWire: (wire: Record<string, import("@gooddata/sdk-model").IDashboardExportParameter[]> | undefined) => void;
|
|
85
89
|
enableAutomationEvaluationMode: boolean;
|
|
86
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditScheduledEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useEditScheduledEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAQ9D,MAAM,WAAW,2BAA2B;IACxC,wBAAwB,EAAE,MAAM,CAAC;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;OAIG;IACH,kBAAkB,EAAE,WAAW,CAAC;CACnC;AAED,wBAAgB,qBAAqB,CAAC,EAClC,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EACrB,EAAE,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8M7B"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
2
|
import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
|
|
3
3
|
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
4
|
+
import { useAutomationFiltersSelect } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
|
|
4
5
|
import { useScheduledEmailEffectiveFilters } from "./useScheduledEmailEffectiveFilters.js";
|
|
5
6
|
import { useScheduledEmailExportSettings } from "./useScheduledEmailExportSettings.js";
|
|
6
7
|
import { useScheduledEmailFilters } from "./useScheduledEmailFilters.js";
|
|
7
8
|
import { useScheduledEmailFormState } from "./useScheduledEmailFormState.js";
|
|
8
9
|
import { useScheduledEmailFormValidity } from "./useScheduledEmailFormValidity.js";
|
|
9
|
-
export function useEditScheduledEmail({
|
|
10
|
+
export function useEditScheduledEmail({ maxAutomationsRecipients, externalRecipientOverride, defaultPdfPageSize, }) {
|
|
10
11
|
const { features: { enableAutomationEvaluationMode }, } = useAutomationsContext();
|
|
11
12
|
const { scheduledExportToEdit, widget, insight, users, usersError, notificationChannels, dashboardFilters, } = useScheduledEmailDialogContext();
|
|
12
13
|
const areDashboardFiltersChanged = !!dashboardFilters;
|
|
14
|
+
const { editedAutomationFilters, setEditedAutomationFilters, availableFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, storeFilters, setStoreFilters, filtersByTab, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, } = useAutomationFiltersSelect({ automationToEdit: scheduledExportToEdit, widget });
|
|
13
15
|
const { effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, } = useScheduledEmailEffectiveFilters({
|
|
14
16
|
widget,
|
|
15
17
|
insight,
|
|
@@ -17,7 +19,7 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
|
|
|
17
19
|
editedAutomationFiltersByTab,
|
|
18
20
|
availableFiltersAsVisibleFilters,
|
|
19
21
|
availableFiltersAsVisibleFiltersByTab,
|
|
20
|
-
filtersDataByTab,
|
|
22
|
+
filtersDataByTab: filtersByTab,
|
|
21
23
|
storeFilters,
|
|
22
24
|
});
|
|
23
25
|
const { editedAutomation, setEditedAutomation, originalAutomation, defaultRecipient, defaultUser, onTitleChange, onRecurrenceChange, onEvaluationModeChange, onDestinationChange, onRecipientsChange, onSubjectChange, onMessageChange, isCronValid, isTitleValid, isSubjectValid, isOnMessageValid, startDate, } = useScheduledEmailFormState({
|
|
@@ -49,18 +51,26 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
|
|
|
49
51
|
effectiveWidgetFiltersWithInsight,
|
|
50
52
|
defaultPdfPageSize,
|
|
51
53
|
});
|
|
52
|
-
|
|
54
|
+
// Kept whole rather than destructured: every member is re-exposed unchanged, so spreading it into
|
|
55
|
+
// the return means a member can never be dropped by forgetting to re-list it. What the model may
|
|
56
|
+
// contain is gated by its own shape test, not here.
|
|
57
|
+
const filterModel = useScheduledEmailFilters({
|
|
53
58
|
setEditedAutomation,
|
|
59
|
+
scheduledExportToEdit,
|
|
54
60
|
widget,
|
|
55
61
|
insight,
|
|
62
|
+
editedAutomationFilters,
|
|
56
63
|
setEditedAutomationFilters,
|
|
64
|
+
editedAutomationFiltersByTab,
|
|
57
65
|
setEditedAutomationFiltersByTab,
|
|
66
|
+
availableFilters,
|
|
58
67
|
availableFiltersAsVisibleFilters,
|
|
59
68
|
availableFiltersAsVisibleFiltersByTab,
|
|
60
|
-
|
|
69
|
+
filtersByTab,
|
|
61
70
|
storeFilters,
|
|
62
71
|
setStoreFilters,
|
|
63
72
|
filtersForNewAutomation,
|
|
73
|
+
setParametersWire,
|
|
64
74
|
});
|
|
65
75
|
const { isSubmitDisabled, validationErrorMessage, isParentValid, allowExternalRecipients, allowOnlyLoggedUserRecipients, } = useScheduledEmailFormValidity({
|
|
66
76
|
editedAutomation,
|
|
@@ -95,7 +105,6 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
|
|
|
95
105
|
allowExternalRecipients,
|
|
96
106
|
validationErrorMessage,
|
|
97
107
|
isSubmitDisabled,
|
|
98
|
-
storeFilters,
|
|
99
108
|
selectedAttachments,
|
|
100
109
|
isParentValid,
|
|
101
110
|
onTitleChange,
|
|
@@ -113,11 +122,13 @@ export function useEditScheduledEmail({ editedAutomationFilters, editedAutomatio
|
|
|
113
122
|
onCsvRawSettingsChange,
|
|
114
123
|
slidesTemplateIds,
|
|
115
124
|
onSlidesTemplateIdChange,
|
|
116
|
-
onFiltersChange,
|
|
117
|
-
onApplyCurrentFilters,
|
|
118
|
-
onStoreFiltersChange,
|
|
119
|
-
onFiltersByTabChange,
|
|
120
125
|
setParametersWire,
|
|
121
126
|
enableAutomationEvaluationMode,
|
|
127
|
+
// Filter and export-parameter model, absorbed from `useScheduledEmailFilters` (which itself
|
|
128
|
+
// absorbs `useAutomationExportParameters` and `useValidateExistingAutomationFilters`) — the
|
|
129
|
+
// renderer calls none of those three hooks itself, it takes their output from here. Spread
|
|
130
|
+
// last: its `availableFilters`, `storeFilters` and `filtersByTab` are the model's, not the
|
|
131
|
+
// raw selection hook's.
|
|
132
|
+
...filterModel,
|
|
122
133
|
};
|
|
123
134
|
}
|
|
@@ -1 +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;;;;;;;;;;;;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,
|
|
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,CAiHA"}
|
|
@@ -19,10 +19,17 @@ import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersB
|
|
|
19
19
|
export function useScheduledEmailEffectiveFilters({ widget, insight, editedAutomationFilters, editedAutomationFiltersByTab, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersDataByTab, storeFilters, }) {
|
|
20
20
|
const { hiddenFilters: dashboardHiddenFilters, commonDateFilterId, exportParametersByTab: effectiveExportParametersByTab, } = useScheduledEmailDialogContext();
|
|
21
21
|
const isWidget = !!widget && !!insight;
|
|
22
|
-
const effectiveWidgetFilters = getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, false);
|
|
23
|
-
const effectiveWidgetFiltersWithInsight = getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, true);
|
|
22
|
+
const effectiveWidgetFilters = useMemo(() => getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, false), [editedAutomationFilters, dashboardHiddenFilters, widget, insight, commonDateFilterId]);
|
|
23
|
+
const effectiveWidgetFiltersWithInsight = useMemo(() => getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, true), [editedAutomationFilters, dashboardHiddenFilters, widget, insight, commonDateFilterId]);
|
|
24
|
+
// The three visible-filter derivations below are deliberately NOT memoized: their
|
|
25
|
+
// `availableFiltersAsVisibleFilters*` dependency changes identity on every render, so a memo here
|
|
26
|
+
// would be a no-op that only looks like a guarantee. `useFiltersNamings` /
|
|
27
|
+
// `useFiltersByTabNamings` call `transformFiltersToNamings` unmemoized and return a fresh array
|
|
28
|
+
// each render, which invalidates `useAutomationVisibleFilters`' own memo; on the by-tab path
|
|
29
|
+
// `availableFiltersByTab` and `removeIgnoredWidgetFilters` in `useAutomationFiltersSelect` are
|
|
30
|
+
// unmemoized too. Stabilizing that chain upstream is the prerequisite — memoizing here is not.
|
|
24
31
|
const effectiveVisibleWidgetFilters = getVisibleFiltersByFilters(editedAutomationFilters, availableFiltersAsVisibleFilters, true);
|
|
25
|
-
const effectiveDashboardFilters = getAppliedDashboardFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, isWidget ? true : storeFilters);
|
|
32
|
+
const effectiveDashboardFilters = useMemo(() => getAppliedDashboardFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, isWidget ? true : storeFilters), [editedAutomationFilters, dashboardHiddenFilters, isWidget, storeFilters]);
|
|
26
33
|
// Process filters per tab if provided (for dashboard automations with tabs enabled)
|
|
27
34
|
const effectiveDashboardFiltersByTab = useMemo(() => {
|
|
28
35
|
if (!editedAutomationFiltersByTab || !storeFilters) {
|
|
@@ -39,7 +46,9 @@ export function useScheduledEmailEffectiveFilters({ widget, insight, editedAutom
|
|
|
39
46
|
return acc;
|
|
40
47
|
}, {});
|
|
41
48
|
}, [editedAutomationFiltersByTab, filtersDataByTab, storeFilters]);
|
|
49
|
+
// Not memoized — see the note above `effectiveVisibleWidgetFilters`.
|
|
42
50
|
const effectiveVisibleDashboardFilters = getVisibleFiltersByFilters(editedAutomationFilters ?? [], availableFiltersAsVisibleFilters, storeFilters);
|
|
51
|
+
// Not memoized — see the note above `effectiveVisibleWidgetFilters`.
|
|
43
52
|
const effectiveVisibleDashboardFiltersByTab = getVisibleFiltersByFiltersByTab(editedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, storeFilters);
|
|
44
53
|
// Mirrors the filters seed above, for parameters.
|
|
45
54
|
const parametersByTabForNewAutomation = shouldStoreExportParameters(isWidget, storeFilters) &&
|
|
@@ -1,34 +1,56 @@
|
|
|
1
1
|
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
-
import { type FilterContextItem, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IInsight, type IWidget } from "@gooddata/sdk-model";
|
|
2
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IDashboardExportParameter, type IInsight, type IWidget } from "@gooddata/sdk-model";
|
|
3
3
|
import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
|
|
4
|
+
import { type IUseAutomationExportParameters } from "../../../shared/automationFilters/useAutomationExportParameters.js";
|
|
4
5
|
export interface IUseScheduledEmailFiltersProps {
|
|
5
6
|
setEditedAutomation: Dispatch<SetStateAction<IAutomationMetadataObjectDefinition>>;
|
|
7
|
+
scheduledExportToEdit?: IAutomationMetadataObject;
|
|
6
8
|
widget?: IWidget;
|
|
7
9
|
insight?: IInsight;
|
|
10
|
+
editedAutomationFilters: FilterContextItem[];
|
|
8
11
|
setEditedAutomationFilters: (filters: FilterContextItem[]) => void;
|
|
12
|
+
editedAutomationFiltersByTab?: Record<string, FilterContextItem[]>;
|
|
9
13
|
setEditedAutomationFiltersByTab?: (filters: Record<string, FilterContextItem[]>) => void;
|
|
14
|
+
availableFilters?: FilterContextItem[];
|
|
10
15
|
availableFiltersAsVisibleFilters?: IAutomationVisibleFilter[] | undefined;
|
|
11
16
|
availableFiltersAsVisibleFiltersByTab?: Record<string, IAutomationVisibleFilter[]>;
|
|
12
|
-
|
|
13
|
-
storeFilters
|
|
17
|
+
filtersByTab?: IAutomationFiltersTab[] | undefined;
|
|
18
|
+
storeFilters: boolean;
|
|
14
19
|
setStoreFilters: (storeFilters: boolean) => void;
|
|
15
20
|
filtersForNewAutomation: FilterContextItem[];
|
|
21
|
+
setParametersWire: (wire: Record<string, IDashboardExportParameter[]> | undefined) => void;
|
|
16
22
|
}
|
|
17
23
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* The scheduled-email dialog's single filter model: the current selection and available filters
|
|
25
|
+
* (flat and per-tab), the handlers that mutate them and mirror the result into the draft, the
|
|
26
|
+
* `automationIsValid`/`filtersAreStale` staleness gate for a saved schedule, and the absorbed
|
|
27
|
+
* export-parameters model (chips, add/change/delete handlers, apply-latest and store-toggle).
|
|
28
|
+
* `automationIsValid` gates the repair / apply-current-filters dialog: it is false whenever the
|
|
29
|
+
* saved filters no longer match the dashboard, or the saved parameters are stale, or both — it does
|
|
30
|
+
* not distinguish which. `filtersAreStale` reports only whether saved filters no longer match.
|
|
31
|
+
* Parameters live here — rather than in form-state, as on the alerting side — because they have no
|
|
32
|
+
* draft dependency of their own; they only need `storeFilters` (the read model) and `setParametersWire`
|
|
33
|
+
* (from {@link useScheduledEmailExportSettings}).
|
|
25
34
|
*
|
|
26
35
|
* @internal
|
|
27
36
|
*/
|
|
28
|
-
export declare function useScheduledEmailFilters({ setEditedAutomation, widget, insight, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab,
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
export declare function useScheduledEmailFilters({ setEditedAutomation, scheduledExportToEdit, widget, insight, editedAutomationFilters, setEditedAutomationFilters, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, storeFilters, setStoreFilters, filtersForNewAutomation, setParametersWire }: IUseScheduledEmailFiltersProps): IUseScheduledEmailFilters;
|
|
38
|
+
/**
|
|
39
|
+
* Return type of {@link useScheduledEmailFilters}: its own filter model plus the whole absorbed
|
|
40
|
+
* {@link useAutomationExportParameters} model, spread in verbatim so its member names stay canonical.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export interface IUseScheduledEmailFilters extends IUseAutomationExportParameters {
|
|
44
|
+
selectedFilters: FilterContextItem[];
|
|
45
|
+
availableFilters: FilterContextItem[] | undefined;
|
|
46
|
+
storeFilters: boolean;
|
|
47
|
+
filtersByTab: IAutomationFiltersTab[] | undefined;
|
|
48
|
+
editedFiltersByTab: Record<string, FilterContextItem[]> | undefined;
|
|
49
|
+
onFiltersChange: (filters: FilterContextItem[], storeFiltersParam?: boolean) => void;
|
|
50
|
+
onFiltersByTabChange: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean) => void;
|
|
31
51
|
onApplyCurrentFilters: () => void;
|
|
32
|
-
onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[]
|
|
33
|
-
|
|
52
|
+
onStoreFiltersChange: (value: boolean, filters?: FilterContextItem[], filtersByTabParam?: Record<string, FilterContextItem[]>) => void;
|
|
53
|
+
automationIsValid: boolean;
|
|
54
|
+
filtersAreStale: boolean;
|
|
55
|
+
}
|
|
34
56
|
//# sourceMappingURL=useScheduledEmailFilters.d.ts.map
|
|
@@ -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;
|
|
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,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,OAAO,EAIf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAG3F,OAAO,EACH,KAAK,8BAA8B,EAEtC,MAAM,oEAAoE,CAAC;AAS5E,MAAM,WAAW,8BAA8B;IAC3C,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,CAAC,CAAC,CAAC;IACnF,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACnE,+BAA+B,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KAAK,IAAI,CAAC;IACzF,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,qCAAqC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC;IACnF,YAAY,CAAC,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IACnD,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;CAC9F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,mBAAmB,EACnB,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,gBAAgB,EAChB,gCAAgC,EAChC,qCAAqC,EACrC,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACpB,EAAE,8BAA8B,GAAG,yBAAyB,CAyQ5D;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,8BAA8B;IAC7E,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAClD,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IAClD,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GAAG,SAAS,CAAC;IACpE,eAAe,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrF,oBAAoB,EAAE,CAClB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EACpD,iBAAiB,CAAC,EAAE,OAAO,KAC1B,IAAI,CAAC;IACV,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,oBAAoB,EAAE,CAClB,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,iBAAiB,EAAE,EAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KACtD,IAAI,CAAC;IACV,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -2,20 +2,25 @@
|
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, } from "@gooddata/sdk-model";
|
|
4
4
|
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
5
|
+
import { useValidateExistingAutomationFilters } from "../../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
|
|
6
|
+
import { useAutomationExportParameters, } from "../../../shared/automationFilters/useAutomationExportParameters.js";
|
|
5
7
|
import { getDefaultSelectedFiltersFromFiltersByTab } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
|
|
6
8
|
import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/filters/index.js";
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* The scheduled-email dialog's single filter model: the current selection and available filters
|
|
11
|
+
* (flat and per-tab), the handlers that mutate them and mirror the result into the draft, the
|
|
12
|
+
* `automationIsValid`/`filtersAreStale` staleness gate for a saved schedule, and the absorbed
|
|
13
|
+
* export-parameters model (chips, add/change/delete handlers, apply-latest and store-toggle).
|
|
14
|
+
* `automationIsValid` gates the repair / apply-current-filters dialog: it is false whenever the
|
|
15
|
+
* saved filters no longer match the dashboard, or the saved parameters are stale, or both — it does
|
|
16
|
+
* not distinguish which. `filtersAreStale` reports only whether saved filters no longer match.
|
|
17
|
+
* Parameters live here — rather than in form-state, as on the alerting side — because they have no
|
|
18
|
+
* draft dependency of their own; they only need `storeFilters` (the read model) and `setParametersWire`
|
|
19
|
+
* (from {@link useScheduledEmailExportSettings}).
|
|
15
20
|
*
|
|
16
21
|
* @internal
|
|
17
22
|
*/
|
|
18
|
-
export function useScheduledEmailFilters({ setEditedAutomation, widget, insight, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab,
|
|
23
|
+
export function useScheduledEmailFilters({ setEditedAutomation, scheduledExportToEdit, widget, insight, editedAutomationFilters, setEditedAutomationFilters, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, storeFilters, setStoreFilters, filtersForNewAutomation, setParametersWire, }) {
|
|
19
24
|
const { hiddenFilters: dashboardHiddenFilters, commonDateFilterId } = useScheduledEmailDialogContext();
|
|
20
25
|
// Re-derived locally (not passed as a prop) so that the `if (isWidget)` branch below narrows
|
|
21
26
|
// `widget`/`insight` via TS's aliased-condition control-flow analysis — this requires the boolean
|
|
@@ -115,7 +120,7 @@ export function useScheduledEmailFilters({ setEditedAutomation, widget, insight,
|
|
|
115
120
|
const shouldStoreFilters = storeFiltersParam ?? storeFilters;
|
|
116
121
|
const newEffectiveFiltersByTab = shouldStoreFilters
|
|
117
122
|
? Object.entries(newFiltersByTab).reduce((acc, [tabId, filters]) => {
|
|
118
|
-
const tabHiddenFilters =
|
|
123
|
+
const tabHiddenFilters = filtersByTab?.find((tab) => tab.tabId === tabId)?.hiddenFilters ?? [];
|
|
119
124
|
const appliedFilters = getAppliedDashboardFilters(filters ?? [], tabHiddenFilters, true);
|
|
120
125
|
if (appliedFilters) {
|
|
121
126
|
acc[tabId] = appliedFilters;
|
|
@@ -152,27 +157,35 @@ export function useScheduledEmailFilters({ setEditedAutomation, widget, insight,
|
|
|
152
157
|
storeFilters,
|
|
153
158
|
setEditedAutomation,
|
|
154
159
|
availableFiltersAsVisibleFiltersByTab,
|
|
155
|
-
|
|
160
|
+
filtersByTab,
|
|
156
161
|
]);
|
|
157
162
|
const onApplyCurrentFilters = useCallback(() => {
|
|
158
163
|
// Widget schedules should never use per-tab filters, only dashboard schedules can have tabs
|
|
159
164
|
const filtersByTabForNewAutomation = widget
|
|
160
165
|
? undefined
|
|
161
|
-
: getDefaultSelectedFiltersFromFiltersByTab(
|
|
166
|
+
: getDefaultSelectedFiltersFromFiltersByTab(filtersByTab);
|
|
162
167
|
if (filtersByTabForNewAutomation) {
|
|
163
168
|
onFiltersByTabChange(filtersByTabForNewAutomation);
|
|
164
169
|
}
|
|
165
170
|
else {
|
|
166
171
|
onFiltersChange(filtersForNewAutomation ?? [], widget ? true : storeFilters);
|
|
167
172
|
}
|
|
168
|
-
}, [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
onFiltersChange,
|
|
172
|
-
onFiltersByTabChange,
|
|
173
|
+
}, [filtersForNewAutomation, storeFilters, onFiltersChange, onFiltersByTabChange, widget, filtersByTab]);
|
|
174
|
+
const { isValid: automationIsValid, filtersAreStale = false } = useValidateExistingAutomationFilters({
|
|
175
|
+
automationToEdit: scheduledExportToEdit,
|
|
173
176
|
widget,
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
insight,
|
|
178
|
+
});
|
|
179
|
+
const parameters = useAutomationExportParameters({
|
|
180
|
+
automationToEdit: scheduledExportToEdit,
|
|
181
|
+
widget,
|
|
182
|
+
storeParameters: storeFilters,
|
|
183
|
+
setParametersWire,
|
|
184
|
+
});
|
|
185
|
+
const { onStoreParametersChange } = parameters;
|
|
186
|
+
// The store-filters toggle gates parameter persistence as well, and this hook owns both sides of
|
|
187
|
+
// it, so no caller has to remember the parameters half. `value` is forwarded explicitly to every
|
|
188
|
+
// side because `storeFilters` still holds the old one at call time.
|
|
176
189
|
const onStoreFiltersChange = useCallback((value, filters, filtersByTabParam) => {
|
|
177
190
|
setStoreFilters(value);
|
|
178
191
|
// If filtersByTab is provided, use onFiltersByTabChange, otherwise use onFiltersChange
|
|
@@ -184,11 +197,20 @@ export function useScheduledEmailFilters({ setEditedAutomation, widget, insight,
|
|
|
184
197
|
// Use regular filters change
|
|
185
198
|
onFiltersChange(filters, value);
|
|
186
199
|
}
|
|
187
|
-
|
|
200
|
+
onStoreParametersChange(value);
|
|
201
|
+
}, [onFiltersChange, onFiltersByTabChange, setStoreFilters, onStoreParametersChange]);
|
|
188
202
|
return {
|
|
203
|
+
selectedFilters: editedAutomationFilters,
|
|
204
|
+
availableFilters,
|
|
205
|
+
storeFilters,
|
|
206
|
+
filtersByTab,
|
|
207
|
+
editedFiltersByTab: editedAutomationFiltersByTab,
|
|
189
208
|
onFiltersChange,
|
|
190
209
|
onFiltersByTabChange,
|
|
191
210
|
onApplyCurrentFilters,
|
|
192
211
|
onStoreFiltersChange,
|
|
212
|
+
automationIsValid,
|
|
213
|
+
filtersAreStale,
|
|
214
|
+
...parameters,
|
|
193
215
|
};
|
|
194
216
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IExportDefinitionVisualizationObjectSettings } from "@gooddata/sdk-model";
|
|
2
|
-
type PdfPageSize = NonNullable<IExportDefinitionVisualizationObjectSettings["pageSize"]>;
|
|
2
|
+
export type PdfPageSize = NonNullable<IExportDefinitionVisualizationObjectSettings["pageSize"]>;
|
|
3
3
|
/**
|
|
4
4
|
* Returns the default PDF page size based on the format locale.
|
|
5
5
|
*
|
|
@@ -7,5 +7,4 @@ type PdfPageSize = NonNullable<IExportDefinitionVisualizationObjectSettings["pag
|
|
|
7
7
|
* @returns The default PDF page size.
|
|
8
8
|
*/
|
|
9
9
|
export declare function getDefaultPdfPageSize(formatLocale?: string): PdfPageSize;
|
|
10
|
-
export {};
|
|
11
10
|
//# sourceMappingURL=pdfPageSize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdfPageSize.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/utils/pdfPageSize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,4CAA4C,EAAE,MAAM,qBAAqB,CAAC;AAExF,
|
|
1
|
+
{"version":3,"file":"pdfPageSize.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/utils/pdfPageSize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,4CAA4C,EAAE,MAAM,qBAAqB,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,4CAA4C,CAAC,UAAU,CAAC,CAAC,CAAC;AAEhG;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,WAAW,CAaxE"}
|
|
@@ -6,7 +6,16 @@
|
|
|
6
6
|
* @returns The default PDF page size.
|
|
7
7
|
*/
|
|
8
8
|
export function getDefaultPdfPageSize(formatLocale) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
if (!formatLocale) {
|
|
10
|
+
return "A4";
|
|
11
|
+
}
|
|
12
|
+
// Intl.Locale parses the region subtag correctly regardless of script/variant subtags
|
|
13
|
+
// (e.g. "sr-Latn-US", "en_US_POSIX"), unlike a positional split on "-".
|
|
14
|
+
try {
|
|
15
|
+
const region = new Intl.Locale(formatLocale.replace(/_/g, "-")).region?.toUpperCase();
|
|
16
|
+
return region === "US" || region === "CA" ? "LETTER" : "A4";
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return "A4";
|
|
20
|
+
}
|
|
12
21
|
}
|
|
@@ -26,7 +26,7 @@ export declare function dashboardFilterToFilterContextItem(filter: IDashboardFil
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function resolveMvfDimensionalityLocalRefs(filters: IFilter[], insight: IInsight | undefined): IFilter[];
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Matches all-time date filters that are *noop*, i.e. that have no effect on execution.
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
32
|
* Noop all-time filters are implicit defaults and have no effect on execution. All-time filters with `emptyValueHandling`
|