@gooddata/sdk-ui-dashboard 11.51.0 → 11.52.0-alpha.3
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 +1 -5
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +0 -3
- package/esm/model/commandHandlers/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/index.js +0 -2
- 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 +1 -2
- package/esm/model/commands/index.d.ts.map +1 -1
- package/esm/model/store/dashboardStore.d.ts +0 -2
- package/esm/model/store/dashboardStore.d.ts.map +1 -1
- package/esm/model/store/dashboardStore.js +0 -2
- package/esm/model/store/types.d.ts +0 -3
- package/esm/model/store/types.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +2 -2
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFormState.d.ts +3 -4
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFormState.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertFormState.js +14 -16
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts +1 -3
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.js +1 -4
- package/esm/presentation/automations/alerting/types.d.ts +1 -13
- package/esm/presentation/automations/alerting/types.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/AlertingConnector.d.ts +4 -5
- package/esm/presentation/automations/connectors/AlertingConnector.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/AlertingConnector.js +8 -17
- package/esm/presentation/automations/connectors/AlertingConnector.test.js +0 -16
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts +4 -4
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.js +8 -18
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.test.js +0 -20
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.d.ts +1 -4
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.js +5 -10
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.test.js +13 -10
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.js +35 -3
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.test.js +76 -27
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts +1 -4
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js +1 -14
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js +1 -11
- package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts +11 -14
- package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/AlertingDialogContext.js +3 -3
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts +31 -1
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts +5 -18
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.js +3 -5
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +5 -5
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/RecipientsSelect.d.ts +3 -12
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/RecipientsSelect.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/RecipientsSelect.js +21 -21
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/RecipientsSelectRenderer.d.ts +6 -3
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/RecipientsSelectRenderer.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/RecipientsSelectRenderer.js +14 -27
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/useWorkspaceUsersSearch.d.ts +13 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/useWorkspaceUsersSearch.d.ts.map +1 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/RecipientsSelect/useWorkspaceUsersSearch.js +44 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +1 -3
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +1 -4
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.js +3 -12
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.js +2 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.d.ts +8 -9
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.js +12 -11
- package/esm/presentation/automations/scheduledEmail/types.d.ts +1 -13
- package/esm/presentation/automations/scheduledEmail/types.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/utils/users.d.ts +1 -2
- package/esm/presentation/automations/scheduledEmail/utils/users.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/utils/users.js +1 -10
- package/esm/presentation/automations/shared/automationFilters/components/AutomationDateFilter.test.js +9 -0
- package/esm/presentation/automations/shared/automationFilters/hooks/useAutomationVisibleFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useAutomationVisibleFilters.js +7 -2
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.js +2 -14
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts +12 -3
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.js +3 -11
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts +7 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.js +9 -25
- package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.js +4 -7
- package/esm/presentation/automations/shared/hooks/useDateFiltersTitles.d.ts.map +1 -1
- package/esm/presentation/automations/shared/hooks/useDateFiltersTitles.js +6 -3
- package/esm/presentation/automations/shared/hooks/useFiltersNamings.d.ts.map +1 -1
- package/esm/presentation/automations/shared/hooks/useFiltersNamings.js +23 -10
- package/esm/presentation/automations/shared/utils/automationUtils.d.ts +1 -3
- package/esm/presentation/automations/shared/utils/automationUtils.d.ts.map +1 -1
- package/esm/presentation/automations/shared/utils/automationUtils.js +0 -17
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditor.d.ts.map +1 -1
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditor.js +5 -4
- package/esm/presentation/drill/utils/dashboardPredicate.d.ts +0 -15
- package/esm/presentation/drill/utils/dashboardPredicate.d.ts.map +1 -1
- package/esm/presentation/drill/utils/dashboardPredicate.js +1 -16
- package/esm/presentation/presentationComponents/DashboardItems/DashboardItem.d.ts +4 -0
- package/esm/presentation/presentationComponents/DashboardItems/DashboardItem.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts +2 -3
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.js +2 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts +2 -3
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js +2 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js +4 -6
- package/esm/presentation/widget/visualizationSwitcher/EditModeDashboardVisualizationSwitcher.d.ts.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/EditModeDashboardVisualizationSwitcher.js +1 -1
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.d.ts.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.js +3 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/DefaultDashboardVisualizationSwitcherWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/DefaultDashboardVisualizationSwitcherWidget.js +1 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/EditableDashboardVisualizationSwitcherWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/EditableDashboardVisualizationSwitcherWidget.js +1 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/ExportableDashboardVisualizationSwitcherWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/ExportableDashboardVisualizationSwitcherWidget.js +1 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.d.ts +2 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.d.ts.map +1 -1
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.js +4 -4
- package/esm/sdk-ui-dashboard.d.ts +47 -115
- package/package.json +21 -21
- package/styles/css/main.css +2 -0
- package/styles/css/main.css.map +1 -1
- package/styles/css/visualizationSwitcherHeader.css +1 -0
- package/styles/css/visualizationSwitcherHeader.css.map +1 -1
- package/styles/css/visualizationSwitcherWidget.css +1 -0
- package/styles/css/visualizationSwitcherWidget.css.map +1 -1
- package/styles/scss/visualizationSwitcherHeader.scss +2 -0
- package/styles/scss/visualizationSwitcherWidget.scss +2 -0
- package/esm/model/commandHandlers/users/loadAllUsersHandler.d.ts +0 -5
- package/esm/model/commandHandlers/users/loadAllUsersHandler.d.ts.map +0 -1
- package/esm/model/commandHandlers/users/loadAllUsersHandler.js +0 -19
- package/esm/model/commandHandlers/users/loadWorkspaceUsers.d.ts +0 -4
- package/esm/model/commandHandlers/users/loadWorkspaceUsers.d.ts.map +0 -1
- package/esm/model/commandHandlers/users/loadWorkspaceUsers.js +0 -3
- package/esm/model/commands/users.d.ts +0 -19
- package/esm/model/commands/users.d.ts.map +0 -1
- package/esm/model/commands/users.js +0 -15
- package/esm/model/react/useWorkspaceUsers.d.ts +0 -9
- package/esm/model/react/useWorkspaceUsers.d.ts.map +0 -1
- package/esm/model/react/useWorkspaceUsers.js +0 -27
- package/esm/model/store/users/index.d.ts +0 -9
- package/esm/model/store/users/index.d.ts.map +0 -1
- package/esm/model/store/users/index.js +0 -12
- package/esm/model/store/users/usersReducers.d.ts +0 -21
- package/esm/model/store/users/usersReducers.d.ts.map +0 -1
- package/esm/model/store/users/usersReducers.js +0 -15
- package/esm/model/store/users/usersSelectors.d.ts +0 -22
- package/esm/model/store/users/usersSelectors.d.ts.map +0 -1
- package/esm/model/store/users/usersSelectors.js +0 -27
- package/esm/model/store/users/usersState.d.ts +0 -12
- package/esm/model/store/users/usersState.d.ts.map +0 -1
- package/esm/model/store/users/usersState.js +0 -2
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationRecipient, type IAutomationVisibleFilter, type IDashboardExportParameter, type IExportDefinitionVisualizationObjectSettings, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget
|
|
1
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationRecipient, type IAutomationVisibleFilter, type IDashboardExportParameter, type IExportDefinitionVisualizationObjectSettings, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget } from "@gooddata/sdk-model";
|
|
2
2
|
export interface IUseScheduledEmailFormStateProps {
|
|
3
3
|
scheduledExportToEdit?: IAutomationMetadataObject;
|
|
4
4
|
widget?: IWidget;
|
|
5
5
|
insight?: IInsight;
|
|
6
6
|
notificationChannels: INotificationChannelIdentifier[] | INotificationChannelMetadataObject[];
|
|
7
|
-
/** Workspace users, lazy-loaded in the connector and passed via dialog props. */
|
|
8
|
-
users: IWorkspaceUser[];
|
|
9
7
|
externalRecipientOverride?: string;
|
|
10
8
|
effectiveWidgetFilters: IFilter[];
|
|
11
9
|
effectiveWidgetFiltersWithInsight: IFilter[];
|
|
@@ -23,19 +21,20 @@ export interface IUseScheduledEmailFormStateProps {
|
|
|
23
21
|
* baseline, the derived defaults (`defaultRecipient`, `defaultUser`), and the form's field/message
|
|
24
22
|
* change handlers and their validity UI state.
|
|
25
23
|
*
|
|
26
|
-
* Values only this hook needs — `timezone` and `
|
|
27
|
-
* `dashboardId`/`dashboardTitle
|
|
28
|
-
* are read here directly. The effective-filters
|
|
29
|
-
* `defaultPdfPageSize` arrive as params
|
|
24
|
+
* Values only this hook needs — `timezone`, `currentUser`, and `widgetLocalIdToTabIdMap` from
|
|
25
|
+
* {@link useAutomationsContext}, `dashboardId`/`dashboardTitle` from
|
|
26
|
+
* {@link useScheduledEmailDialogContext} — are read here directly. The effective-filters
|
|
27
|
+
* derivations, `parametersByTabForNewAutomation`, and `defaultPdfPageSize` arrive as params
|
|
28
|
+
* instead, because the parent shares them with other consumers.
|
|
30
29
|
*
|
|
31
30
|
* @internal
|
|
32
31
|
*/
|
|
33
|
-
export declare function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels,
|
|
32
|
+
export declare function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels, externalRecipientOverride, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, defaultPdfPageSize }: IUseScheduledEmailFormStateProps): {
|
|
34
33
|
editedAutomation: IAutomationMetadataObjectDefinition;
|
|
35
34
|
setEditedAutomation: import("react").Dispatch<import("react").SetStateAction<IAutomationMetadataObjectDefinition>>;
|
|
36
35
|
originalAutomation: IAutomationMetadataObjectDefinition;
|
|
37
36
|
defaultRecipient: IAutomationRecipient;
|
|
38
|
-
defaultUser:
|
|
37
|
+
defaultUser: IAutomationRecipient;
|
|
39
38
|
onTitleChange: (value: string, isValid: boolean) => void;
|
|
40
39
|
onRecurrenceChange: (cronExpression: string, startDate: Date | null, isValid: boolean) => void;
|
|
41
40
|
onEvaluationModeChange: (isShared: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduledEmailFormState.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"useScheduledEmailFormState.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,4CAA4C,EACjD,KAAK,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@ import { useState } from "react";
|
|
|
3
3
|
import { setExportParametersByTab } from "../../../../../_staging/automation/index.js";
|
|
4
4
|
import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
|
|
5
5
|
import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
|
|
6
|
-
import {
|
|
6
|
+
import { convertExternalRecipientToAutomationRecipient, convertUserToAutomationRecipient, } from "../../../shared/utils/automationUtils.js";
|
|
7
7
|
import { toModifiedISOStringToTimezone, toNormalizedFirstRunAndCron, toNormalizedStartDate, } from "../../utils/date.js";
|
|
8
8
|
import { getUserTimezone } from "../../utils/timezone.js";
|
|
9
9
|
import { newDashboardExportDefinitionMetadataObjectDefinition, newWidgetExportDefinitionMetadataObjectDefinition, } from "../utils/exportDefinitions.js";
|
|
@@ -13,25 +13,26 @@ import { newDashboardExportDefinitionMetadataObjectDefinition, newWidgetExportDe
|
|
|
13
13
|
* baseline, the derived defaults (`defaultRecipient`, `defaultUser`), and the form's field/message
|
|
14
14
|
* change handlers and their validity UI state.
|
|
15
15
|
*
|
|
16
|
-
* Values only this hook needs — `timezone` and `
|
|
17
|
-
* `dashboardId`/`dashboardTitle
|
|
18
|
-
* are read here directly. The effective-filters
|
|
19
|
-
* `defaultPdfPageSize` arrive as params
|
|
16
|
+
* Values only this hook needs — `timezone`, `currentUser`, and `widgetLocalIdToTabIdMap` from
|
|
17
|
+
* {@link useAutomationsContext}, `dashboardId`/`dashboardTitle` from
|
|
18
|
+
* {@link useScheduledEmailDialogContext} — are read here directly. The effective-filters
|
|
19
|
+
* derivations, `parametersByTabForNewAutomation`, and `defaultPdfPageSize` arrive as params
|
|
20
|
+
* instead, because the parent shares them with other consumers.
|
|
20
21
|
*
|
|
21
22
|
* @internal
|
|
22
23
|
*/
|
|
23
|
-
export function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels,
|
|
24
|
-
const { timezone, currentUser } = useAutomationsContext();
|
|
25
|
-
const { dashboardId, dashboardTitle
|
|
24
|
+
export function useScheduledEmailFormState({ scheduledExportToEdit, widget, insight, notificationChannels, externalRecipientOverride, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, effectiveVisibleWidgetFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveVisibleDashboardFilters, effectiveVisibleDashboardFiltersByTab, parametersByTabForNewAutomation, defaultPdfPageSize, }) {
|
|
25
|
+
const { timezone, currentUser, widgetLocalIdToTabIdMap: widgetTabMap } = useAutomationsContext();
|
|
26
|
+
const { dashboardId, dashboardTitle } = useScheduledEmailDialogContext();
|
|
26
27
|
const isWidget = !!widget && !!insight;
|
|
27
28
|
// Determine target tab ID if widget is present
|
|
28
29
|
const targetTabId = widget?.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
|
|
29
|
-
const defaultUser =
|
|
30
|
+
const defaultUser = convertUserToAutomationRecipient(currentUser);
|
|
30
31
|
const defaultRecipient = externalRecipientOverride
|
|
31
32
|
? convertExternalRecipientToAutomationRecipient(externalRecipientOverride)
|
|
32
|
-
:
|
|
33
|
+
: convertUserToAutomationRecipient(currentUser);
|
|
33
34
|
const firstChannel = notificationChannels[0]?.id;
|
|
34
|
-
const [editedAutomation, setEditedAutomation] = useState(scheduledExportToEdit ??
|
|
35
|
+
const [editedAutomation, setEditedAutomation] = useState(() => scheduledExportToEdit ??
|
|
35
36
|
newAutomationMetadataObjectDefinition(isWidget
|
|
36
37
|
? {
|
|
37
38
|
timezone,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentType } from "react";
|
|
2
|
-
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget
|
|
2
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IFilter, type IInsight, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget } from "@gooddata/sdk-model";
|
|
3
3
|
import { type GoodDataSdkError } from "@gooddata/sdk-ui";
|
|
4
4
|
/**
|
|
5
5
|
* @alpha
|
|
@@ -11,18 +11,6 @@ export interface IScheduledEmailDialogProps {
|
|
|
11
11
|
* @deprecated read `scheduledExportToEdit` from `useScheduledEmailDialogContext()` instead. Prop will be removed.
|
|
12
12
|
*/
|
|
13
13
|
scheduledExportToEdit?: IAutomationMetadataObject;
|
|
14
|
-
/**
|
|
15
|
-
* Users in workspace
|
|
16
|
-
*
|
|
17
|
-
* @deprecated read `users` from `useScheduledEmailDialogContext()` instead. Prop will be removed.
|
|
18
|
-
*/
|
|
19
|
-
users?: IWorkspaceUser[];
|
|
20
|
-
/**
|
|
21
|
-
* Error occurred while loading users
|
|
22
|
-
*
|
|
23
|
-
* @deprecated read `usersError` from `useScheduledEmailDialogContext()` instead. Prop will be removed.
|
|
24
|
-
*/
|
|
25
|
-
usersError?: GoodDataSdkError;
|
|
26
14
|
/**
|
|
27
15
|
* Notification channels in organization
|
|
28
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/scheduledEmail/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACvC,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/scheduledEmail/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,8BAA8B,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AC,EAAE,MAAM,IAAI,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACrD;AAED;;;GAGG;AACH,MAAM,WAAW,oCAAoC;IACjD;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IAErC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAE/F;;;;;OAKG;IACH,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAE5D;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACrD;AAMD;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,aAAa,CAAC,0BAA0B,CAAC,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,6CAA6C,GACrD,aAAa,CAAC,oCAAoC,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type IAutomationRecipient
|
|
2
|
-
export declare function matchUser(user: IWorkspaceUser, search: string): boolean;
|
|
1
|
+
import { type IAutomationRecipient } from "@gooddata/sdk-model";
|
|
3
2
|
export declare function matchRecipient(user: IAutomationRecipient, search: string): boolean;
|
|
4
3
|
export declare function createUser(search: string): IAutomationRecipient;
|
|
5
4
|
//# sourceMappingURL=users.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/utils/users.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/utils/users.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAkC,MAAM,qBAAqB,CAAC;AAIhG,wBAAgB,cAAc,CAAC,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAexE;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAQ/D"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import { isAutomationUserGroupRecipient
|
|
2
|
+
import { isAutomationUserGroupRecipient } from "@gooddata/sdk-model";
|
|
3
3
|
import { isEmail } from "./validate.js";
|
|
4
|
-
export function matchUser(user, search) {
|
|
5
|
-
const lowerCaseSearch = search.toLowerCase();
|
|
6
|
-
const lowerCaseEmail = user.email?.toLowerCase();
|
|
7
|
-
const lowerCaseName = user.fullName?.toLowerCase();
|
|
8
|
-
const lowerCaseId = user.login.toLowerCase();
|
|
9
|
-
return (lowerCaseEmail?.includes(lowerCaseSearch) ||
|
|
10
|
-
lowerCaseName?.includes(lowerCaseSearch) ||
|
|
11
|
-
lowerCaseId?.includes(lowerCaseSearch));
|
|
12
|
-
}
|
|
13
4
|
export function matchRecipient(user, search) {
|
|
14
5
|
if (isAutomationUserGroupRecipient(user)) {
|
|
15
6
|
return false;
|
|
@@ -68,6 +68,15 @@ function createAutomationsContextValue(overrides) {
|
|
|
68
68
|
enableSlideshowExports: false,
|
|
69
69
|
enableAutomationEvaluationMode: false,
|
|
70
70
|
},
|
|
71
|
+
parameters: {
|
|
72
|
+
enabled: false,
|
|
73
|
+
stringParametersEnabled: false,
|
|
74
|
+
catalog: [],
|
|
75
|
+
catalogIsLoaded: true,
|
|
76
|
+
dashboardParametersByTab: {},
|
|
77
|
+
},
|
|
78
|
+
tabIds: [],
|
|
79
|
+
widgetLocalIdToTabIdMap: {},
|
|
71
80
|
getCatalogAttributeByRef: () => undefined,
|
|
72
81
|
getAttributeFilterDisplayForm: () => undefined,
|
|
73
82
|
widgetExistsByRef: () => false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutomationVisibleFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/hooks/useAutomationVisibleFilters.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAutomationVisibleFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/hooks/useAutomationVisibleFilters.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAU5F,eAAO,MAAM,2BAA2B,oFAcvC,CAAC;AAEF,eAAO,MAAM,gCAAgC,oHAgB5C,CAAC"}
|
package/esm/presentation/automations/shared/automationFilters/hooks/useAutomationVisibleFilters.js
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { compact } from "lodash-es";
|
|
4
4
|
import { useFiltersByTabNamings, useFiltersNamings } from "../../hooks/useFiltersNamings.js";
|
|
5
|
-
|
|
5
|
+
// Module-level, not inline `= []` / `= {}` defaults: a default parameter is evaluated per call, so an
|
|
6
|
+
// inline default hands a fresh reference to the namings memos on every render of a caller that passes
|
|
7
|
+
// nothing - which would leave the chain unstable for exactly that caller. Do not inline these back.
|
|
8
|
+
const EMPTY_FILTERS = [];
|
|
9
|
+
const EMPTY_FILTERS_BY_TAB = {};
|
|
10
|
+
export const useAutomationVisibleFilters = (availableFilters = EMPTY_FILTERS) => {
|
|
6
11
|
const filterNamings = useFiltersNamings(availableFilters);
|
|
7
12
|
return useMemo(() => {
|
|
8
13
|
return compact(filterNamings).map((filter) => {
|
|
@@ -14,7 +19,7 @@ export const useAutomationVisibleFilters = (availableFilters = []) => {
|
|
|
14
19
|
});
|
|
15
20
|
}, [filterNamings]);
|
|
16
21
|
};
|
|
17
|
-
export const useAutomationVisibleFiltersByTab = (availableFilters =
|
|
22
|
+
export const useAutomationVisibleFiltersByTab = (availableFilters = EMPTY_FILTERS_BY_TAB) => {
|
|
18
23
|
const filterNamings = useFiltersByTabNamings(availableFilters);
|
|
19
24
|
return useMemo(() => {
|
|
20
25
|
const result = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidateExistingAutomationFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,qCAAqC,EAE1C,KAAK,iBAAiB,EAEtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,OAAO,EAEZ,KAAK,QAAQ,EACb,KAAK,wBAAwB,EAmBhC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useValidateExistingAutomationFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,qCAAqC,EAE1C,KAAK,iBAAiB,EAEtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,OAAO,EAEZ,KAAK,QAAQ,EACb,KAAK,wBAAwB,EAmBhC,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAmEzF,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAA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filterLoc
|
|
|
4
4
|
import { getAutomationAlertParameters, getAutomationExportParametersByTab, } from "../../../../../_staging/automation/index.js";
|
|
5
5
|
import { filterContextItemsToDashboardFiltersByWidget } from "../../../../../converters/filterConverters.js";
|
|
6
6
|
import { isFilterTypeCompatibleWithSelectionType } from "../../../../../model/commandHandlers/dashboard/common/attributeFilterSelectionTypeCompatibility.js";
|
|
7
|
-
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
|
|
8
|
-
import { selectCatalogParameters, selectCatalogParametersIsLoaded, } from "../../../../../model/store/catalog/catalogSelectors.js";
|
|
9
|
-
import { selectEnableParameters } from "../../../../../model/store/config/configSelectors.js";
|
|
10
|
-
import { selectWidgetLocalIdToTabIdMap } from "../../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
11
|
-
import { selectSmartPersistedTabsParameters } from "../../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
12
|
-
import { selectTabs } from "../../../../../model/store/tabs/tabsSelectors.js";
|
|
13
7
|
import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
|
|
14
8
|
import { isNoopAllTimeDateFilterFixed } from "../../filters/index.js";
|
|
15
9
|
import { getAutomationAlertFilters, getAutomationDashboardFilters, getAutomationDashboardFiltersByTab, getAutomationVisualizationFilters, } from "../../utils/automationUtils.js";
|
|
@@ -61,13 +55,7 @@ const defaultValidState = {
|
|
|
61
55
|
parametersAreStale: false,
|
|
62
56
|
};
|
|
63
57
|
export function useValidateExistingAutomationFilters({ automationToEdit, widget, insight, }) {
|
|
64
|
-
const { lockedFilters, hiddenFilters, availableFilters: dashboardFilters, commonDateFilterId, automationFiltersByTab: dashboardFiltersByTab, attributeFilterSelectionTypeMap: selectionTypeMap, attributeFilterSelectionTypeMapByTab: selectionTypeMapByTab, } = useAutomationsContext();
|
|
65
|
-
const parametersEnabled = useDashboardSelector(selectEnableParameters);
|
|
66
|
-
const catalogParameters = useDashboardSelector(selectCatalogParameters);
|
|
67
|
-
const catalogParametersIsLoaded = useDashboardSelector(selectCatalogParametersIsLoaded);
|
|
68
|
-
const dashboardParametersByTab = useDashboardSelector(selectSmartPersistedTabsParameters);
|
|
69
|
-
const tabs = useDashboardSelector(selectTabs);
|
|
70
|
-
const widgetTabMap = useDashboardSelector(selectWidgetLocalIdToTabIdMap);
|
|
58
|
+
const { lockedFilters, hiddenFilters, availableFilters: dashboardFilters, commonDateFilterId, automationFiltersByTab: dashboardFiltersByTab, attributeFilterSelectionTypeMap: selectionTypeMap, attributeFilterSelectionTypeMapByTab: selectionTypeMapByTab, parameters: { enabled: parametersEnabled, catalog: catalogParameters, catalogIsLoaded: catalogParametersIsLoaded, dashboardParametersByTab, }, tabIds, widgetLocalIdToTabIdMap: widgetTabMap, } = useAutomationsContext();
|
|
71
59
|
// A widget export covers exactly the widget's current tab, so its stored overrides must live under
|
|
72
60
|
// that tab; a dashboard export covers every tab. Resolved here so the validator can flag a widget
|
|
73
61
|
// whose stored override was orphaned under its previous tab after a move.
|
|
@@ -78,7 +66,7 @@ export function useValidateExistingAutomationFilters({ automationToEdit, widget,
|
|
|
78
66
|
storedParametersByTab: getAutomationExportParametersByTab(automationToEdit),
|
|
79
67
|
catalog: catalogParameters,
|
|
80
68
|
dashboardParametersByTab,
|
|
81
|
-
existingTabIds: new Set(
|
|
69
|
+
existingTabIds: new Set(tabIds),
|
|
82
70
|
widgetTabId,
|
|
83
71
|
}) || validateExistingAutomationAlertParameters(automationToEdit, catalogParameters)
|
|
84
72
|
: false;
|
package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
-
import { type IAutomationMetadataObjectDefinition, type
|
|
2
|
+
import { type IAutomationMetadataObjectDefinition, type IDashboardParameter, type IInsightParameterValue, type IdentifierRef, type ParameterValue } from "@gooddata/sdk-model";
|
|
3
3
|
import { type IAutomationParameter } from "./automationParameters.js";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
@@ -29,9 +29,18 @@ export interface IUseAutomationAlertParameters {
|
|
|
29
29
|
*
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
|
-
export declare function useAutomationAlertParameters({ editedAutomation, setEditedAutomation,
|
|
32
|
+
export declare function useAutomationAlertParameters({ editedAutomation, setEditedAutomation, dashboardParameters, widgetParameterValues }: {
|
|
33
33
|
editedAutomation: IAutomationMetadataObjectDefinition | undefined;
|
|
34
34
|
setEditedAutomation: Dispatch<SetStateAction<IAutomationMetadataObjectDefinition | undefined>>;
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Effective dashboard parameters for the dialog's widget; from
|
|
37
|
+
* {@link IAlertingDialogContextValue.dashboardParameters}.
|
|
38
|
+
*/
|
|
39
|
+
dashboardParameters: IDashboardParameter[];
|
|
40
|
+
/**
|
|
41
|
+
* Effective widget parameter values for the dialog's widget; from
|
|
42
|
+
* {@link IAlertingDialogContextValue.parameterValues}.
|
|
43
|
+
*/
|
|
44
|
+
widgetParameterValues: IInsightParameterValue[];
|
|
36
45
|
}): IUseAutomationAlertParameters;
|
|
37
46
|
//# sourceMappingURL=useAutomationAlertParameters.d.ts.map
|
package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutomationAlertParameters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationAlertParameters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAwB,MAAM,OAAO,CAAC;AAEjF,OAAO,EAEH,KAAK,mCAAmC,
|
|
1
|
+
{"version":3,"file":"useAutomationAlertParameters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationAlertParameters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAwB,MAAM,OAAO,CAAC;AAEjF,OAAO,EAEH,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,cAAc,EAEtB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACH,KAAK,oBAAoB,EAM5B,MAAM,2BAA2B,CAAC;AAInC;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C;;OAEG;IACH,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;IAC7C;;;OAGG;IACH,mBAAmB,EAAE,oBAAoB,EAAE,CAAC;IAC5C,cAAc,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,iBAAiB,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACvE,iBAAiB,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,EACzC,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACxB,EAAE;IACC,gBAAgB,EAAE,mCAAmC,GAAG,SAAS,CAAC;IAClE,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,GAAG,SAAS,CAAC,CAAC,CAAC;IAC/F;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;IAC3C;;;OAGG;IACH,qBAAqB,EAAE,sBAAsB,EAAE,CAAC;CACnD,GAAG,6BAA6B,CA8GhC"}
|
package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.js
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
import { useCallback, useMemo } from "react";
|
|
3
3
|
import { DashboardParameterModeValues, areObjRefsEqual, } from "@gooddata/sdk-model";
|
|
4
4
|
import { getAutomationAlertParameters } from "../../../../_staging/automation/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import { selectCatalogParameters, selectCatalogParametersIsLoaded, } from "../../../../model/store/catalog/catalogSelectors.js";
|
|
7
|
-
import { selectEnableParameters, selectEnableStringParameters, } from "../../../../model/store/config/configSelectors.js";
|
|
8
|
-
import { selectEffectiveDashboardParametersForWidget, selectEffectiveParameterValuesForWidget, } from "../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
5
|
+
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
9
6
|
import { availableAutomationParameters, dropStaleAlertParameters, hasStaleAlertParameters, reconstructAutomationParametersFromValues, setAlertExecutionParameters, } from "./automationParameters.js";
|
|
10
7
|
const EMPTY_PARAMETERS = [];
|
|
11
8
|
/**
|
|
@@ -14,13 +11,8 @@ const EMPTY_PARAMETERS = [];
|
|
|
14
11
|
*
|
|
15
12
|
* @internal
|
|
16
13
|
*/
|
|
17
|
-
export function useAutomationAlertParameters({ editedAutomation, setEditedAutomation,
|
|
18
|
-
const parametersEnabled =
|
|
19
|
-
const stringParametersEnabled = useDashboardSelector(selectEnableStringParameters);
|
|
20
|
-
const catalog = useDashboardSelector(selectCatalogParameters);
|
|
21
|
-
const catalogIsLoaded = useDashboardSelector(selectCatalogParametersIsLoaded);
|
|
22
|
-
const dashboardParameters = useDashboardSelector(selectEffectiveDashboardParametersForWidget(widgetRef));
|
|
23
|
-
const widgetParameterValues = useDashboardSelector(selectEffectiveParameterValuesForWidget(widgetRef));
|
|
14
|
+
export function useAutomationAlertParameters({ editedAutomation, setEditedAutomation, dashboardParameters, widgetParameterValues, }) {
|
|
15
|
+
const { parameters: { enabled: parametersEnabled, stringParametersEnabled, catalog, catalogIsLoaded }, } = useAutomationsContext();
|
|
24
16
|
const storedParameters = getAutomationAlertParameters(editedAutomation);
|
|
25
17
|
const automationParameters = useMemo(() => {
|
|
26
18
|
if (!parametersEnabled || !storedParameters?.length) {
|
package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export type EditedParametersByTab = Record<string, IAutomationParameter[]>;
|
|
|
12
12
|
export interface IUseAutomationExportParametersProps {
|
|
13
13
|
automationToEdit?: IAutomationMetadataObject;
|
|
14
14
|
widget?: ExtendedDashboardWidget;
|
|
15
|
+
/**
|
|
16
|
+
* Effective export parameter overrides keyed by tab, scoped to the dialog's widget when present;
|
|
17
|
+
* from {@link IScheduledEmailDialogContextValue.exportParametersByTab}, which the scheduled-email
|
|
18
|
+
* connector resolves from the same widget.
|
|
19
|
+
*/
|
|
20
|
+
effectiveParametersByTab: Record<string, IDashboardExportParameter[]>;
|
|
15
21
|
/**
|
|
16
22
|
* Persist parameter values onto the export, versus omitting them so the server resolves the
|
|
17
23
|
* latest dashboard defaults. Widget schedules force-store (no store-filters checkbox).
|
|
@@ -71,5 +77,5 @@ export interface IUseAutomationExportParameters {
|
|
|
71
77
|
/**
|
|
72
78
|
* @internal
|
|
73
79
|
*/
|
|
74
|
-
export declare function useAutomationExportParameters({ automationToEdit, widget, storeParameters, setParametersWire }: IUseAutomationExportParametersProps): IUseAutomationExportParameters;
|
|
80
|
+
export declare function useAutomationExportParameters({ automationToEdit, widget, storeParameters, setParametersWire, effectiveParametersByTab }: IUseAutomationExportParametersProps): IUseAutomationExportParameters;
|
|
75
81
|
//# sourceMappingURL=useAutomationExportParameters.d.ts.map
|
package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutomationExportParameters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationExportParameters.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAG9B,KAAK,aAAa,EAClB,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"useAutomationExportParameters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationExportParame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MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACjE,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3F,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACpE;;;OAGG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB;;;OAGG;IACH,uBAAuB,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/D;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,EAC1C,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EAC3B,EAAE,mCAAmC,GAAG,8BAA8B,CAoMtE"}
|
package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.js
CHANGED
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
3
|
import { mapValues } from "lodash-es";
|
|
4
|
-
import { DashboardParameterModeValues, areObjRefsEqual,
|
|
4
|
+
import { DashboardParameterModeValues, areObjRefsEqual, } from "@gooddata/sdk-model";
|
|
5
5
|
import { exportParametersToValues, getAutomationExportParametersByTab, } from "../../../../_staging/automation/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import { selectCatalogParameters } from "../../../../model/store/catalog/catalogSelectors.js";
|
|
8
|
-
import { selectEnableParameters, selectEnableStringParameters, } from "../../../../model/store/config/configSelectors.js";
|
|
9
|
-
import { selectWidgetLocalIdToTabIdMap } from "../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
10
|
-
import { selectExportEffectiveParameters, selectSmartPersistedTabsParameters, } from "../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
11
|
-
import { selectTabs } from "../../../../model/store/tabs/tabsSelectors.js";
|
|
6
|
+
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
12
7
|
import { availableAutomationParameters, reconstructAutomationParametersFromExportParameters, shouldStoreExportParameters, toEffectiveParametersByTab, } from "./automationParameters.js";
|
|
13
8
|
/**
|
|
14
9
|
* @internal
|
|
15
10
|
*/
|
|
16
|
-
export function useAutomationExportParameters({ automationToEdit, widget, storeParameters, setParametersWire, }) {
|
|
17
|
-
const parametersEnabled =
|
|
18
|
-
const
|
|
19
|
-
const catalog = useDashboardSelector(selectCatalogParameters);
|
|
20
|
-
const dashboardParametersByTab = useDashboardSelector(selectSmartPersistedTabsParameters);
|
|
21
|
-
const tabs = useDashboardSelector(selectTabs);
|
|
22
|
-
const widgetTabMap = useDashboardSelector(selectWidgetLocalIdToTabIdMap);
|
|
23
|
-
const widgetIds = widget ? [objRefToString(widget.ref)] : undefined;
|
|
24
|
-
const effectiveParametersByTab = useDashboardSelector(selectExportEffectiveParameters(widgetIds));
|
|
25
|
-
const flatTabId = resolveFlatTabId(widget, widgetTabMap, tabs);
|
|
11
|
+
export function useAutomationExportParameters({ automationToEdit, widget, storeParameters, setParametersWire, effectiveParametersByTab, }) {
|
|
12
|
+
const { parameters: { enabled: parametersEnabled, stringParametersEnabled, catalog, dashboardParametersByTab, }, tabIds, widgetLocalIdToTabIdMap: widgetTabMap, } = useAutomationsContext();
|
|
13
|
+
const flatTabId = resolveFlatTabId(widget, widgetTabMap, tabIds);
|
|
26
14
|
const shouldStore = shouldStoreExportParameters(!!widget, storeParameters);
|
|
27
15
|
const [editedParametersByTab, setEditedParametersByTab] = useState(() => {
|
|
28
16
|
if (!parametersEnabled) {
|
|
@@ -40,11 +28,7 @@ export function useAutomationExportParameters({ automationToEdit, widget, storeP
|
|
|
40
28
|
}
|
|
41
29
|
// The set of tabs the export covers: the widget's owning tab, or every dashboard tab. Keyed by
|
|
42
30
|
// every in-scope tab (not just seeded ones) so tabs with no current override can still add params.
|
|
43
|
-
const scopeTabIds = widget
|
|
44
|
-
? flatTabId
|
|
45
|
-
? [flatTabId]
|
|
46
|
-
: []
|
|
47
|
-
: (tabs ?? []).map((tab) => tab.localIdentifier);
|
|
31
|
+
const scopeTabIds = widget ? (flatTabId ? [flatTabId] : []) : tabIds;
|
|
48
32
|
const result = {};
|
|
49
33
|
for (const tabId of scopeTabIds) {
|
|
50
34
|
// Widget schedules seed addable chips from the widget-effective values, mirroring the alert
|
|
@@ -60,7 +44,7 @@ export function useAutomationExportParameters({ automationToEdit, widget, storeP
|
|
|
60
44
|
parametersEnabled,
|
|
61
45
|
widget,
|
|
62
46
|
flatTabId,
|
|
63
|
-
|
|
47
|
+
tabIds,
|
|
64
48
|
editedParametersByTab,
|
|
65
49
|
catalog,
|
|
66
50
|
dashboardParametersByTab,
|
|
@@ -137,11 +121,11 @@ export function useAutomationExportParameters({ automationToEdit, widget, storeP
|
|
|
137
121
|
onStoreParametersChange,
|
|
138
122
|
};
|
|
139
123
|
}
|
|
140
|
-
function resolveFlatTabId(widget, widgetTabMap,
|
|
124
|
+
function resolveFlatTabId(widget, widgetTabMap, tabIds) {
|
|
141
125
|
if (widget) {
|
|
142
126
|
return widget.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
|
|
143
127
|
}
|
|
144
|
-
return
|
|
128
|
+
return tabIds.length <= 1 ? tabIds[0] : undefined;
|
|
145
129
|
}
|
|
146
130
|
function isVisibleParameter(parameter) {
|
|
147
131
|
return parameter.mode !== DashboardParameterModeValues.HIDDEN;
|
package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutomationFiltersSelect.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAEhC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAutomationFiltersSelect.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAEhC,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AActF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IACxC,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAClD,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IACzE,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C;;;;;OAKG;IACH,YAAY,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IAClD;;;;OAIG;IACH,4BAA4B,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,+BAA+B,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAEvE,qCAAqC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,GAAG,SAAS,CAAC;CACjG;AAiFD;;GAEG;AACH,eAAO,MAAM,0BAA0B;IAInC;;OAEG;;IAGH;;;OAGG;;iCAgHN,CAAC;AAEF,wBAAgB,yCAAyC,CAAC,YAAY,EAAE,qBAAqB,EAAE,GAAG,SAAS,kCAQ1G;AAED,wBAAgB,mCAAmC,CAAC,YAAY,EAAE,qBAAqB,EAAE,GAAG,SAAS,uCAQpG"}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { isExportDefinitionDashboardRequestPayload, } from "@gooddata/sdk-model";
|
|
4
4
|
import { getAutomationExportParametersByTab } from "../../../../_staging/automation/index.js";
|
|
5
|
-
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
6
|
-
import { selectEnableParameters } from "../../../../model/store/config/configSelectors.js";
|
|
7
5
|
import { removeIgnoredWidgetFilters } from "../../../../model/utils/widgetFilters.js";
|
|
8
6
|
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
9
7
|
import { useAutomationVisibleFilters, useAutomationVisibleFiltersByTab, } from "./hooks/useAutomationVisibleFilters.js";
|
|
@@ -70,22 +68,21 @@ function checkAreParametersStored(automationToEdit) {
|
|
|
70
68
|
* Hook to get data for AutomationFiltersSelect component.
|
|
71
69
|
*/
|
|
72
70
|
export const useAutomationFiltersSelect = ({ widget, automationToEdit, }) => {
|
|
73
|
-
const { availableFilters, automationFiltersByTab: allFiltersByTab, commonDateFilterId, } = useAutomationsContext();
|
|
74
|
-
const availableFiltersWithoutIgnoredWidgetFilters = removeIgnoredWidgetFilters(availableFilters, widget);
|
|
71
|
+
const { availableFilters, automationFiltersByTab: allFiltersByTab, commonDateFilterId, parameters: { enabled: parametersEnabled }, } = useAutomationsContext();
|
|
72
|
+
const availableFiltersWithoutIgnoredWidgetFilters = useMemo(() => removeIgnoredWidgetFilters(availableFilters, widget), [availableFilters, widget]);
|
|
75
73
|
const availableFiltersAsVisibleFilters = useAutomationVisibleFilters(availableFiltersWithoutIgnoredWidgetFilters);
|
|
76
74
|
const filtersForNewAutomation = useDefaultSelectedFiltersForNewAutomation(widget);
|
|
77
75
|
const filtersForExistingAutomation = useDefaultSelectedFiltersForExistingAutomation(automationToEdit, availableFiltersAsVisibleFilters, widget);
|
|
78
76
|
// Get filters per tab - only applicable for whole dashboard automations (no widget)
|
|
79
|
-
const availableFiltersByTab = allFiltersByTab.reduce((acc, tab) => {
|
|
77
|
+
const availableFiltersByTab = useMemo(() => allFiltersByTab.reduce((acc, tab) => {
|
|
80
78
|
acc[tab.tabId] = tab.availableFilters;
|
|
81
79
|
return acc;
|
|
82
|
-
}, {});
|
|
80
|
+
}, {}), [allFiltersByTab]);
|
|
83
81
|
const availableFiltersAsVisibleFiltersByTab = useAutomationVisibleFiltersByTab(availableFiltersByTab);
|
|
84
82
|
// Only provide filtersPerTab for whole dashboard automations when there are multiple tabs
|
|
85
83
|
const isDashboardAutomation = !widget;
|
|
86
84
|
const hasMultipleTabs = allFiltersByTab.length > 1;
|
|
87
85
|
const filtersByTab = isDashboardAutomation && hasMultipleTabs ? allFiltersByTab : undefined;
|
|
88
|
-
const parametersEnabled = useDashboardSelector(selectEnableParameters);
|
|
89
86
|
const areFiltersOrParametersStored = useMemo(() => checkAreFiltersStored(automationToEdit) ||
|
|
90
87
|
(parametersEnabled && checkAreParametersStored(automationToEdit)), [automationToEdit, parametersEnabled]);
|
|
91
88
|
// Store filters or not? (checkbox to use latest saved dashboard filters vs "freeze" filters state as is)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDateFiltersTitles.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/hooks/useDateFiltersTitles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDateFiltersTitles.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/hooks/useDateFiltersTitles.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,KAAK,oBAAoB,EAAoC,MAAM,qBAAqB,CAAC;AAIlG,eAAO,MAAM,oBAAoB,8EAmChC,CAAC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
2
3
|
import { areObjRefsEqual, serializeObjRef } from "@gooddata/sdk-model";
|
|
3
4
|
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
4
5
|
export const useDateFiltersTitles = (filters, intl) => {
|
|
5
6
|
const { catalogDateDatasets: allDateDatasets, dateFilterConfigs: allDateOverrides } = useAutomationsContext();
|
|
6
|
-
return filters.reduce((acc, filter) => {
|
|
7
|
+
return useMemo(() => filters.reduce((acc, filter) => {
|
|
7
8
|
if (!filter.dateFilter.dataSet) {
|
|
8
9
|
return acc;
|
|
9
10
|
}
|
|
10
11
|
const key = serializeObjRef(filter.dateFilter.dataSet);
|
|
11
12
|
const customFilterName = allDateOverrides.find((config) => areObjRefsEqual(config.dateDataSet, filter.dateFilter.dataSet))?.config?.filterName;
|
|
12
13
|
const dateDataSetName = allDateDatasets.find((ds) => areObjRefsEqual(ds.dataSet.ref, filter?.dateFilter.dataSet))?.dataSet?.title;
|
|
13
|
-
const title = customFilterName ||
|
|
14
|
+
const title = customFilterName ||
|
|
15
|
+
dateDataSetName ||
|
|
16
|
+
intl.formatMessage({ id: "dateFilterDropdown.title" });
|
|
14
17
|
if (title) {
|
|
15
18
|
acc[key] = title;
|
|
16
19
|
}
|
|
17
20
|
return acc;
|
|
18
|
-
}, {});
|
|
21
|
+
}, {}), [filters, intl, allDateDatasets, allDateOverrides]);
|
|
19
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFiltersNamings.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/hooks/useFiltersNamings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFiltersNamings.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/hooks/useFiltersNamings.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,iBAAiB,EAItB,KAAK,MAAM,EAgBd,MAAM,qBAAqB,CAAC;AAqB7B,MAAM,MAAM,YAAY,GAAG;IACvB,IAAI,EAAE,iBAAiB,GAAG,YAAY,GAAG,oBAAoB,CAAC;IAC9D,GAAG,EAAE,OAAO,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA8PF,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAIrG;AAED,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GAChD,MAAM,CAAC,MAAM,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC,CAe9C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
2
3
|
import { useIntl } from "react-intl";
|
|
3
4
|
import { areObjRefsEqual, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemTitle, getAttributeElementsItems, isAllTimeDashboardDateFilter, isAllValuesDashboardAttributeFilter, isDashboardArbitraryAttributeFilter, isDashboardAttributeFilter, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardDateFilterWithDimension, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, objRefToString, serializeObjRef, } from "@gooddata/sdk-model";
|
|
4
5
|
import { DateFilterHelpers, getAttributeFilterSubtitle, getLocalizedIcuDateFormatPattern, getMeasureValueFilterConditionLabel, getTextFilterStateText, } from "@gooddata/sdk-ui-filters";
|
|
@@ -28,10 +29,10 @@ function useFilterNamingDependencies(filtersForTitles) {
|
|
|
28
29
|
? getLocalizedIcuDateFormatPattern(settings.formatLocale)
|
|
29
30
|
: settings?.responsiveUiDateFormat;
|
|
30
31
|
const getAttributeFilterDisplayFormFromMap = useAttributeFilterDisplayFormFromMap();
|
|
31
|
-
const dateFiltersForTitles = filtersForTitles.filter(isDashboardDateFilterWithDimension);
|
|
32
|
+
const dateFiltersForTitles = useMemo(() => filtersForTitles.filter(isDashboardDateFilterWithDimension), [filtersForTitles]);
|
|
32
33
|
const commonDateFilterTitle = useCommonDateFilterTitle(intl);
|
|
33
34
|
const allDateFiltersTitlesObj = useDateFiltersTitles(dateFiltersForTitles, intl);
|
|
34
|
-
return {
|
|
35
|
+
return useMemo(() => ({
|
|
35
36
|
intl,
|
|
36
37
|
locale,
|
|
37
38
|
dateFormat,
|
|
@@ -41,7 +42,17 @@ function useFilterNamingDependencies(filtersForTitles) {
|
|
|
41
42
|
separators,
|
|
42
43
|
commonDateFilterTitle,
|
|
43
44
|
allDateFiltersTitlesObj,
|
|
44
|
-
}
|
|
45
|
+
}), [
|
|
46
|
+
intl,
|
|
47
|
+
locale,
|
|
48
|
+
dateFormat,
|
|
49
|
+
getAttributeFilterDisplayFormFromMap,
|
|
50
|
+
getCatalogAttributeByRef,
|
|
51
|
+
measures,
|
|
52
|
+
separators,
|
|
53
|
+
commonDateFilterTitle,
|
|
54
|
+
allDateFiltersTitlesObj,
|
|
55
|
+
]);
|
|
45
56
|
}
|
|
46
57
|
/**
|
|
47
58
|
* Pure function that transforms filters into filter namings.
|
|
@@ -181,16 +192,18 @@ function transformFiltersToNamings(filtersToDisplay, deps) {
|
|
|
181
192
|
}
|
|
182
193
|
export function useFiltersNamings(filtersToDisplay) {
|
|
183
194
|
const deps = useFilterNamingDependencies(filtersToDisplay);
|
|
184
|
-
return transformFiltersToNamings(filtersToDisplay, deps);
|
|
195
|
+
return useMemo(() => transformFiltersToNamings(filtersToDisplay, deps), [filtersToDisplay, deps]);
|
|
185
196
|
}
|
|
186
197
|
export function useFiltersByTabNamings(tabFilters) {
|
|
187
198
|
// Collect all filters from all tabs for titles lookup
|
|
188
|
-
const allFilters = Object.values(tabFilters).flat();
|
|
199
|
+
const allFilters = useMemo(() => Object.values(tabFilters).flat(), [tabFilters]);
|
|
189
200
|
const deps = useFilterNamingDependencies(allFilters);
|
|
190
201
|
// Process each tab's filters separately using the shared transformation function
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
202
|
+
return useMemo(() => {
|
|
203
|
+
const result = {};
|
|
204
|
+
Object.entries(tabFilters).forEach(([tabId, filters]) => {
|
|
205
|
+
result[tabId] = transformFiltersToNamings(filters, deps);
|
|
206
|
+
});
|
|
207
|
+
return result;
|
|
208
|
+
}, [tabFilters, deps]);
|
|
196
209
|
}
|