@gooddata/sdk-ui-dashboard 11.36.0-alpha.3 → 11.36.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +63 -115
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/index.d.ts +5 -13
- package/esm/index.js +2 -10
- package/esm/internal.d.ts +1 -1
- package/esm/model/commandHandlers/dashboard/common/filterViews.js +24 -1
- package/esm/model/commandHandlers/dashboard/common/parameterHydration.d.ts +7 -1
- package/esm/model/commandHandlers/dashboard/common/parameterHydration.js +16 -2
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.js +4 -2
- package/esm/model/commandHandlers/drill/resolveDrillToCustomUrl.d.ts +7 -1
- package/esm/model/commandHandlers/drill/resolveDrillToCustomUrl.js +80 -4
- package/esm/model/commandHandlers/filterContext/filterViewHandler.js +10 -0
- package/esm/model/commandHandlers/filterContext/filterViewParameters.d.ts +7 -0
- package/esm/model/commandHandlers/filterContext/filterViewParameters.js +11 -0
- package/esm/model/store/config/configSelectors.d.ts +0 -6
- package/esm/model/store/config/configSelectors.js +0 -8
- package/esm/model/store/tabs/index.d.ts +4 -0
- package/esm/model/store/tabs/parameters/parametersReducers.d.ts +11 -1
- package/esm/model/store/tabs/parameters/parametersReducers.js +16 -8
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +7 -0
- package/esm/model/store/tabs/parameters/parametersSelectors.js +17 -0
- package/esm/model/types/commonTypes.d.ts +11 -2
- package/esm/model/utils/measureValueFilterUtils.d.ts +14 -0
- package/esm/model/utils/measureValueFilterUtils.js +21 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/{DefaultAlertingDialogNew.d.ts → DefaultAlertingDialog.d.ts} +1 -1
- package/esm/presentation/alerting/DefaultAlertingDialog/{DefaultAlertingDialogNew.js → DefaultAlertingDialog.js} +6 -12
- package/esm/presentation/alerting/DefaultAlertingDialog/components/AlertAttributeSelect.js +43 -9
- package/esm/presentation/alerting/DefaultAlertingDialog/hooks/useSaveAlertToBackend.js +13 -25
- package/esm/presentation/alerting/types.d.ts +1 -72
- package/esm/presentation/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts +1 -2
- package/esm/presentation/automationFilters/hooks/useValidateExistingAutomationFilters.js +5 -5
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.js +1 -8
- package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.js +17 -8
- package/esm/presentation/dashboard/DashboardHeader/ShareDialogDashboardHeader.js +5 -2
- package/esm/presentation/dashboard/components/DashboardRenderer.js +2 -2
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditor.js +97 -13
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParameters.d.ts +1 -1
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParameters.js +3 -3
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/DashboardParametersSection.d.ts +3 -2
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/DashboardParametersSection.js +17 -4
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/InsightParametersSection.d.ts +4 -2
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/InsightParametersSection.js +37 -4
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/Parameter.d.ts +4 -3
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/Parameter.js +3 -4
- package/esm/presentation/filterBar/attributeFilter/DefaultDashboardAttributeFilter.js +4 -1
- package/esm/presentation/filterBar/filterBar/DefaultDashboardFilterGroup.js +4 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +4 -36
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +4 -36
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +2 -9
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +2 -9
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +2 -9
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +26 -59
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +2 -6
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +22 -104
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useSaveScheduledEmailToBackend.js +12 -33
- package/esm/presentation/scheduledEmail/hooks/useWidgetAutomationFilters.d.ts +3 -0
- package/esm/presentation/scheduledEmail/hooks/useWidgetAutomationFilters.js +46 -0
- package/esm/presentation/scheduledEmail/types.d.ts +1 -7
- package/esm/presentation/scheduledEmail/utils/filters.d.ts +2 -0
- package/esm/presentation/scheduledEmail/utils/filters.js +5 -0
- package/esm/presentation/shareDialog/DefaultShareDialog.d.ts +1 -1
- package/esm/presentation/shareDialog/DefaultShareDialog.js +2 -2
- package/esm/presentation/shareDialog/types.d.ts +5 -1
- package/esm/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.d.ts +2 -2
- package/esm/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.js +36 -5
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js +2 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightWidgetAlerting.js +3 -6
- package/esm/presentation/widget/insight/configuration/InsightAlerts.js +1 -9
- package/esm/sdk-ui-dashboard.d.ts +28 -240
- package/package.json +20 -20
- package/esm/model/react/filtering/shared.d.ts +0 -6
- package/esm/model/react/filtering/shared.js +0 -38
- package/esm/model/react/filtering/useAutomationAvailableDashboardFilters.d.ts +0 -13
- package/esm/model/react/filtering/useAutomationAvailableDashboardFilters.js +0 -54
- package/esm/model/react/filtering/useDashboardScheduledExportFilters.d.ts +0 -19
- package/esm/model/react/filtering/useDashboardScheduledExportFilters.js +0 -18
- package/esm/model/react/filtering/useScheduledExportFilters.d.ts +0 -26
- package/esm/model/react/filtering/useScheduledExportFilters.js +0 -23
- package/esm/model/react/filtering/useWidgetAlertFilters.d.ts +0 -33
- package/esm/model/react/filtering/useWidgetAlertFilters.js +0 -48
- package/esm/model/react/filtering/useWidgetScheduledExportFilters.d.ts +0 -33
- package/esm/model/react/filtering/useWidgetScheduledExportFilters.js +0 -48
- package/esm/model/react/useDashboardAlerting/useEnableAutomationFilterContext.d.ts +0 -4
- package/esm/model/react/useDashboardAlerting/useEnableAutomationFilterContext.js +0 -20
- package/esm/model/react/useDashboardAlertsOld.d.ts +0 -32
- package/esm/model/react/useDashboardAlertsOld.js +0 -141
- package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialogOld.d.ts +0 -5
- package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialogOld.js +0 -36
- package/esm/presentation/alerting/DefaultAlertingDialog/components/AlertAttributeSelectOld.d.ts +0 -17
- package/esm/presentation/alerting/DefaultAlertingDialog/components/AlertAttributeSelectOld.js +0 -103
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogOld.d.ts +0 -5
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogOld.js +0 -53
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertOld.d.ts +0 -9
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertOld.js +0 -84
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsListOld.d.ts +0 -11
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsListOld.js +0 -16
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProviderOld.d.ts +0 -1
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProviderOld.js +0 -12
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFilters.d.ts +0 -29
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFilters.js +0 -61
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFiltersList.d.ts +0 -6
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentFiltersList.js +0 -12
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentItems.d.ts +0 -17
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentItems.js +0 -68
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentsWrapper.d.ts +0 -4
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/AttachmentsWrapper.js +0 -6
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/DashboardAttachments.d.ts +0 -15
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/DashboardAttachments.js +0 -42
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/WidgetAttachments.d.ts +0 -18
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/AttachmentsOld/WidgetAttachments.js +0 -25
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/types.d.ts +0 -2
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/types.js +0 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertsOld.d.ts +0 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertsOld.js +0 -43
package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useCallback, useMemo, useState } from "react";
|
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { invariant } from "ts-invariant";
|
|
5
5
|
import { DEFAULT_CSV_DELIMITER, insightProperties, isAutomationExternalUserRecipient, isAutomationUnknownUserRecipient, isAutomationUserRecipient, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, isWidget, } from "@gooddata/sdk-model";
|
|
6
|
-
import { areAutomationsEqual, convertCurrentUserToAutomationRecipient, convertCurrentUserToWorkspaceUser, convertExternalRecipientToAutomationRecipient,
|
|
6
|
+
import { areAutomationsEqual, convertCurrentUserToAutomationRecipient, convertCurrentUserToWorkspaceUser, convertExternalRecipientToAutomationRecipient, } from "../../../../_staging/automation/index.js";
|
|
7
7
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
8
8
|
import { selectEnableAutomationEvaluationMode, selectEnableExternalRecipients, selectSettings, selectTimezone, } from "../../../../model/store/config/configSelectors.js";
|
|
9
9
|
import { selectAutomationCommonDateFilterId, selectDashboardHiddenFilters, } from "../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
@@ -17,7 +17,7 @@ import { toModifiedISOStringToTimezone, toNormalizedFirstRunAndCron, toNormalize
|
|
|
17
17
|
import { getUserTimezone } from "../../utils/timezone.js";
|
|
18
18
|
import { isEmail } from "../../utils/validate.js";
|
|
19
19
|
import { useScheduleValidation } from "./useScheduleValidation.js";
|
|
20
|
-
export function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab,
|
|
20
|
+
export function useEditScheduledEmail({ scheduledExportToEdit, notificationChannels, insight, widget, editedAutomationFilters, dashboardFilters, editedAutomationFiltersByTab, maxAutomationsRecipients, setEditedAutomationFilters, setEditedAutomationFiltersByTab, availableFiltersAsVisibleFilters, storeFilters, setStoreFilters, filtersForNewAutomation, externalRecipientOverride, enableNewScheduledExport, defaultPdfPageSize, filtersDataByTab, availableFiltersAsVisibleFiltersByTab, }) {
|
|
21
21
|
const intl = useIntl();
|
|
22
22
|
const [isCronValid, setIsCronValid] = useState(true);
|
|
23
23
|
const [isTitleValid, setIsTitleValid] = useState(true);
|
|
@@ -45,21 +45,13 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
45
45
|
const widgetTabMap = useDashboardSelector(selectWidgetLocalIdToTabIdMap);
|
|
46
46
|
// Determine target tab ID if widget is present
|
|
47
47
|
const targetTabId = widget?.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
|
|
48
|
-
const effectiveWidgetFilters =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
? getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, true)
|
|
53
|
-
: widgetFilters;
|
|
54
|
-
const effectiveVisibleWidgetFilters = enableAutomationFilterContext
|
|
55
|
-
? getVisibleFiltersByFilters(editedAutomationFilters, availableFiltersAsVisibleFilters, true)
|
|
56
|
-
: undefined;
|
|
57
|
-
const effectiveDashboardFilters = enableAutomationFilterContext
|
|
58
|
-
? getAppliedDashboardFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, isWidget ? true : storeFilters)
|
|
59
|
-
: dashboardFilters;
|
|
48
|
+
const effectiveWidgetFilters = getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, false);
|
|
49
|
+
const effectiveWidgetFiltersWithInsight = getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, true);
|
|
50
|
+
const effectiveVisibleWidgetFilters = getVisibleFiltersByFilters(editedAutomationFilters, availableFiltersAsVisibleFilters, true);
|
|
51
|
+
const effectiveDashboardFilters = getAppliedDashboardFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, isWidget ? true : storeFilters);
|
|
60
52
|
// Process filters per tab if provided (for dashboard automations with tabs enabled)
|
|
61
53
|
const effectiveDashboardFiltersByTab = useMemo(() => {
|
|
62
|
-
if (!editedAutomationFiltersByTab || !
|
|
54
|
+
if (!editedAutomationFiltersByTab || !storeFilters) {
|
|
63
55
|
return undefined;
|
|
64
56
|
}
|
|
65
57
|
// Apply the same processing as effectiveDashboardFilters to each tab's filters
|
|
@@ -72,13 +64,9 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
72
64
|
}
|
|
73
65
|
return acc;
|
|
74
66
|
}, {});
|
|
75
|
-
}, [editedAutomationFiltersByTab,
|
|
76
|
-
const effectiveVisibleDashboardFilters =
|
|
77
|
-
|
|
78
|
-
: undefined;
|
|
79
|
-
const effectiveVisibleDashboardFiltersByTab = enableAutomationFilterContext
|
|
80
|
-
? getVisibleFiltersByFiltersByTab(editedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, storeFilters)
|
|
81
|
-
: undefined;
|
|
67
|
+
}, [editedAutomationFiltersByTab, filtersDataByTab, storeFilters]);
|
|
68
|
+
const effectiveVisibleDashboardFilters = getVisibleFiltersByFilters(editedAutomationFilters ?? [], availableFiltersAsVisibleFilters, storeFilters);
|
|
69
|
+
const effectiveVisibleDashboardFiltersByTab = getVisibleFiltersByFiltersByTab(editedAutomationFiltersByTab, availableFiltersAsVisibleFiltersByTab, storeFilters);
|
|
82
70
|
const [editedAutomation, setEditedAutomation] = useState(scheduledExportToEdit ??
|
|
83
71
|
newAutomationMetadataObjectDefinition(isWidget
|
|
84
72
|
? {
|
|
@@ -170,12 +158,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
170
158
|
},
|
|
171
159
|
}));
|
|
172
160
|
};
|
|
173
|
-
const onDashboardAttachmentsChange = (formats
|
|
174
|
-
// this needs to be here for compatibility with old component that doesn't use enableAutomationFilterContext
|
|
175
|
-
dashboardFiltersFromComponent) => {
|
|
176
|
-
const filtersToSave = enableAutomationFilterContext
|
|
177
|
-
? effectiveDashboardFilters
|
|
178
|
-
: (dashboardFiltersFromComponent ?? effectiveDashboardFilters);
|
|
161
|
+
const onDashboardAttachmentsChange = (formats) => {
|
|
179
162
|
setEditedAutomation((s) => {
|
|
180
163
|
const currentExportDefinitions = s.exportDefinitions || [];
|
|
181
164
|
const currentDashboardExportDefinitions = currentExportDefinitions.filter((exportDefinition) => isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload));
|
|
@@ -186,7 +169,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
186
169
|
const newExportDefinitions = formatsToAdd.map((format) => newDashboardExportDefinitionMetadataObjectDefinition({
|
|
187
170
|
dashboardId: dashboardId,
|
|
188
171
|
dashboardTitle,
|
|
189
|
-
dashboardFilters: storeFilters ?
|
|
172
|
+
dashboardFilters: storeFilters ? effectiveDashboardFilters : undefined,
|
|
190
173
|
filtersByTab: storeFilters ? effectiveDashboardFiltersByTab : undefined,
|
|
191
174
|
format,
|
|
192
175
|
}));
|
|
@@ -224,71 +207,6 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
224
207
|
};
|
|
225
208
|
});
|
|
226
209
|
};
|
|
227
|
-
const onDashboardAttachmentsChangeOld = (dashboardSelected, dashboardFilters) => {
|
|
228
|
-
if (dashboardSelected) {
|
|
229
|
-
const dashboardExportDefinition = newDashboardExportDefinitionMetadataObjectDefinition({
|
|
230
|
-
dashboardId: dashboardId,
|
|
231
|
-
dashboardTitle,
|
|
232
|
-
dashboardFilters,
|
|
233
|
-
format: "PDF",
|
|
234
|
-
});
|
|
235
|
-
const dashboardExportDefinitionExists = isDashboardAutomation(editedAutomation);
|
|
236
|
-
const updatedExportDefinitions = dashboardExportDefinitionExists
|
|
237
|
-
? editedAutomation.exportDefinitions?.map((exportDefinition) => isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload)
|
|
238
|
-
? dashboardExportDefinition
|
|
239
|
-
: exportDefinition)
|
|
240
|
-
: [...(editedAutomation.exportDefinitions ?? []), dashboardExportDefinition];
|
|
241
|
-
setEditedAutomation((s) => ({
|
|
242
|
-
...s,
|
|
243
|
-
exportDefinitions: updatedExportDefinitions,
|
|
244
|
-
}));
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
setEditedAutomation((s) => ({
|
|
248
|
-
...s,
|
|
249
|
-
exportDefinitions: s.exportDefinitions?.filter((exportDefinition) => !isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload)),
|
|
250
|
-
}));
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
const onWidgetAttachmentsChangeOld = (selected, format,
|
|
254
|
-
/**
|
|
255
|
-
* This prop may be removed in the future, once all automations are using new
|
|
256
|
-
* automation filter context. (enableAutomationFilterContext)
|
|
257
|
-
*/
|
|
258
|
-
widgetFilters) => {
|
|
259
|
-
const automationTypeGuard = format === "CSV" ? isCsvVisualizationAutomation : isXlsxVisualizationAutomation;
|
|
260
|
-
const exportDefinitionTypeGuard = format === "CSV" ? isCsvVisualizationExportDefinition : isXlsxVisualizationExportDefinition;
|
|
261
|
-
invariant(isWidget, "Widget or insight is missing in scheduling dialog context.");
|
|
262
|
-
if (selected) {
|
|
263
|
-
const newExportDefinition = newWidgetExportDefinitionMetadataObjectDefinition({
|
|
264
|
-
insight,
|
|
265
|
-
widget,
|
|
266
|
-
dashboardId: dashboardId,
|
|
267
|
-
format,
|
|
268
|
-
widgetFilters: enableAutomationFilterContext ? effectiveWidgetFilters : widgetFilters,
|
|
269
|
-
widgetFiltersWithInsight: enableAutomationFilterContext
|
|
270
|
-
? effectiveWidgetFiltersWithInsight
|
|
271
|
-
: widgetFilters,
|
|
272
|
-
dashboardFilters: effectiveDashboardFilters,
|
|
273
|
-
enableNewScheduledExport,
|
|
274
|
-
defaultPdfPageSize,
|
|
275
|
-
});
|
|
276
|
-
const exportDefinitionExists = automationTypeGuard(editedAutomation);
|
|
277
|
-
const updatedExportDefinitions = exportDefinitionExists
|
|
278
|
-
? editedAutomation.exportDefinitions?.map((exportDefinition) => exportDefinitionTypeGuard(exportDefinition) ? newExportDefinition : exportDefinition)
|
|
279
|
-
: [...(editedAutomation.exportDefinitions ?? []), newExportDefinition];
|
|
280
|
-
setEditedAutomation((s) => ({
|
|
281
|
-
...s,
|
|
282
|
-
exportDefinitions: updatedExportDefinitions,
|
|
283
|
-
}));
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
setEditedAutomation((s) => ({
|
|
287
|
-
...s,
|
|
288
|
-
exportDefinitions: s.exportDefinitions?.filter((exportDefinition) => !exportDefinitionTypeGuard(exportDefinition)),
|
|
289
|
-
}));
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
210
|
const onXlsxSettingsChange = useCallback((settings) => {
|
|
293
211
|
setEditedAutomation((s) => ({
|
|
294
212
|
...s,
|
|
@@ -489,14 +407,16 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
489
407
|
// Update the editedFiltersByTab state
|
|
490
408
|
setEditedAutomationFiltersByTab?.(newFiltersByTab);
|
|
491
409
|
const shouldStoreFilters = storeFiltersParam ?? storeFilters;
|
|
492
|
-
const newEffectiveFiltersByTab =
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
410
|
+
const newEffectiveFiltersByTab = shouldStoreFilters
|
|
411
|
+
? Object.entries(newFiltersByTab).reduce((acc, [tabId, filters]) => {
|
|
412
|
+
const tabHiddenFilters = filtersDataByTab?.find((tab) => tab.tabId === tabId)?.hiddenFilters ?? [];
|
|
413
|
+
const appliedFilters = getAppliedDashboardFilters(filters ?? [], tabHiddenFilters, true);
|
|
414
|
+
if (appliedFilters) {
|
|
415
|
+
acc[tabId] = appliedFilters;
|
|
416
|
+
}
|
|
417
|
+
return acc;
|
|
418
|
+
}, {})
|
|
419
|
+
: undefined;
|
|
500
420
|
const newVisibleFiltersByTab = getVisibleFiltersByFiltersByTab(newFiltersByTab, availableFiltersAsVisibleFiltersByTab, shouldStoreFilters);
|
|
501
421
|
// Sync to export definitions AND metadata
|
|
502
422
|
setEditedAutomation((s) => ({
|
|
@@ -685,9 +605,7 @@ export function useEditScheduledEmail({ scheduledExportToEdit, notificationChann
|
|
|
685
605
|
onSubjectChange,
|
|
686
606
|
onMessageChange,
|
|
687
607
|
onDashboardAttachmentsChange,
|
|
688
|
-
onDashboardAttachmentsChangeOld,
|
|
689
608
|
onWidgetAttachmentsChange,
|
|
690
|
-
onWidgetAttachmentsChangeOld,
|
|
691
609
|
onXlsxSettingsChange,
|
|
692
610
|
onPdfSettingsChange,
|
|
693
611
|
onCsvSettingsChange,
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
3
|
import { omit } from "lodash-es";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
|
-
import { isAllValuesAttributeFilter, isAllValuesDashboardAttributeFilter, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload,
|
|
6
|
-
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
7
|
-
import { selectEnableAutomationFilterContext } from "../../../../model/store/config/configSelectors.js";
|
|
5
|
+
import { isAllValuesAttributeFilter, isAllValuesDashboardAttributeFilter, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, } from "@gooddata/sdk-model";
|
|
8
6
|
import { useCreateScheduledEmail } from "./useCreateScheduledEmail.js";
|
|
9
7
|
import { useUpdateScheduledEmail } from "./useUpdateScheduledEmail.js";
|
|
10
8
|
export function useSaveScheduledEmailToBackend(automation, { onSuccess, onError, onSubmit, onSaveSuccess, onSaveError, onSave, }) {
|
|
11
9
|
const intl = useIntl();
|
|
12
|
-
const enableAutomationFilterContext = useDashboardSelector(selectEnableAutomationFilterContext);
|
|
13
10
|
const [savingErrorMessage, setSavingErrorMessage] = useState(undefined);
|
|
14
11
|
const scheduledEmailCreator = useCreateScheduledEmail({
|
|
15
12
|
onSuccess: (scheduledEmail) => {
|
|
@@ -33,9 +30,9 @@ export function useSaveScheduledEmailToBackend(automation, { onSuccess, onError,
|
|
|
33
30
|
},
|
|
34
31
|
});
|
|
35
32
|
const handleCreateScheduledEmail = useCallback((scheduledEmail) => {
|
|
36
|
-
const sanitizedAutomation = sanitizeAutomation(scheduledEmail, intl
|
|
33
|
+
const sanitizedAutomation = sanitizeAutomation(scheduledEmail, intl);
|
|
37
34
|
scheduledEmailCreator.create(sanitizedAutomation);
|
|
38
|
-
}, [scheduledEmailCreator,
|
|
35
|
+
}, [scheduledEmailCreator, intl]);
|
|
39
36
|
const scheduledEmailUpdater = useUpdateScheduledEmail({
|
|
40
37
|
onSuccess: onSaveSuccess,
|
|
41
38
|
onError: (error) => {
|
|
@@ -56,11 +53,11 @@ export function useSaveScheduledEmailToBackend(automation, { onSuccess, onError,
|
|
|
56
53
|
},
|
|
57
54
|
});
|
|
58
55
|
const handleUpdateScheduledEmail = useCallback((scheduledEmail) => {
|
|
59
|
-
const sanitizedAutomation = sanitizeAutomation(scheduledEmail, intl
|
|
56
|
+
const sanitizedAutomation = sanitizeAutomation(scheduledEmail, intl);
|
|
60
57
|
scheduledEmailUpdater.save(sanitizedAutomation);
|
|
61
|
-
}, [scheduledEmailUpdater,
|
|
58
|
+
}, [scheduledEmailUpdater, intl]);
|
|
62
59
|
const handleSaveScheduledEmail = () => {
|
|
63
|
-
const sanitizedAutomation = sanitizeAutomation(automation, intl
|
|
60
|
+
const sanitizedAutomation = sanitizeAutomation(automation, intl);
|
|
64
61
|
if (sanitizedAutomation.id) {
|
|
65
62
|
handleUpdateScheduledEmail(sanitizedAutomation);
|
|
66
63
|
}
|
|
@@ -72,7 +69,7 @@ export function useSaveScheduledEmailToBackend(automation, { onSuccess, onError,
|
|
|
72
69
|
scheduledEmailUpdater.savingStatus === "running";
|
|
73
70
|
return { handleSaveScheduledEmail, isSavingScheduledEmail, savingErrorMessage };
|
|
74
71
|
}
|
|
75
|
-
function sanitizeAutomation(automationToSave, intl
|
|
72
|
+
function sanitizeAutomation(automationToSave, intl) {
|
|
76
73
|
const automation = {
|
|
77
74
|
...automationToSave,
|
|
78
75
|
};
|
|
@@ -92,16 +89,14 @@ function sanitizeAutomation(automationToSave, intl, enableAutomationFilterContex
|
|
|
92
89
|
* - "All values" attribute filters have no effect on execution and should not appear in notifications.
|
|
93
90
|
*/
|
|
94
91
|
if (automation.exportDefinitions) {
|
|
95
|
-
automation.exportDefinitions = removeNoopFiltersFromExportDefinitions(automation.exportDefinitions
|
|
92
|
+
automation.exportDefinitions = removeNoopFiltersFromExportDefinitions(automation.exportDefinitions);
|
|
96
93
|
}
|
|
97
94
|
return automation;
|
|
98
95
|
}
|
|
99
|
-
function removeNoopFiltersFromExportDefinitions(exportDefinitions
|
|
96
|
+
function removeNoopFiltersFromExportDefinitions(exportDefinitions) {
|
|
100
97
|
return exportDefinitions.map((exportDefinition) => {
|
|
101
98
|
if (isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload)) {
|
|
102
99
|
const filters = exportDefinition.requestPayload.content.filters;
|
|
103
|
-
const format = exportDefinition.requestPayload.format;
|
|
104
|
-
const isTabularFormat = format === "XLSX" || format === "CSV";
|
|
105
100
|
return {
|
|
106
101
|
...exportDefinition,
|
|
107
102
|
requestPayload: {
|
|
@@ -110,17 +105,8 @@ function removeNoopFiltersFromExportDefinitions(exportDefinitions, enableAutomat
|
|
|
110
105
|
...exportDefinition.requestPayload.content,
|
|
111
106
|
filters: filters?.filter((filter) => {
|
|
112
107
|
// Strip noop "All values" attribute filters (handles both IFilter and FilterContextItem formats).
|
|
113
|
-
|
|
114
|
-
isAllValuesDashboardAttributeFilter(filter))
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
// Strip noop "All time" date filters only for legacy path.
|
|
118
|
-
if (!enableAutomationFilterContext) {
|
|
119
|
-
return isTabularFormat
|
|
120
|
-
? !isNoopAllTimeDateFilter(filter)
|
|
121
|
-
: !isNoopAllTimeDashboardDateFilter(filter);
|
|
122
|
-
}
|
|
123
|
-
return true;
|
|
108
|
+
return (!isAllValuesAttributeFilter(filter) &&
|
|
109
|
+
!isAllValuesDashboardAttributeFilter(filter));
|
|
124
110
|
}),
|
|
125
111
|
},
|
|
126
112
|
},
|
|
@@ -135,14 +121,7 @@ function removeNoopFiltersFromExportDefinitions(exportDefinitions, enableAutomat
|
|
|
135
121
|
...exportDefinition.requestPayload.content,
|
|
136
122
|
filters: exportDefinition.requestPayload.content.filters?.filter((filter) => {
|
|
137
123
|
// Strip noop "All values" attribute filters.
|
|
138
|
-
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
// Strip noop "All time" date filters only for legacy path.
|
|
142
|
-
if (!enableAutomationFilterContext && isNoopAllTimeDashboardDateFilter(filter)) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
return true;
|
|
124
|
+
return !isAllValuesDashboardAttributeFilter(filter);
|
|
146
125
|
}),
|
|
147
126
|
},
|
|
148
127
|
},
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type IFilter, type IInsightDefinition } from "@gooddata/sdk-model";
|
|
2
|
+
import { type FilterableDashboardWidget } from "../../../model/types/layoutTypes.js";
|
|
3
|
+
export declare function useWidgetAutomationFilters(widget?: FilterableDashboardWidget, insight?: IInsightDefinition): import("../../../index.js").QueryProcessingState<IFilter[]>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { filterIsEmpty, filterLocalIdentifier, isAttributeFilter, isNoopAllTimeDateFilter, } from "@gooddata/sdk-model";
|
|
4
|
+
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
5
|
+
import { useWidgetFilters } from "../../../model/react/useWidgetFilters.js";
|
|
6
|
+
import { selectCrossFilteringItems } from "../../../model/store/drill/drillSelectors.js";
|
|
7
|
+
export function useWidgetAutomationFilters(widget, insight) {
|
|
8
|
+
const widgetFiltersQuery = useWidgetFilters(widget, insight);
|
|
9
|
+
const crossFilteringItems = useDashboardSelector(selectCrossFilteringItems);
|
|
10
|
+
return useMemo(() => {
|
|
11
|
+
const { result: widgetFilters, status: widgetFiltersStatus } = widgetFiltersQuery;
|
|
12
|
+
const sanitizedWidgetFilters = widgetFilters
|
|
13
|
+
? sanitizeWidgetFilters(widgetFilters, crossFilteringItems)
|
|
14
|
+
: undefined;
|
|
15
|
+
if (widgetFiltersStatus === "success" && sanitizedWidgetFilters) {
|
|
16
|
+
return {
|
|
17
|
+
...widgetFiltersQuery,
|
|
18
|
+
result: sanitizedWidgetFilters,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return widgetFiltersQuery;
|
|
22
|
+
}, [crossFilteringItems, widgetFiltersQuery]);
|
|
23
|
+
}
|
|
24
|
+
function sanitizeWidgetFilters(filters, crossFilteringItems) {
|
|
25
|
+
const withoutCrossFiltering = removeCrossFilteringFilters(filters, crossFilteringItems);
|
|
26
|
+
const withoutAllTimeDateFilters = removeAllTimeDateFilters(withoutCrossFiltering);
|
|
27
|
+
return removeEmptyAttributeFilters(withoutAllTimeDateFilters);
|
|
28
|
+
}
|
|
29
|
+
function removeCrossFilteringFilters(filters, crossFilteringItems) {
|
|
30
|
+
const crossFilteringFilterLocalIdentifiers = crossFilteringItems.flatMap((c) => c.filterLocalIdentifiers);
|
|
31
|
+
return filters.filter((filter) => {
|
|
32
|
+
const filterLocalId = filterLocalIdentifier(filter);
|
|
33
|
+
return filterLocalId ? !crossFilteringFilterLocalIdentifiers.includes(filterLocalId) : true;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function removeEmptyAttributeFilters(filters) {
|
|
37
|
+
return filters.filter((filter) => {
|
|
38
|
+
if (isAttributeFilter(filter)) {
|
|
39
|
+
return !filterIsEmpty(filter);
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function removeAllTimeDateFilters(filters) {
|
|
45
|
+
return filters.filter((filter) => !isNoopAllTimeDateFilter(filter));
|
|
46
|
+
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { type ComponentType } from "react";
|
|
2
|
-
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWorkspaceUser
|
|
2
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWorkspaceUser } from "@gooddata/sdk-model";
|
|
3
3
|
import { type GoodDataSdkError } from "@gooddata/sdk-ui";
|
|
4
4
|
import { type ExtendedDashboardWidget } from "../../model/types/layoutTypes.js";
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export interface IScheduledEmailDialogPropsContext {
|
|
9
|
-
widgetRef?: ObjRef | undefined;
|
|
10
|
-
}
|
|
11
5
|
/**
|
|
12
6
|
* @alpha
|
|
13
7
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { getAppliedDashboardFilters as getAppliedDashboardFiltersFromAutomationFilters } from "../../automationFilters/utils.js";
|
|
3
|
+
export function getAppliedDashboardFilters(selectedAutomationFilters, dashboardHiddenFilters, storeFilters) {
|
|
4
|
+
return getAppliedDashboardFiltersFromAutomationFilters(selectedAutomationFilters, dashboardHiddenFilters, storeFilters);
|
|
5
|
+
}
|
|
@@ -3,4 +3,4 @@ import { type IShareDialogProps } from "./types.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* @alpha
|
|
5
5
|
*/
|
|
6
|
-
export declare function DefaultShareDialog({ workspace, backend, isVisible, sharedObject, currentUser, isLockingSupported, isCurrentUserWorkspaceManager, currentUserPermissions, dashboardFilters, isShareGrantHidden, applyShareGrantOnSelect, showDashboardShareLink, isGranteeShareLoading, onApply, onCancel, onError, onInteraction, onShareLinkCopy }: IShareDialogProps): ReactElement | null;
|
|
6
|
+
export declare function DefaultShareDialog({ workspace, backend, isVisible, sharedObject, currentUser, isLockingSupported, isCurrentUserWorkspaceManager, currentUserPermissions, dashboardFilters, dashboardParameters, isShareGrantHidden, applyShareGrantOnSelect, showDashboardShareLink, isGranteeShareLoading, onApply, onCancel, onError, onInteraction, onShareLinkCopy }: IShareDialogProps): ReactElement | null;
|
|
@@ -8,7 +8,7 @@ import { selectLocale } from "../../model/store/config/configSelectors.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* @alpha
|
|
10
10
|
*/
|
|
11
|
-
export function DefaultShareDialog({ workspace, backend, isVisible, sharedObject, currentUser, isLockingSupported, isCurrentUserWorkspaceManager, currentUserPermissions, dashboardFilters, isShareGrantHidden, applyShareGrantOnSelect, showDashboardShareLink, isGranteeShareLoading, onApply, onCancel, onError, onInteraction, onShareLinkCopy, }) {
|
|
11
|
+
export function DefaultShareDialog({ workspace, backend, isVisible, sharedObject, currentUser, isLockingSupported, isCurrentUserWorkspaceManager, currentUserPermissions, dashboardFilters, dashboardParameters, isShareGrantHidden, applyShareGrantOnSelect, showDashboardShareLink, isGranteeShareLoading, onApply, onCancel, onError, onInteraction, onShareLinkCopy, }) {
|
|
12
12
|
const locale = useDashboardSelector(selectLocale);
|
|
13
13
|
const intl = useIntl();
|
|
14
14
|
const labels = useMemo(() => ({
|
|
@@ -26,5 +26,5 @@ export function DefaultShareDialog({ workspace, backend, isVisible, sharedObject
|
|
|
26
26
|
if (!isVisible) {
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
|
-
return (_jsx(ShareDialog, { locale: locale, backend: backend, workspace: workspace, sharedObject: sharedObject, currentUser: currentUser, onApply: onApply, onCancel: onCancel, onError: onError, isLockingSupported: isLockingSupported, labels: labels, isCurrentUserWorkspaceManager: isCurrentUserWorkspaceManager, currentUserPermissions: currentUserPermissions, dashboardFilters: dashboardFilters, isShareGrantHidden: isShareGrantHidden, applyShareGrantOnSelect: applyShareGrantOnSelect, showDashboardShareLink: showDashboardShareLink, isGranteeShareLoading: isGranteeShareLoading, onInteraction: onInteraction, onShareLinkCopy: onShareLinkCopy }));
|
|
29
|
+
return (_jsx(ShareDialog, { locale: locale, backend: backend, workspace: workspace, sharedObject: sharedObject, currentUser: currentUser, onApply: onApply, onCancel: onCancel, onError: onError, isLockingSupported: isLockingSupported, labels: labels, isCurrentUserWorkspaceManager: isCurrentUserWorkspaceManager, currentUserPermissions: currentUserPermissions, dashboardFilters: dashboardFilters, dashboardParameters: dashboardParameters, isShareGrantHidden: isShareGrantHidden, applyShareGrantOnSelect: applyShareGrantOnSelect, showDashboardShareLink: showDashboardShareLink, isGranteeShareLoading: isGranteeShareLoading, onInteraction: onInteraction, onShareLinkCopy: onShareLinkCopy }));
|
|
30
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentType } from "react";
|
|
2
2
|
import { type IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
|
3
|
-
import { type FilterContextItem, type IUser } from "@gooddata/sdk-model";
|
|
3
|
+
import { type FilterContextItem, type IDashboardParameter, type IUser } from "@gooddata/sdk-model";
|
|
4
4
|
import { type GoodDataSdkError } from "@gooddata/sdk-ui";
|
|
5
5
|
import { type CurrentUserPermissions, type IShareDialogInteractionData, type ISharedObject, type ISharingApplyPayload as ISharingDialogApplyPayload } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
/**
|
|
@@ -48,6 +48,10 @@ export interface IShareDialogProps {
|
|
|
48
48
|
* Dashboard filters
|
|
49
49
|
*/
|
|
50
50
|
dashboardFilters: FilterContextItem[];
|
|
51
|
+
/**
|
|
52
|
+
* Dashboard parameters
|
|
53
|
+
*/
|
|
54
|
+
dashboardParameters?: IDashboardParameter[];
|
|
51
55
|
/**
|
|
52
56
|
* Is share grant hidden?
|
|
53
57
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type IAttributeFilter, type IDashboardAttributeFilterConfig } from "@gooddata/sdk-model";
|
|
1
|
+
import { type IAttributeFilter, type IDashboardAttributeFilterConfig, type IDashboardMeasureValueFilter, type IMeasureValueFilter } from "@gooddata/sdk-model";
|
|
2
2
|
import { type UrlDrillTarget } from "../../../../drill/types.js";
|
|
3
|
-
export declare function useInvalidFilteringParametersIdentifiers(urlDrillTarget: UrlDrillTarget | undefined, insightFilters: IAttributeFilter[] | undefined, dashboardFilters: IAttributeFilter[] | undefined, attributeFilterConfigs: IDashboardAttributeFilterConfig[] | undefined): string[];
|
|
3
|
+
export declare function useInvalidFilteringParametersIdentifiers(urlDrillTarget: UrlDrillTarget | undefined, insightFilters: IAttributeFilter[] | undefined, dashboardFilters: IAttributeFilter[] | undefined, dashboardMeasureValueFilters: IDashboardMeasureValueFilter[] | undefined, insightMeasureValueFilters: IMeasureValueFilter[] | undefined, enableInsightMeasureValueFilters: boolean, attributeFilterConfigs: IDashboardAttributeFilterConfig[] | undefined): string[];
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { uniq } from "lodash-es";
|
|
4
4
|
import { areObjRefsEqual, filterObjRef, idRef, } from "@gooddata/sdk-model";
|
|
5
|
-
import { getDashboardAttributeFilterPlaceholdersFromUrl, getInsightAttributeFilterPlaceholdersFromUrl, } from "@gooddata/sdk-model/internal";
|
|
5
|
+
import { getDashboardAttributeFilterPlaceholdersFromUrl, getDashboardMeasureValueFilterPlaceholdersFromUrl, getInsightAttributeFilterPlaceholdersFromUrl, getInsightMeasureValueFilterPlaceholdersFromUrl, } from "@gooddata/sdk-model/internal";
|
|
6
6
|
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
|
|
7
|
-
import { selectAllCatalogDisplayFormsMap } from "../../../../../model/store/catalog/catalogSelectors.js";
|
|
7
|
+
import { selectAllCatalogDisplayFormsMap, selectAllCatalogMeasuresMap, } from "../../../../../model/store/catalog/catalogSelectors.js";
|
|
8
|
+
import { dashboardMeasureValueFilterMatchesIdentifier, insightMeasureValueFilterMatchesIdentifier, } from "../../../../../model/utils/measureValueFilterUtils.js";
|
|
8
9
|
import { isDrillToCustomUrlConfig } from "../../../../drill/types.js";
|
|
9
|
-
export function useInvalidFilteringParametersIdentifiers(urlDrillTarget, insightFilters, dashboardFilters, attributeFilterConfigs) {
|
|
10
|
+
export function useInvalidFilteringParametersIdentifiers(urlDrillTarget, insightFilters, dashboardFilters, dashboardMeasureValueFilters, insightMeasureValueFilters, enableInsightMeasureValueFilters, attributeFilterConfigs) {
|
|
10
11
|
const displayForms = useDashboardSelector(selectAllCatalogDisplayFormsMap);
|
|
12
|
+
const measures = useDashboardSelector(selectAllCatalogMeasuresMap);
|
|
11
13
|
return useMemo(() => {
|
|
12
14
|
if (isDrillToCustomUrlConfig(urlDrillTarget)) {
|
|
13
15
|
const dashboardAttributeFilterParameters = getDashboardAttributeFilterPlaceholdersFromUrl(urlDrillTarget.customUrl);
|
|
14
16
|
const insightAttributeFilterParameters = getInsightAttributeFilterPlaceholdersFromUrl(urlDrillTarget.customUrl);
|
|
17
|
+
const dashboardMeasureValueFilterParameters = getDashboardMeasureValueFilterPlaceholdersFromUrl(urlDrillTarget.customUrl);
|
|
18
|
+
const insightMeasureValueFilterParameters = getInsightMeasureValueFilterPlaceholdersFromUrl(urlDrillTarget.customUrl);
|
|
15
19
|
const invalidDashboardParameters = dashboardAttributeFilterParameters
|
|
16
20
|
.filter(({ identifier }) => {
|
|
17
21
|
// parameter is invalid if either it points to display form that no longer exists
|
|
@@ -40,8 +44,35 @@ export function useInvalidFilteringParametersIdentifiers(urlDrillTarget, insight
|
|
|
40
44
|
});
|
|
41
45
|
})
|
|
42
46
|
.map(({ identifier }) => identifier);
|
|
43
|
-
|
|
47
|
+
const invalidDashboardMvfParameters = dashboardMeasureValueFilterParameters
|
|
48
|
+
.filter(({ identifier }) => {
|
|
49
|
+
return !dashboardMeasureValueFilters?.some((filter) => dashboardMeasureValueFilterMatchesIdentifier(filter.dashboardMeasureValueFilter.measure, identifier, measures));
|
|
50
|
+
})
|
|
51
|
+
.map(({ identifier }) => identifier);
|
|
52
|
+
const invalidInsightMvfParameters = enableInsightMeasureValueFilters
|
|
53
|
+
? insightMeasureValueFilterParameters
|
|
54
|
+
.filter(({ identifier }) => {
|
|
55
|
+
return !insightMeasureValueFilters?.some((filter) => insightMeasureValueFilterMatchesIdentifier(filter.measureValueFilter.measure, identifier));
|
|
56
|
+
})
|
|
57
|
+
.map(({ identifier }) => identifier)
|
|
58
|
+
: insightMeasureValueFilterParameters.map(({ identifier }) => identifier);
|
|
59
|
+
return uniq([
|
|
60
|
+
...invalidDashboardParameters,
|
|
61
|
+
...invalidInsightParameters,
|
|
62
|
+
...invalidDashboardMvfParameters,
|
|
63
|
+
...invalidInsightMvfParameters,
|
|
64
|
+
]);
|
|
44
65
|
}
|
|
45
66
|
return [];
|
|
46
|
-
}, [
|
|
67
|
+
}, [
|
|
68
|
+
displayForms,
|
|
69
|
+
measures,
|
|
70
|
+
urlDrillTarget,
|
|
71
|
+
insightFilters,
|
|
72
|
+
dashboardFilters,
|
|
73
|
+
dashboardMeasureValueFilters,
|
|
74
|
+
insightMeasureValueFilters,
|
|
75
|
+
enableInsightMeasureValueFilters,
|
|
76
|
+
attributeFilterConfigs,
|
|
77
|
+
]);
|
|
47
78
|
}
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2022-2026 GoodData Corporation
|
|
3
3
|
import { FormattedMessage, defineMessages, useIntl } from "react-intl";
|
|
4
4
|
import { Bubble, BubbleHoverTrigger, Button, Input, Message, } from "@gooddata/sdk-ui-kit";
|
|
5
|
-
import {
|
|
5
|
+
import { AlertAttributeSelect } from "../../../../alerting/DefaultAlertingDialog/components/AlertAttributeSelect.js";
|
|
6
6
|
import { AlertComparisonOperatorSelect } from "../../../../alerting/DefaultAlertingDialog/components/AlertComparisonOperatorSelect.js";
|
|
7
7
|
import { AlertComparisonPeriodSelect } from "../../../../alerting/DefaultAlertingDialog/components/AlertComparisonPeriodSelect.js";
|
|
8
8
|
import { AlertDestinationSelect } from "../../../../alerting/DefaultAlertingDialog/components/AlertDestinationSelect.js";
|
|
@@ -72,7 +72,7 @@ export function EditAlert({ alert, execResult, isNewAlert, hasAlerts, destinatio
|
|
|
72
72
|
: intl.formatMessage({ id: "insightAlert.config.editAlert" }), onClose: onClose, onBack: hasAlerts ? onCancel : undefined, children: _jsxs("div", { className: "gd-edit-alert", children: [
|
|
73
73
|
_jsxs("div", { className: "gd-edit-alert__form", children: [
|
|
74
74
|
_jsxs("div", { className: "gd-edit-alert__form-content", children: [
|
|
75
|
-
_jsx("label", { htmlFor: "alert.measure", className: "gd-edit-alert__measure-label", children: _jsx(FormattedMessage, { id: "insightAlert.config.when" }) }), _jsx(AlertMeasureSelect, { selectedMeasure: selectedMeasure, onMeasureChange: changeMeasure, measures: measures, overlayPositionType: overlayPositionType, id: "alert.measure" }), Boolean(canManageAttributes) && (_jsx(_Fragment, { children: _jsx(
|
|
75
|
+
_jsx("label", { htmlFor: "alert.measure", className: "gd-edit-alert__measure-label", children: _jsx(FormattedMessage, { id: "insightAlert.config.when" }) }), _jsx(AlertMeasureSelect, { selectedMeasure: selectedMeasure, onMeasureChange: changeMeasure, measures: measures, overlayPositionType: overlayPositionType, id: "alert.measure" }), Boolean(canManageAttributes) && (_jsx(_Fragment, { children: _jsx(AlertAttributeSelect, { id: "alert.attribute", selectedAttribute: selectedAttribute, selectedValue: selectedValue, onAttributeChange: changeAttribute, attributes: attributes, catalogAttributes: catalogAttributes, catalogDateDatasets: catalogDateDatasets, getAttributeValues: getAttributeValues, isResultLoading: isResultLoading, showLabel: true, closeOnParentScroll: true }) })), showFilterInfo ? (_jsxs("div", { className: "gd-edit-alert__measure-info", children: [Boolean(selectedComparator?.granularity) && (_jsx(FormattedMessage, { tagName: "span", id: "insightAlert.config.for.filter", values: {
|
|
76
76
|
granularity: [
|
|
77
77
|
intl.formatMessage({ id: "granularity.this_keyword" }),
|
|
78
78
|
translateGranularity(intl, selectedComparator?.granularity),
|
|
@@ -6,7 +6,6 @@ import { useToastMessage } from "@gooddata/sdk-ui-kit";
|
|
|
6
6
|
import { convertCurrentUserToAutomationRecipient } from "../../../../../../_staging/automation/index.js";
|
|
7
7
|
import { refreshAutomations } from "../../../../../../model/commands/scheduledEmail.js";
|
|
8
8
|
import { useDashboardDispatch, useDashboardSelector, } from "../../../../../../model/react/DashboardStoreProvider.js";
|
|
9
|
-
import { useWidgetAlertFilters } from "../../../../../../model/react/filtering/useWidgetAlertFilters.js";
|
|
10
9
|
import { DEFAULT_MAX_AUTOMATIONS } from "../../../../../../model/react/useDashboardAutomations/constants.js";
|
|
11
10
|
import { useDashboardUserInteraction } from "../../../../../../model/react/useDashboardUserInteraction.js";
|
|
12
11
|
import { useWorkspaceUsers } from "../../../../../../model/react/useWorkspaceUsers.js";
|
|
@@ -27,6 +26,7 @@ import { messages } from "../../../../../alerting/DefaultAlertingDialog/messages
|
|
|
27
26
|
import { createDefaultAlert } from "../../../../../alerting/DefaultAlertingDialog/utils/convertors.js";
|
|
28
27
|
import { getMeasureFormatsFromExecution } from "../../../../../alerting/DefaultAlertingDialog/utils/getters.js";
|
|
29
28
|
import { getSupportedInsightAttributesByInsight, getSupportedInsightMeasuresByInsight, } from "../../../../../alerting/DefaultAlertingDialog/utils/items.js";
|
|
29
|
+
import { useWidgetAutomationFilters } from "../../../../../scheduledEmail/hooks/useWidgetAutomationFilters.js";
|
|
30
30
|
export const useInsightWidgetAlerting = ({ widget, closeInsightWidgetMenu }) => {
|
|
31
31
|
const { addSuccess, addError } = useToastMessage();
|
|
32
32
|
const { automationInteraction } = useDashboardUserInteraction();
|
|
@@ -98,10 +98,7 @@ export const useInsightWidgetAlerting = ({ widget, closeInsightWidgetMenu }) =>
|
|
|
98
98
|
addError(messages.alertSaveError);
|
|
99
99
|
},
|
|
100
100
|
});
|
|
101
|
-
const { result: widgetFilters, status: widgetFiltersStatus } =
|
|
102
|
-
widget,
|
|
103
|
-
insight,
|
|
104
|
-
});
|
|
101
|
+
const { result: widgetFilters, status: widgetFiltersStatus } = useWidgetAutomationFilters(widget, insight);
|
|
105
102
|
const locale = useDashboardSelector(selectLocale);
|
|
106
103
|
const settings = useDashboardSelector(selectSettings);
|
|
107
104
|
const supportedAttributes = useMemo(() => getSupportedInsightAttributesByInsight(insight, catalogDateDatasets), [insight, catalogDateDatasets]);
|
|
@@ -163,11 +160,11 @@ export const useInsightWidgetAlerting = ({ widget, closeInsightWidgetMenu }) =>
|
|
|
163
160
|
defaultNotificationChannelId,
|
|
164
161
|
supportedMeasures,
|
|
165
162
|
widgetFilters,
|
|
166
|
-
widgetFiltersStatus,
|
|
167
163
|
addError,
|
|
168
164
|
currentUser,
|
|
169
165
|
users,
|
|
170
166
|
usersStatus,
|
|
167
|
+
widgetFiltersStatus,
|
|
171
168
|
measureFormatMap,
|
|
172
169
|
]);
|
|
173
170
|
useEffect(() => {
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2022-2026 GoodData Corporation
|
|
3
|
-
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
4
|
-
import { selectEnableAutomationFilterContext } from "../../../../model/store/config/configSelectors.js";
|
|
5
2
|
import { InsightAlertsNew } from "./InsightAlertsNew.js";
|
|
6
|
-
import { InsightAlertsOld } from "./InsightAlertsOld.js";
|
|
7
3
|
export function InsightAlerts({ widget, onClose, onGoBack }) {
|
|
8
|
-
|
|
9
|
-
if (enableAutomationFilters) {
|
|
10
|
-
return _jsx(InsightAlertsNew, { widget: widget, onClose: onClose, onGoBack: onGoBack });
|
|
11
|
-
}
|
|
12
|
-
return _jsx(InsightAlertsOld, { widget: widget, onClose: onClose, onGoBack: onGoBack });
|
|
4
|
+
return _jsx(InsightAlertsNew, { widget: widget, onClose: onClose, onGoBack: onGoBack });
|
|
13
5
|
}
|