@gooddata/sdk-ui-dashboard 11.42.0-alpha.0 → 11.42.0-alpha.2
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/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -3
- package/esm/model/store/config/configSelectors.d.ts +6 -0
- package/esm/model/store/config/configSelectors.d.ts.map +1 -1
- package/esm/model/store/config/configSelectors.js +8 -0
- package/esm/model/store/executionResults/constants.d.ts +7 -0
- package/esm/model/store/executionResults/constants.d.ts.map +1 -0
- package/esm/model/store/executionResults/constants.js +8 -0
- package/esm/model/store/executionResults/executionResultsSelectors.d.ts +12 -0
- package/esm/model/store/executionResults/executionResultsSelectors.d.ts.map +1 -1
- package/esm/model/store/executionResults/executionResultsSelectors.js +16 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts +6 -0
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.js +11 -0
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +7 -0
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersSelectors.js +18 -7
- 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/useEditAlert.d.ts +5 -0
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.js +20 -3
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.js +5 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js +13 -2
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContentEnhanced.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContentEnhanced.js +5 -2
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts +37 -0
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts.map +1 -0
- package/esm/presentation/automations/shared/automationFilters/automationParameters.js +90 -0
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts +23 -2
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.js +27 -15
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts +20 -0
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts.map +1 -0
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.js +32 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts +32 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts.map +1 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.js +57 -0
- package/esm/presentation/dashboard/components/DashboardLoading.d.ts.map +1 -1
- package/esm/presentation/dashboard/components/DashboardLoading.js +12 -2
- package/esm/presentation/export/types.d.ts +1 -1
- package/esm/presentation/export/types.d.ts.map +1 -1
- package/esm/presentation/export/useExportData.d.ts +1 -1
- package/esm/presentation/export/useExportData.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/addAttributeFilter/AttributesDropdown.d.ts +20 -1
- package/esm/presentation/filterBar/attributeFilter/addAttributeFilter/AttributesDropdown.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/addAttributeFilter/AttributesDropdown.js +41 -6
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +12 -44
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +12 -44
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +3 -11
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +3 -11
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +3 -11
- package/esm/presentation/shareDialog/DefaultShareDialog.d.ts.map +1 -1
- package/esm/presentation/shareDialog/DefaultShareDialog.js +6 -2
- package/esm/presentation/topBar/menuButton/DefaultMenuButton.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/DefaultMenuButton.js +39 -16
- package/esm/presentation/topBar/menuButton/types.d.ts +6 -0
- package/esm/presentation/topBar/menuButton/types.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/types.js +1 -0
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +7 -0
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogExportDropdown.js +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.js +14 -10
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/useDrillDialogExportItems.d.ts +0 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/useDrillDialogExportItems.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/useDrillDialogExportItems.js +23 -8
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.js +56 -27
- package/esm/presentation/widget/widget/warningPartialResult/InsightWidgetWarningPartialResult.d.ts.map +1 -1
- package/esm/presentation/widget/widget/warningPartialResult/InsightWidgetWarningPartialResult.js +4 -89
- package/esm/sdk-ui-dashboard.d.ts +49 -3
- package/package.json +20 -20
- package/styles/css/dashboard.css +7 -2
- package/styles/css/dashboard.css.map +1 -1
- package/styles/css/main.css +32 -6
- package/styles/css/main.css.map +1 -1
- package/styles/css/warningPartialResult.css +1 -0
- package/styles/css/warningPartialResult.css.map +1 -1
- package/styles/scss/dashboard.scss +14 -2
- package/styles/scss/warningPartialResult.scss +1 -0
package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAlertingDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.tsx"],"names":[],"mappings":"AAwDA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA4BxD,wBAAgB,sBAAsB,CAAC,EACnC,WAAW,EACX,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,OAAO,EACP,SAAS,EACT,WAAW,EACX,aAAa,EAChB,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"DefaultAlertingDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.tsx"],"names":[],"mappings":"AAwDA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA4BxD,wBAAgB,sBAAsB,CAAC,EACnC,WAAW,EACX,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,OAAO,EACP,SAAS,EACT,WAAW,EACX,aAAa,EAChB,EAAE,oBAAoB,2CA0kBtB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,2CAahE"}
|
package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js
CHANGED
|
@@ -63,7 +63,7 @@ export function AlertingDialogRenderer({ alertToEdit, users, usersError, notific
|
|
|
63
63
|
automationToEdit: alertToEdit,
|
|
64
64
|
widget,
|
|
65
65
|
});
|
|
66
|
-
const { onTitleChange, onRecipientsChange, onFiltersChange, onApplyCurrentFilters, onMeasureChange, getAttributeValues, onAttributeChange, onComparisonOperatorChange, onRelativeOperatorChange, onAnomalyDetectionChange, onChange, onBlur, onComparisonTypeChange, onDestinationChange, onTriggerModeChange, onTriggerIntervalChange, selectedMeasure, canChangeMeasure, supportedMeasures, canManageAttributes, selectedAttribute, selectedValue, supportedAttributes, catalogAttributes, catalogDateDatasets, isResultLoading, selectedComparisonOperator, selectedRelativeOperator, selectedAiOperator, value, selectedComparator, selectedSensitivity, onSensitivityChange, selectedGranularity, onGranularityChange, canManageComparison, separators, defaultUser, originalAutomation, editedAutomation, allowOnlyLoggedUserRecipients, allowExternalRecipients, warningMessage, validationErrorMessage, isInvalidConnectionToInsight, isSubmitDisabled, isParentValid, thresholdErrorMessage, allowHourlyRecurrence, } = useEditAlert({
|
|
66
|
+
const { onTitleChange, onRecipientsChange, onFiltersChange, onApplyCurrentFilters, automationParameters, availableParameters, onParameterChange, onParameterDelete, onParameterAdd, onMeasureChange, getAttributeValues, onAttributeChange, onComparisonOperatorChange, onRelativeOperatorChange, onAnomalyDetectionChange, onChange, onBlur, onComparisonTypeChange, onDestinationChange, onTriggerModeChange, onTriggerIntervalChange, selectedMeasure, canChangeMeasure, supportedMeasures, canManageAttributes, selectedAttribute, selectedValue, supportedAttributes, catalogAttributes, catalogDateDatasets, isResultLoading, selectedComparisonOperator, selectedRelativeOperator, selectedAiOperator, value, selectedComparator, selectedSensitivity, onSensitivityChange, selectedGranularity, onGranularityChange, canManageComparison, separators, defaultUser, originalAutomation, editedAutomation, allowOnlyLoggedUserRecipients, allowExternalRecipients, warningMessage, validationErrorMessage, isInvalidConnectionToInsight, isSubmitDisabled, isParentValid, thresholdErrorMessage, allowHourlyRecurrence, } = useEditAlert({
|
|
67
67
|
insight,
|
|
68
68
|
widget,
|
|
69
69
|
alertToEdit,
|
|
@@ -166,7 +166,7 @@ export function AlertingDialogRenderer({ alertToEdit, users, usersError, notific
|
|
|
166
166
|
}), ref: dialogTitleRef, secondaryTitle: secondaryTitle, secondaryTitleIcon: secondaryTitleIcon, isSecondaryTitleVisible: isSecondaryTitleVisible ? isParentValid : undefined })), children: [
|
|
167
167
|
_jsx("h2", { className: "sr-only", id: titleElementId, children: intl.formatMessage({ id: "dialogs.alert.accessibility.label.title" }) }), _jsxs(ScrollablePanel, { className: "gd-notifications-channel-dialog-content-wrapper gd-notification-channel-dialog-with-automation-filters", children: [
|
|
168
168
|
_jsx("div", { className: "gd-divider-with-margin" }), _jsxs(_Fragment, { children: [
|
|
169
|
-
_jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: editedAutomationFilters, onFiltersChange: onFiltersChange, storeFilters: true, onStoreFiltersChange: () => { }, isDashboardAutomation: false, overlayPositionType: OVERLAY_POSITION_TYPE, disableDateFilters: isAnomalyDetection(editedAutomation?.alert) }), _jsx(ContentDivider, { className: "gd-divider-with-margin" })
|
|
169
|
+
_jsx(AutomationFiltersSelect, { availableFilters: availableFilters, selectedFilters: editedAutomationFilters, onFiltersChange: onFiltersChange, storeFilters: true, onStoreFiltersChange: () => { }, isDashboardAutomation: false, overlayPositionType: OVERLAY_POSITION_TYPE, disableDateFilters: isAnomalyDetection(editedAutomation?.alert), parameters: automationParameters, onParameterChange: onParameterChange, onParameterDelete: onParameterDelete, availableParameters: availableParameters, onParameterAdd: onParameterAdd }), _jsx(ContentDivider, { className: "gd-divider-with-margin" })
|
|
170
170
|
] }), _jsxs(FormFieldGroup, { label: _jsx(FormattedMessage, { id: "insightAlert.config.when" }), children: [
|
|
171
171
|
_jsx(FormField, { label: intl.formatMessage({ id: "insightAlert.config.metric" }), htmlFor: "alert.measure", children: _jsx(AlertMeasureSelect, { selectedMeasure: selectedMeasure, onMeasureChange: onMeasureChange, measures: supportedMeasures, disabled: !canChangeMeasure, overlayPositionType: OVERLAY_POSITION_TYPE, id: "alert.measure", closeOnParentScroll: CLOSE_ON_PARENT_SCROLL }) }), Boolean(canManageAttributes) &&
|
|
172
172
|
supportedAttributes.filter((a) => a.type === "attribute").length >
|
|
@@ -18,6 +18,11 @@ export declare function useEditAlert({ alertToEdit, notificationChannels, insigh
|
|
|
18
18
|
onRecipientsChange: (updatedRecipients: IAutomationRecipient[]) => void;
|
|
19
19
|
onFiltersChange: (filters: FilterContextItem[]) => void;
|
|
20
20
|
onApplyCurrentFilters: () => void;
|
|
21
|
+
automationParameters: import("../../../shared/automationFilters/automationParameters.js").IAutomationParameter[];
|
|
22
|
+
availableParameters: import("../../../shared/automationFilters/automationParameters.js").IAutomationParameter[];
|
|
23
|
+
onParameterChange: (ref: import("@gooddata/sdk-model").IdentifierRef, value: number) => void;
|
|
24
|
+
onParameterDelete: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
25
|
+
onParameterAdd: (ref: import("@gooddata/sdk-model").IdentifierRef) => void;
|
|
21
26
|
onMeasureChange: (measure: AlertMetric) => void;
|
|
22
27
|
getAttributeValues: (attr: import("@gooddata/sdk-model").IAttributeMetadataObject) => import("./useAttributeValuesFromExecResults.js").AttributeValue[];
|
|
23
28
|
onAttributeChange: (attribute: AlertAttribute | undefined, value: {
|
package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditAlert.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACtC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EAEb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EAI1C,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditAlert.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACtC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EAEb,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EAI1C,MAAM,qBAAqB,CAAC;AAsC7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AASzF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAoCvG,MAAM,WAAW,kBAAkB;IAC/B,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,kCAAkC,EAAE,CAAC;IAC9F,wBAAwB,EAAE,MAAM,CAAC;IACjC,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,uBAAuB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAE9C,0BAA0B,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACnE,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,wBAAgB,YAAY,CAAC,EACzB,WAAW,EACX,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,uBAAuB,EACvB,yBAAyB,EAC5B,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2nBpB"}
|
|
@@ -13,9 +13,12 @@ import { selectExecutionResultByRef } from "../../../../../model/store/execution
|
|
|
13
13
|
import { selectAutomationCommonDateFilterId, selectDashboardHiddenFilters, } from "../../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
14
14
|
import { selectDashboardDescriptor, selectDashboardId, } from "../../../../../model/store/meta/metaSelectors.js";
|
|
15
15
|
import { selectWidgetLocalIdToTabIdMap } from "../../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
16
|
+
import { selectEffectiveParameterValuesForWidget } from "../../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
16
17
|
import { selectCurrentUser } from "../../../../../model/store/user/userSelectors.js";
|
|
17
18
|
import { selectUsers } from "../../../../../model/store/users/usersSelectors.js";
|
|
18
19
|
import { isEmail } from "../../../scheduledEmail/utils/validate.js";
|
|
20
|
+
import { setAlertExecutionParameters } from "../../../shared/automationFilters/automationParameters.js";
|
|
21
|
+
import { useAutomationAlertParameters } from "../../../shared/automationFilters/useAutomationAlertParameters.js";
|
|
19
22
|
import { getAppliedWidgetFilters, getVisibleFiltersByFilters, resolveMvfDimensionalityLocalRefs, } from "../../../shared/automationFilters/utils.js";
|
|
20
23
|
import { createDefaultAlert } from "../utils/convertors.js";
|
|
21
24
|
import { getAlertAiOperator, getAlertAttribute, getAlertCompareOperator, getAlertComparison, getAlertGranularity, getAlertMeasure, getAlertRelativeOperator, getAlertSensitivity, getMeasureFormatsFromExecution, } from "../utils/getters.js";
|
|
@@ -47,6 +50,7 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
|
|
|
47
50
|
const commonDateFilterId = useDashboardSelector(selectAutomationCommonDateFilterId);
|
|
48
51
|
const weekStart = useDashboardSelector(selectWeekStart);
|
|
49
52
|
const timezone = useDashboardSelector(selectTimezone);
|
|
53
|
+
const parameterValues = useDashboardSelector(selectEffectiveParameterValuesForWidget(widget?.ref));
|
|
50
54
|
const isInvalidConnectionToInsight = alertToEdit?.metadata?.widget && !insight;
|
|
51
55
|
const minimumRecurrenceMinutesEntitlement = useDashboardSelector(selectEntitlementMinimumRecurrenceMinutes);
|
|
52
56
|
const allowHourlyRecurrence = parseInt(minimumRecurrenceMinutesEntitlement?.value ?? DEFAULT_MIN_RECURRENCE_MINUTES, 10) === 60;
|
|
@@ -101,14 +105,22 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
|
|
|
101
105
|
},
|
|
102
106
|
};
|
|
103
107
|
})();
|
|
104
|
-
const [editedAutomation, setEditedAutomation] = useState(
|
|
105
|
-
|
|
108
|
+
const [editedAutomation, setEditedAutomation] = useState(() => {
|
|
109
|
+
if (resolvedAlertToEdit) {
|
|
110
|
+
return resolvedAlertToEdit;
|
|
111
|
+
}
|
|
112
|
+
const defaultNewAlert = createDefaultAlert(getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, true, false), supportedMeasures, defaultMeasure, defaultNotificationChannelId, defaultRecipient, measureFormatMap, undefined, descriptor.evaluationFrequency
|
|
106
113
|
? {
|
|
107
114
|
cron: descriptor.evaluationFrequency,
|
|
108
115
|
timezone: settings.alertDefault?.defaultTimezone,
|
|
109
116
|
}
|
|
110
|
-
: undefined, getVisibleFiltersByFilters(editedAutomationFilters, availableFiltersAsVisibleFilters, true), widget?.localIdentifier, dashboardId, widget?.title, targetTabIdentifier)
|
|
117
|
+
: undefined, getVisibleFiltersByFilters(editedAutomationFilters, availableFiltersAsVisibleFilters, true), widget?.localIdentifier, dashboardId, widget?.title, targetTabIdentifier);
|
|
118
|
+
return defaultNewAlert && parameterValues.length > 0
|
|
119
|
+
? setAlertExecutionParameters(defaultNewAlert, parameterValues)
|
|
120
|
+
: defaultNewAlert;
|
|
121
|
+
});
|
|
111
122
|
const [originalAutomation] = useState(editedAutomation);
|
|
123
|
+
const { automationParameters, availableParameters, onParameterChange, onParameterDelete, onParameterAdd, } = useAutomationAlertParameters({ editedAutomation, setEditedAutomation, widgetRef: widget?.ref });
|
|
112
124
|
//
|
|
113
125
|
// Selected values
|
|
114
126
|
//
|
|
@@ -315,6 +327,11 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
|
|
|
315
327
|
onRecipientsChange,
|
|
316
328
|
onFiltersChange,
|
|
317
329
|
onApplyCurrentFilters,
|
|
330
|
+
automationParameters,
|
|
331
|
+
availableParameters,
|
|
332
|
+
onParameterChange,
|
|
333
|
+
onParameterDelete,
|
|
334
|
+
onParameterAdd,
|
|
318
335
|
onMeasureChange,
|
|
319
336
|
getAttributeValues,
|
|
320
337
|
onAttributeChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAlertingManagementDialogContentEnhanced.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultAlertingManagementDialogContentEnhanced.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AA4CrE,UAAU,oDAAoD;IAC1D,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACtD;AAED;;GAEG;AACH,wBAAgB,8CAA8C,CAAC,EAC3D,KAAK,EACL,OAAO,EACP,MAAM,EACT,EAAE,oDAAoD,2CA6ItD"}
|
|
@@ -8,7 +8,7 @@ import { Automations } from "@gooddata/sdk-ui-ext";
|
|
|
8
8
|
import { Button, ContentDivider, Dialog, Hyperlink, OverlayController, OverlayControllerProvider, Typography, UiTooltip, useId, } from "@gooddata/sdk-ui-kit";
|
|
9
9
|
import { messages } from "../../../../locales.js";
|
|
10
10
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
11
|
-
import { selectEnableAccessibilityMode, selectExternalRecipient, selectIsEmbedded, selectIsWhiteLabeled, selectTimezone, } from "../../../../model/store/config/configSelectors.js";
|
|
11
|
+
import { selectEnableAccessibilityMode, selectExternalRecipient, selectIsEmbedded, selectIsWhiteLabeled, selectSettings, selectTimezone, } from "../../../../model/store/config/configSelectors.js";
|
|
12
12
|
import { selectInsightByWidgetRef } from "../../../../model/store/insights/insightsSelectors.js";
|
|
13
13
|
import { selectDashboardId, selectDashboardTitle } from "../../../../model/store/meta/metaSelectors.js";
|
|
14
14
|
import { selectCanCreateAutomation } from "../../../../model/store/permissions/permissionsSelectors.js";
|
|
@@ -40,6 +40,8 @@ export function DefaultAlertingManagementDialogContentEnhanced({ onAdd, onClose,
|
|
|
40
40
|
const { returnFocusTo } = useAlertingDialogAccessibility();
|
|
41
41
|
const automationsInvalidationId = useDashboardSelector(selectAutomationsInvalidationId);
|
|
42
42
|
const isEmbedded = useDashboardSelector(selectIsEmbedded);
|
|
43
|
+
const settings = useDashboardSelector(selectSettings);
|
|
44
|
+
const useHostRoute = Boolean(settings.enableShellApplication) && Boolean(settings.enableShellApplication_dashboards);
|
|
43
45
|
const isMobile = isMobileView();
|
|
44
46
|
// Check if widget has metrics for alert creation
|
|
45
47
|
const widget = useDashboardSelector(selectWidgetByRef(managementDialogContext.widgetRef));
|
|
@@ -57,8 +59,9 @@ export function DefaultAlertingManagementDialogContentEnhanced({ onAdd, onClose,
|
|
|
57
59
|
dashboardId,
|
|
58
60
|
tabId,
|
|
59
61
|
isEmbedded,
|
|
62
|
+
useHostRoute,
|
|
60
63
|
queryParams: externalRecipientOverride ? { recipient: externalRecipientOverride } : undefined,
|
|
61
|
-
}), [isEmbedded, externalRecipientOverride]);
|
|
64
|
+
}), [isEmbedded, useHostRoute, externalRecipientOverride]);
|
|
62
65
|
const titleElementId = useId();
|
|
63
66
|
return (_jsx(Dialog, { displayCloseButton: true, onCancel: onClose, shouldCloseOnClick: () => false, autofocusOnOpen: true, className: cx("gd-notifications-channels-management-dialog s-alerting-management-dialog", "gd-dialog--wide gd-notifications-channels-management-dialog--wide", "gd-dialog--no-padding"), accessibilityConfig: { titleElementId, isModal: true }, returnFocusTo: returnFocusTo, returnFocusAfterClose: true, refocusKey: isEditDialogOpen, children: _jsxs(OverlayControllerProvider, { overlayController: overlayController, children: [
|
|
64
67
|
_jsx("div", { className: "gd-notifications-channels-management-dialog-title", children: _jsx(Typography, { tagName: "h3", className: "gd-dialog-header", id: titleElementId, children: _jsx(FormattedMessage, { id: "dialogs.alerting.management.title" }) }) }), _jsx(ContentDivider, { className: "gd-content-divider--no-spacing" }), _jsx("div", { className: "gd-notifications-channels-content", children: _jsx(Automations, { workspace: workspace, timezone: timezone, backend: backend, scope: "workspace", type: "alert", maxHeight: AUTOMATIONS_MAX_HEIGHT, isMobileView: isMobile, tableVariant: "small", editAutomation: onEdit, preselectedFilters: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultScheduledEmailManagementDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefaultScheduledEmailManagementDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,oCAAoC,EAAE,MAAM,aAAa,CAAC;AAMxE;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,EAC3C,KAAK,EACL,MAAM,EACN,eAAe,EAAE,QAAQ,EACzB,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACvB,EAAE,oCAAoC,2CAoFtC"}
|
|
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
4
|
import { buildAutomationUrl, navigate, useWorkspace } from "@gooddata/sdk-ui";
|
|
5
5
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
6
|
-
import { selectEnableAutomationManagement, selectExternalRecipient, selectIsEmbedded, } from "../../../../model/store/config/configSelectors.js";
|
|
6
|
+
import { selectEnableAutomationManagement, selectExternalRecipient, selectIsEmbedded, selectSettings, } from "../../../../model/store/config/configSelectors.js";
|
|
7
7
|
import { selectDashboardId } from "../../../../model/store/meta/metaSelectors.js";
|
|
8
8
|
import { DeleteScheduleConfirmDialog } from "./components/DeleteScheduleConfirmDialog.js";
|
|
9
9
|
import { DefaultScheduledEmailManagementDialogContentBasic } from "./DefaultScheduledEmailManagementDialogContentBasic.js";
|
|
@@ -18,6 +18,8 @@ export function ScheduledEmailManagementDialog({ onAdd, onEdit, onDeleteSuccess:
|
|
|
18
18
|
const dashboardId = useDashboardSelector(selectDashboardId);
|
|
19
19
|
const isEmbedded = useDashboardSelector(selectIsEmbedded);
|
|
20
20
|
const externalRecipientOverride = useDashboardSelector(selectExternalRecipient);
|
|
21
|
+
const settings = useDashboardSelector(selectSettings);
|
|
22
|
+
const useHostRoute = Boolean(settings.enableShellApplication) && Boolean(settings.enableShellApplication_dashboards);
|
|
21
23
|
const handleScheduleDelete = useCallback((scheduledEmail) => {
|
|
22
24
|
setScheduledEmailToDelete(scheduledEmail);
|
|
23
25
|
}, []);
|
|
@@ -28,6 +30,7 @@ export function ScheduledEmailManagementDialog({ onAdd, onEdit, onDeleteSuccess:
|
|
|
28
30
|
dashboardId: scheduledEmail.dashboard?.id,
|
|
29
31
|
automationId: scheduledEmail.id,
|
|
30
32
|
isEmbedded,
|
|
33
|
+
useHostRoute,
|
|
31
34
|
queryParams: externalRecipientOverride
|
|
32
35
|
? { recipient: externalRecipientOverride }
|
|
33
36
|
: undefined,
|
|
@@ -35,7 +38,15 @@ export function ScheduledEmailManagementDialog({ onAdd, onEdit, onDeleteSuccess:
|
|
|
35
38
|
return;
|
|
36
39
|
}
|
|
37
40
|
onEdit?.(scheduledEmail);
|
|
38
|
-
}, [
|
|
41
|
+
}, [
|
|
42
|
+
onEdit,
|
|
43
|
+
enableAutomationManagement,
|
|
44
|
+
dashboardId,
|
|
45
|
+
workspace,
|
|
46
|
+
isEmbedded,
|
|
47
|
+
useHostRoute,
|
|
48
|
+
externalRecipientOverride,
|
|
49
|
+
]);
|
|
39
50
|
const handleScheduleDeleteSuccess = useCallback(() => {
|
|
40
51
|
onDelete?.();
|
|
41
52
|
setScheduledEmailToDelete(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultScheduledEmailManagementDialogContentEnhanced.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContentEnhanced.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultScheduledEmailManagementDialogContentEnhanced.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialogContentEnhanced.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AA+CrE,UAAU,0DAA0D;IAChE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,cAAc,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC5D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,yBAAyB,EAAE,CAAC;CAC5C;AAED,wBAAgB,oDAAoD,CAAC,EACjE,KAAK,EACL,OAAO,EACP,MAAM,EACN,qBAAqB,EACrB,WAAW,EACd,EAAE,0DAA0D,2CAyJ5D"}
|
|
@@ -9,7 +9,7 @@ import { Button, ContentDivider, Dialog, Hyperlink, OverlayController, OverlayCo
|
|
|
9
9
|
import { messages } from "../../../../locales.js";
|
|
10
10
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
11
11
|
import { DEFAULT_MAX_AUTOMATIONS } from "../../../../model/react/useDashboardAutomations/constants.js";
|
|
12
|
-
import { selectEnableAccessibilityMode, selectExternalRecipient, selectIsEmbedded, selectIsWhiteLabeled, selectLocale, selectTimezone, } from "../../../../model/store/config/configSelectors.js";
|
|
12
|
+
import { selectEnableAccessibilityMode, selectExternalRecipient, selectIsEmbedded, selectIsWhiteLabeled, selectLocale, selectSettings, selectTimezone, } from "../../../../model/store/config/configSelectors.js";
|
|
13
13
|
import { selectEntitlementMaxAutomations, selectEntitlementUnlimitedAutomations, } from "../../../../model/store/entitlements/entitlementsSelectors.js";
|
|
14
14
|
import { selectDashboardId, selectDashboardTitle } from "../../../../model/store/meta/metaSelectors.js";
|
|
15
15
|
import { selectCanCreateAutomation } from "../../../../model/store/permissions/permissionsSelectors.js";
|
|
@@ -39,6 +39,8 @@ export function DefaultScheduledEmailManagementDialogContentEnhanced({ onAdd, on
|
|
|
39
39
|
const unlimitedAutomationsEntitlement = useDashboardSelector(selectEntitlementUnlimitedAutomations);
|
|
40
40
|
const automationsInvalidationId = useDashboardSelector(selectAutomationsInvalidationId);
|
|
41
41
|
const isEmbedded = useDashboardSelector(selectIsEmbedded);
|
|
42
|
+
const settings = useDashboardSelector(selectSettings);
|
|
43
|
+
const useHostRoute = Boolean(settings.enableShellApplication) && Boolean(settings.enableShellApplication_dashboards);
|
|
42
44
|
const { returnFocusTo } = useScheduleEmailDialogAccessibility();
|
|
43
45
|
const maxAutomations = parseInt(maxAutomationsEntitlement?.value ?? DEFAULT_MAX_AUTOMATIONS, 10);
|
|
44
46
|
const maxAutomationsReached = automations.length >= maxAutomations && !unlimitedAutomationsEntitlement;
|
|
@@ -54,8 +56,9 @@ export function DefaultScheduledEmailManagementDialogContentEnhanced({ onAdd, on
|
|
|
54
56
|
dashboardId,
|
|
55
57
|
tabId,
|
|
56
58
|
isEmbedded,
|
|
59
|
+
useHostRoute,
|
|
57
60
|
queryParams: externalRecipientOverride ? { recipient: externalRecipientOverride } : undefined,
|
|
58
|
-
}), [isEmbedded, externalRecipientOverride]);
|
|
61
|
+
}), [isEmbedded, useHostRoute, externalRecipientOverride]);
|
|
59
62
|
const titleElementId = useId();
|
|
60
63
|
return (_jsx(Dialog, { displayCloseButton: true, autofocusOnOpen: true, onCancel: onClose, className: cx("gd-notifications-channels-management-dialog s-scheduled-email-management-dialog", "gd-dialog--wide gd-notifications-channels-management-dialog--wide", "gd-dialog--no-padding"), accessibilityConfig: { titleElementId, isModal: true }, returnFocusAfterClose: true, returnFocusTo: returnFocusTo, refocusKey: isEditDialogOpen, children: _jsxs(OverlayControllerProvider, { overlayController: overlayController, children: [
|
|
61
64
|
_jsx("div", { className: "gd-notifications-channels-management-dialog-title", children: _jsx(Typography, { tagName: "h3", className: "gd-dialog-header", id: titleElementId, children: intl.formatMessage({ id: "dialogs.schedule.management.title" }) }) }), _jsx(ContentDivider, { className: "gd-content-divider--no-spacing" }), _jsx("div", { className: "gd-notifications-channels-content", children: _jsx(Automations, { workspace: workspace, timezone: timezone, type: "schedule", backend: backend, scope: "workspace", maxHeight: AUTOMATIONS_MAX_HEIGHT, isMobileView: isMobile, tableVariant: "small", editAutomation: onEdit, preselectedFilters: {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type DashboardParameterMode, type IAutomationMetadataObjectDefinition, type IDashboardParameter, type IInsightParameterValue, type INumberParameterConstraints, type IParameterMetadataObject, type IdentifierRef } from "@gooddata/sdk-model";
|
|
2
|
+
/**
|
|
3
|
+
* A workspace parameter resolved for display and editing inside an automation (alert/schedule)
|
|
4
|
+
* dialog. The `value` is the current effective value the headless run will capture.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface IAutomationParameter {
|
|
9
|
+
ref: IdentifierRef;
|
|
10
|
+
title: string;
|
|
11
|
+
value: number;
|
|
12
|
+
mode: DashboardParameterMode;
|
|
13
|
+
constraints?: INumberParameterConstraints;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Stored {@link IInsightParameterValue} overrides carry only {ref, value}; title, mode and
|
|
17
|
+
* constraints are re-derived from the current dashboard and workspace catalog.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function reconstructAutomationParametersFromValues(stored: IInsightParameterValue[], dashboardParameters: IDashboardParameter[], catalog: IParameterMetadataObject[]): IAutomationParameter[];
|
|
22
|
+
/**
|
|
23
|
+
* Parameters of unsupported types are dropped (cannot be rendered/clamped). Dashboard-`hidden`
|
|
24
|
+
* and `readonly` ones are dropped too — once added they would derive back to an invisible or
|
|
25
|
+
* locked (undeletable) chip.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function availableAutomationParameters(catalog: IParameterMetadataObject[], selected: IAutomationParameter[], dashboardParameters?: IDashboardParameter[], widgetParameterValues?: IInsightParameterValue[]): IAutomationParameter[];
|
|
30
|
+
/**
|
|
31
|
+
* Returns a copy of the automation with `alert.execution.parameters` replaced. No-op when the
|
|
32
|
+
* automation carries no alert.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function setAlertExecutionParameters(automation: IAutomationMetadataObjectDefinition, parameters: IInsightParameterValue[]): IAutomationMetadataObjectDefinition;
|
|
37
|
+
//# sourceMappingURL=automationParameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automationParameters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/automationParameters.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,sBAAsB,EAE3B,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAIrB,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,sBAAsB,CAAC;IAC7B,WAAW,CAAC,EAAE,2BAA2B,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,yCAAyC,CACrD,MAAM,EAAE,sBAAsB,EAAE,EAChC,mBAAmB,EAAE,mBAAmB,EAAE,EAC1C,OAAO,EAAE,wBAAwB,EAAE,GACpC,oBAAoB,EAAE,CAkBxB;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CACzC,OAAO,EAAE,wBAAwB,EAAE,EACnC,QAAQ,EAAE,oBAAoB,EAAE,EAChC,mBAAmB,GAAE,mBAAmB,EAAO,EAC/C,qBAAqB,GAAE,sBAAsB,EAAO,GACrD,oBAAoB,EAAE,CAqCxB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACvC,UAAU,EAAE,mCAAmC,EAC/C,UAAU,EAAE,sBAAsB,EAAE,GACrC,mCAAmC,CAcrC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { DashboardParameterModeValues, isIdentifierRef, isNumberParameterDefinition, objRefToString, } from "@gooddata/sdk-model";
|
|
3
|
+
/**
|
|
4
|
+
* Stored {@link IInsightParameterValue} overrides carry only {ref, value}; title, mode and
|
|
5
|
+
* constraints are re-derived from the current dashboard and workspace catalog.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export function reconstructAutomationParametersFromValues(stored, dashboardParameters, catalog) {
|
|
10
|
+
const dashboardByRef = new Map(dashboardParameters.map((parameter) => [objRefToString(parameter.ref), parameter]));
|
|
11
|
+
const workspaceByRef = new Map(catalog.map((parameter) => [objRefToString(parameter.ref), parameter]));
|
|
12
|
+
return stored.map((row) => {
|
|
13
|
+
const refKey = objRefToString(row.ref);
|
|
14
|
+
const dashboardParameter = dashboardByRef.get(refKey);
|
|
15
|
+
const workspaceParameter = workspaceByRef.get(refKey);
|
|
16
|
+
const constraints = numberConstraints(workspaceParameter);
|
|
17
|
+
return {
|
|
18
|
+
ref: row.ref,
|
|
19
|
+
title: dashboardParameter?.label ?? workspaceParameter?.title ?? row.ref.identifier,
|
|
20
|
+
value: row.value,
|
|
21
|
+
mode: dashboardParameter?.mode ?? DashboardParameterModeValues.ACTIVE,
|
|
22
|
+
...(constraints ? { constraints } : {}),
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parameters of unsupported types are dropped (cannot be rendered/clamped). Dashboard-`hidden`
|
|
28
|
+
* and `readonly` ones are dropped too — once added they would derive back to an invisible or
|
|
29
|
+
* locked (undeletable) chip.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export function availableAutomationParameters(catalog, selected, dashboardParameters = [], widgetParameterValues = []) {
|
|
34
|
+
const selectedRefKeys = new Set(selected.map((parameter) => objRefToString(parameter.ref)));
|
|
35
|
+
const dashboardByRef = new Map(dashboardParameters.map((parameter) => [objRefToString(parameter.ref), parameter]));
|
|
36
|
+
const widgetValueByRef = new Map(widgetParameterValues.map((row) => [objRefToString(row.ref), row.value]));
|
|
37
|
+
const result = [];
|
|
38
|
+
for (const workspaceParameter of catalog) {
|
|
39
|
+
if (!isNumberParameterDefinition(workspaceParameter.definition)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const { ref } = workspaceParameter;
|
|
43
|
+
if (!isIdentifierRef(ref)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const refKey = objRefToString(ref);
|
|
47
|
+
const dashboardParameter = dashboardByRef.get(refKey);
|
|
48
|
+
if (selectedRefKeys.has(refKey) ||
|
|
49
|
+
dashboardParameter?.mode === DashboardParameterModeValues.HIDDEN ||
|
|
50
|
+
dashboardParameter?.mode === DashboardParameterModeValues.READONLY) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const { defaultValue, constraints } = workspaceParameter.definition;
|
|
54
|
+
result.push({
|
|
55
|
+
ref,
|
|
56
|
+
title: dashboardParameter?.label ?? workspaceParameter.title,
|
|
57
|
+
// mirror the live-render precedence: runtimeOverride/insight value > dashboard value > default
|
|
58
|
+
value: widgetValueByRef.get(refKey) ?? dashboardParameter?.value ?? defaultValue,
|
|
59
|
+
mode: DashboardParameterModeValues.ACTIVE,
|
|
60
|
+
...(constraints ? { constraints } : {}),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns a copy of the automation with `alert.execution.parameters` replaced. No-op when the
|
|
67
|
+
* automation carries no alert.
|
|
68
|
+
*
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export function setAlertExecutionParameters(automation, parameters) {
|
|
72
|
+
if (!automation.alert) {
|
|
73
|
+
return automation;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
...automation,
|
|
77
|
+
alert: {
|
|
78
|
+
...automation.alert,
|
|
79
|
+
execution: {
|
|
80
|
+
...automation.alert.execution,
|
|
81
|
+
parameters,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function numberConstraints(workspaceParameter) {
|
|
87
|
+
return workspaceParameter && isNumberParameterDefinition(workspaceParameter.definition)
|
|
88
|
+
? workspaceParameter.definition.constraints
|
|
89
|
+
: undefined;
|
|
90
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type FilterContextItem, type ICatalogAttribute, type ICatalogDateDataset, type IDashboardAttributeFilterConfig, type IDashboardDateFilterConfigItem, type ObjRef } from "@gooddata/sdk-model";
|
|
1
|
+
import { type FilterContextItem, type ICatalogAttribute, type ICatalogDateDataset, type IDashboardAttributeFilterConfig, type IDashboardDateFilterConfigItem, type IdentifierRef, type ObjRef } from "@gooddata/sdk-model";
|
|
2
2
|
import { type OverlayPositionType } from "@gooddata/sdk-ui-kit";
|
|
3
3
|
import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
4
|
+
import { type IAutomationParameter } from "../automationParameters.js";
|
|
4
5
|
export interface IAutomationFiltersProps {
|
|
5
6
|
id?: string;
|
|
6
7
|
filters: FilterContextItem[] | undefined;
|
|
@@ -44,6 +45,26 @@ export interface IAutomationFiltersSelectProps {
|
|
|
44
45
|
* Called when user adds, changes, or removes a filter in a tab section.
|
|
45
46
|
*/
|
|
46
47
|
onFiltersByTabChange?: (filtersByTab: Record<string, FilterContextItem[]>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Parameter chips to render. Provided only when the `enableParameters` feature is on.
|
|
50
|
+
*/
|
|
51
|
+
parameters?: IAutomationParameter[];
|
|
52
|
+
/**
|
|
53
|
+
* Workspace parameters addable via the "+" menu (catalog minus the selected set).
|
|
54
|
+
*/
|
|
55
|
+
availableParameters?: IAutomationParameter[];
|
|
56
|
+
/**
|
|
57
|
+
* Called when an `active` parameter chip's value is edited.
|
|
58
|
+
*/
|
|
59
|
+
onParameterChange?: (ref: IdentifierRef, value: number) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Called when an `active` parameter chip is removed.
|
|
62
|
+
*/
|
|
63
|
+
onParameterDelete?: (ref: IdentifierRef) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Called when a parameter is added from the "+" menu.
|
|
66
|
+
*/
|
|
67
|
+
onParameterAdd?: (ref: IdentifierRef) => void;
|
|
47
68
|
}
|
|
48
|
-
export declare function AutomationFiltersSelect({ availableFilters, selectedFilters, onFiltersChange, isDashboardAutomation, storeFilters, onStoreFiltersChange, areFiltersMissing, overlayPositionType, hideTitle, showAllFilters, disableDateFilters, filtersByTab, editedFiltersByTab, onFiltersByTabChange }: IAutomationFiltersSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export declare function AutomationFiltersSelect({ availableFilters, selectedFilters, onFiltersChange, isDashboardAutomation, storeFilters, onStoreFiltersChange, areFiltersMissing, overlayPositionType, hideTitle, showAllFilters, disableDateFilters, filtersByTab, editedFiltersByTab, onFiltersByTabChange, parameters, onParameterChange, onParameterDelete, availableParameters, onParameterAdd }: IAutomationFiltersSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
49
70
|
//# sourceMappingURL=AutomationFiltersSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationFiltersSelect.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAGxB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EAEnC,KAAK,MAAM,EAYd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGH,KAAK,mBAAmB,EAO3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;
|
|
1
|
+
{"version":3,"file":"AutomationFiltersSelect.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAGxB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EAEnC,KAAK,aAAa,EAClB,KAAK,MAAM,EAYd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGH,KAAK,mBAAmB,EAO3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AAU9G,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAUvE,MAAM,WAAW,uBAAuB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IACzC,gBAAgB,EAAE,+BAA+B,EAAE,CAAC;IACpD,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAC9C,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,YAAY,EAAE,mBAAmB,EAAE,CAAC;IACpC,kBAAkB,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAC;IACpE,kBAAkB,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CACb,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,iBAAiB,EAAE,EAC/B,YAAY,EAAE,mBAAmB,EAAE,KAClC,IAAI,CAAC;IACV,YAAY,EAAE,OAAO,CAAC;IACtB,wBAAwB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,6BAA6B;IAC1C,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAClD,eAAe,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IACjD,eAAe,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,wBAAwB,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3F,YAAY,EAAE,OAAO,CAAC;IACtB,oBAAoB,EAAE,CAClB,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,iBAAiB,EAAE,EAC7B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KACjD,IAAI,CAAC;IACV,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACzD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KAAK,IAAI,CAAC;IACnF;;OAEG;IACH,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACpC;;OAEG;IACH,mBAAmB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACjD;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;CACjD;AAoED,wBAAgB,uBAAuB,CAAC,EACpC,gBAAqB,EACrB,eAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,SAAiB,EACjB,cAAsB,EACtB,kBAA0B,EAC1B,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,UAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAwB,EACxB,cAAc,EACjB,EAAE,6BAA6B,2CA0a/B"}
|
package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.js
CHANGED
|
@@ -5,11 +5,12 @@ import { FormattedMessage, useIntl } from "react-intl";
|
|
|
5
5
|
import { areObjRefsEqual, dashboardFilterLocalIdentifier, dashboardFilterObjRef, isCatalogAttribute, isCatalogDateDataset, isCatalogMeasure, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardCommonDateFilter, isDashboardDateFilter, isDashboardMeasureValueFilter, } from "@gooddata/sdk-model";
|
|
6
6
|
import { Bubble, BubbleHoverTrigger, Typography, UiButton, UiIconButton, UiTooltip, isActionKey, useIdPrefixed, } from "@gooddata/sdk-ui-kit";
|
|
7
7
|
import { AUTOMATION_FILTERS_DIALOG_ID, AUTOMATION_FILTERS_DIALOG_TITLE_ID, AUTOMATION_FILTERS_GROUP_LABEL_ID, } from "../../../../constants/automations.js";
|
|
8
|
-
import { AttributesDropdown } from "../../../../filterBar/attributeFilter/addAttributeFilter/AttributesDropdown.js";
|
|
8
|
+
import { AttributesDropdown, } from "../../../../filterBar/attributeFilter/addAttributeFilter/AttributesDropdown.js";
|
|
9
9
|
import { useAutomationFilters, useAutomationFiltersByTab } from "../useAutomationFilters.js";
|
|
10
10
|
import { AutomationAttributeFilter } from "./AutomationAttributeFilter.js";
|
|
11
11
|
import { AutomationDateFilter } from "./AutomationDateFilter.js";
|
|
12
12
|
import { AutomationMeasureValueFilter } from "./AutomationMeasureValueFilter.js";
|
|
13
|
+
import { AutomationParameter } from "./AutomationParameter.js";
|
|
13
14
|
const COLLAPSED_FILTERS_COUNT = 2;
|
|
14
15
|
function AutomationCheckboxOrNote({ isDashboardAutomation, storeFilters, handleStoreFiltersChange, handleKeyDown, automationFilterSelectTooltipId, }) {
|
|
15
16
|
const intl = useIntl();
|
|
@@ -29,7 +30,7 @@ function AutomationCheckboxOrNote({ isDashboardAutomation, storeFilters, handleS
|
|
|
29
30
|
function Divider() {
|
|
30
31
|
return _jsx("div", { className: "gd-automation-filters__divider", style: { height: "20px" } });
|
|
31
32
|
}
|
|
32
|
-
export function AutomationFiltersSelect({ availableFilters = [], selectedFilters = [], onFiltersChange, isDashboardAutomation, storeFilters, onStoreFiltersChange, areFiltersMissing, overlayPositionType, hideTitle = false, showAllFilters = false, disableDateFilters = false, filtersByTab, editedFiltersByTab, onFiltersByTabChange, }) {
|
|
33
|
+
export function AutomationFiltersSelect({ availableFilters = [], selectedFilters = [], onFiltersChange, isDashboardAutomation, storeFilters, onStoreFiltersChange, areFiltersMissing, overlayPositionType, hideTitle = false, showAllFilters = false, disableDateFilters = false, filtersByTab, editedFiltersByTab, onFiltersByTabChange, parameters = [], onParameterChange, onParameterDelete, availableParameters = [], onParameterAdd, }) {
|
|
33
34
|
// Determine rendering mode first
|
|
34
35
|
const shouldRenderByTab = !!filtersByTab && filtersByTab.length > 1;
|
|
35
36
|
// Use appropriate hook based on rendering mode
|
|
@@ -50,6 +51,7 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
50
51
|
// Use data from the appropriate hook based on rendering mode
|
|
51
52
|
const { commonDateFilterId, lockedFilters, attributeConfigs, dateConfigs, filterAnnouncement, filterGroupRef, makeFilterGroupUnfocusable, setAddFilterButtonRefs, } = shouldRenderByTab && tabFiltersData.processedFiltersByTab ? tabFiltersData : flatFiltersData;
|
|
52
53
|
const filters = shouldRenderByTab ? [] : flatFiltersData.visibleFilters;
|
|
54
|
+
const visibleParameters = shouldRenderByTab ? [] : parameters;
|
|
53
55
|
const attributes = shouldRenderByTab ? [] : flatFiltersData.attributes;
|
|
54
56
|
const dateDatasets = shouldRenderByTab ? [] : flatFiltersData.dateDatasets;
|
|
55
57
|
const measures = shouldRenderByTab ? [] : flatFiltersData.measures;
|
|
@@ -67,7 +69,8 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
67
69
|
: flatFiltersData.handleStoreFiltersChange;
|
|
68
70
|
const intl = useIntl();
|
|
69
71
|
const [isExpanded, setIsExpanded] = useState(showAllFilters);
|
|
70
|
-
const
|
|
72
|
+
const chipCount = filters.length + visibleParameters.length;
|
|
73
|
+
const isExpandable = !showAllFilters && chipCount > COLLAPSED_FILTERS_COUNT;
|
|
71
74
|
const handleKeyDown = (e) => {
|
|
72
75
|
if (isActionKey(e)) {
|
|
73
76
|
e.preventDefault();
|
|
@@ -75,7 +78,12 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
75
78
|
}
|
|
76
79
|
};
|
|
77
80
|
const automationFilterSelectTooltipId = useIdPrefixed("automation-filter-select-tooltip");
|
|
78
|
-
const
|
|
81
|
+
const parameterDropdownItems = availableParameters.map((parameter) => ({
|
|
82
|
+
type: "parameter",
|
|
83
|
+
ref: parameter.ref,
|
|
84
|
+
title: parameter.title,
|
|
85
|
+
}));
|
|
86
|
+
const isAddButtonDisabled = availableFilters?.length === selectedFilters?.length && availableParameters.length === 0;
|
|
79
87
|
const tooltipTextValues = {
|
|
80
88
|
add: intl.formatMessage({ id: "dialogs.automation.filters.add" }),
|
|
81
89
|
addDisabled: intl.formatMessage({ id: "dialogs.automation.filters.addDisabled" }),
|
|
@@ -83,8 +91,8 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
83
91
|
const tooltipText = isAddButtonDisabled ? tooltipTextValues.addDisabled : tooltipTextValues.add;
|
|
84
92
|
const searchAriaLabel = intl.formatMessage({ id: "dialogs.automation.filters.searchAriaLabel" });
|
|
85
93
|
const disableFilters = !storeFilters && !!isDashboardAutomation;
|
|
86
|
-
return (_jsxs("div", { className: "gd-input-component gd-notification-channels-automation-filters s-gd-notifications-channels-dialog-automation-filters", children: [hideTitle ? (_jsx("div", { className: "sr-only", id: AUTOMATION_FILTERS_GROUP_LABEL_ID, children: _jsx(FormattedMessage, { id: "dialogs.schedule.email.filters", values: { count:
|
|
87
|
-
_jsx(UiButton, { label: intl.formatMessage({ id: "dialogs.schedule.email.filters" }, { count:
|
|
94
|
+
return (_jsxs("div", { className: "gd-input-component gd-notification-channels-automation-filters s-gd-notifications-channels-dialog-automation-filters", children: [hideTitle ? (_jsx("div", { className: "sr-only", id: AUTOMATION_FILTERS_GROUP_LABEL_ID, children: _jsx(FormattedMessage, { id: "dialogs.schedule.email.filters", values: { count: chipCount } }) })) : (_jsx("div", { className: "gd-label", id: AUTOMATION_FILTERS_GROUP_LABEL_ID, children: isExpandable && !shouldRenderByTab ? (_jsxs(BubbleHoverTrigger, { showDelay: 500, hideDelay: 0, children: [
|
|
95
|
+
_jsx(UiButton, { label: intl.formatMessage({ id: "dialogs.schedule.email.filters" }, { count: chipCount }), variant: "tertiary", onClick: () => setIsExpanded(!isExpanded), iconAfter: isExpanded ? "navigateUp" : "navigateDown", accessibilityConfig: {
|
|
88
96
|
ariaExpanded: isExpanded,
|
|
89
97
|
ariaDescription: isExpanded
|
|
90
98
|
? intl.formatMessage({
|
|
@@ -95,7 +103,7 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
95
103
|
}),
|
|
96
104
|
iconAriaHidden: true,
|
|
97
105
|
} }), _jsx(Bubble, { className: "bubble-primary", alignPoints: [{ align: "bc tc" }], children: isExpanded ? (_jsx(FormattedMessage, { id: "dialogs.automation.filters.showLess" })) : (_jsx(FormattedMessage, { id: "dialogs.automation.filters.showAll" })) })
|
|
98
|
-
] })) : (_jsx(FormattedMessage, { id: "dialogs.schedule.email.filters", values: { count:
|
|
106
|
+
] })) : (_jsx(FormattedMessage, { id: "dialogs.schedule.email.filters", values: { count: chipCount } })) })), _jsxs("div", { className: "gd-automation-filters", children: [showAllFilters ? (_jsxs(_Fragment, { children: [
|
|
99
107
|
_jsx(AutomationCheckboxOrNote, { isDashboardAutomation: isDashboardAutomation, storeFilters: storeFilters, handleStoreFiltersChange: handleStoreFiltersChange, handleKeyDown: handleKeyDown, automationFilterSelectTooltipId: automationFilterSelectTooltipId }), _jsx(Divider, {})
|
|
100
108
|
] })) : null, _jsxs("div", { className: `gd-automation-filters__wrapper${storeFilters || !isDashboardAutomation ? "" : " gd-automation-filters__wrapper--disabled"}`, children: [disableFilters ? _jsx("div", { className: "gd-automation-filters__overlay" }) : null, shouldRenderByTab && tabFiltersData.processedFiltersByTab ? (
|
|
101
109
|
// Render filters grouped by tab with dividers between sections
|
|
@@ -128,16 +136,20 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
128
136
|
} }) }) })), DropdownTitleComponent: () => (_jsx("div", { className: "gd-automation-filters__dropdown-header", children: _jsx(Typography, { tagName: "h3", id: AUTOMATION_FILTERS_DIALOG_TITLE_ID, children: _jsx(FormattedMessage, { id: "dialogs.automation.filters.title" }) }) })), renderNoData: () => (_jsx("div", { className: "gd-automation-filters__dropdown-no-filters", children: _jsx(FormattedMessage, { id: "dialogs.automation.filters.noFilters" }) })) }) }, tab.tabId));
|
|
129
137
|
}) })) : (
|
|
130
138
|
// Render flat filter list (original behavior)
|
|
131
|
-
_jsxs("div", { className: "gd-automation-filters__list", role: "group", "aria-labelledby": AUTOMATION_FILTERS_GROUP_LABEL_ID, ref: filterGroupRef, onBlur: makeFilterGroupUnfocusable, children: [
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
_jsxs("div", { className: "gd-automation-filters__list", role: "group", "aria-labelledby": AUTOMATION_FILTERS_GROUP_LABEL_ID, ref: filterGroupRef, onBlur: makeFilterGroupUnfocusable, children: [[
|
|
140
|
+
...filters.map((filter) => {
|
|
141
|
+
const isCommonDateFilter = isDashboardCommonDateFilter(filter) ||
|
|
142
|
+
(isDashboardDateFilter(filter) &&
|
|
143
|
+
commonDateFilterId === filter.dateFilter.localIdentifier);
|
|
144
|
+
return (_jsx(AutomationFilter, { filter: filter, attributeConfigs: attributeConfigs, onChange: handleChangeFilter, onDelete: handleDeleteFilter, isCommonDateFilter: isCommonDateFilter, overlayPositionType: overlayPositionType, lockedFilters: lockedFilters, isReadOnly: disableFilters }, dashboardFilterLocalIdentifier(filter)));
|
|
145
|
+
}),
|
|
146
|
+
...visibleParameters.map((parameter) => (_jsx(AutomationParameter, { parameter: parameter, onChange: onParameterChange, onDelete: onParameterDelete, overlayPositionType: overlayPositionType }, `parameter-${parameter.ref.identifier}`))),
|
|
147
|
+
].slice(0, showAllFilters || isExpanded ? undefined : COLLAPSED_FILTERS_COUNT), isExpanded || !isExpandable ? (_jsx(AttributesDropdown, { id: AUTOMATION_FILTERS_DIALOG_ID, onClose: () => { }, onSelect: (value) => {
|
|
139
148
|
handleAddFilter(value, attributes, dateDatasets);
|
|
140
149
|
setIsExpanded(true);
|
|
150
|
+
}, parameters: parameterDropdownItems, onParameterSelect: (ref) => {
|
|
151
|
+
onParameterAdd?.(ref);
|
|
152
|
+
setIsExpanded(true);
|
|
141
153
|
}, attributes: attributes, dateDatasets: dateDatasets, measures: measures, openOnInit: false, overlayPositionType: overlayPositionType, className: "gd-automation-filters__dropdown s-automation-filters-add-filter-dropdown", getCustomItemTitle: (item) => getCatalogItemCustomTitle(item, availableFilters, dateConfigs), accessibilityConfig: {
|
|
142
154
|
ariaLabelledBy: AUTOMATION_FILTERS_DIALOG_TITLE_ID,
|
|
143
155
|
searchAriaLabel: searchAriaLabel,
|
package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type IdentifierRef } from "@gooddata/sdk-model";
|
|
3
|
+
import { type OverlayPositionType } from "@gooddata/sdk-ui-kit";
|
|
4
|
+
import { type IAutomationParameter } from "../automationParameters.js";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface IAutomationParameterProps {
|
|
9
|
+
parameter: IAutomationParameter;
|
|
10
|
+
onChange?: (ref: IdentifierRef, value: number) => void;
|
|
11
|
+
onDelete?: (ref: IdentifierRef) => void;
|
|
12
|
+
overlayPositionType?: OverlayPositionType;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Workspace parameter as an editable chip in automation dialogs.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function AutomationParameter({ parameter, onChange, onDelete, overlayPositionType }: IAutomationParameterProps): ReactNode;
|
|
20
|
+
//# sourceMappingURL=AutomationParameter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutomationParameter.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationParameter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAEH,KAAK,mBAAmB,EAM3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,SAAS,EAAE,oBAAoB,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC7C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACtB,EAAE,yBAAyB,GAAG,SAAS,CAoEvC"}
|
package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from "react-intl";
|
|
3
|
+
import { DashboardParameterModeValues } from "@gooddata/sdk-model";
|
|
4
|
+
import { Dropdown, ParameterControlDropdown, UiChip, UiTooltip, isActionKey, useIdPrefixed, } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
/**
|
|
6
|
+
* Workspace parameter as an editable chip in automation dialogs.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export function AutomationParameter({ parameter, onChange, onDelete, overlayPositionType, }) {
|
|
11
|
+
const intl = useIntl();
|
|
12
|
+
const { ref, title, value, mode, constraints } = parameter;
|
|
13
|
+
const testId = `automation-parameter-${ref.identifier}`;
|
|
14
|
+
const label = intl.formatMessage({ id: "dialogs.automation.parameters.chip" }, { title, value });
|
|
15
|
+
const lockedTooltip = intl.formatMessage({ id: "dialogs.automation.filters.lockedTooltip" });
|
|
16
|
+
const deleteAriaLabel = intl.formatMessage({ id: "dialogs.automation.filters.deleteAriaLabel" });
|
|
17
|
+
const tooltipId = useIdPrefixed("automation-parameter-tooltip");
|
|
18
|
+
if (mode === DashboardParameterModeValues.READONLY) {
|
|
19
|
+
return (_jsx(UiChip, { label: label, iconBefore: "parameter", isLocked: true, isExpandable: false, dataTestId: testId, renderChipContent: (content) => (_jsx(UiTooltip, { id: tooltipId, arrowPlacement: "top-start", content: lockedTooltip, triggerBy: ["hover", "focus"], anchor: content, anchorWrapperStyles: { display: "flex", width: "100%", height: "100%", minWidth: 0 } })) }));
|
|
20
|
+
}
|
|
21
|
+
return (_jsx(Dropdown, { overlayPositionType: overlayPositionType, renderButton: ({ isOpen, toggleDropdown }) => (_jsx(UiChip, { label: label, iconBefore: "parameter", isActive: isOpen, isDeletable: true, onClick: () => toggleDropdown(), onDelete: () => onDelete?.(ref), dataTestId: testId, accessibilityConfig: {
|
|
22
|
+
isExpanded: isOpen,
|
|
23
|
+
deleteAriaLabel: `${deleteAriaLabel} ${title}`,
|
|
24
|
+
}, onDeleteKeyDown: (event) => {
|
|
25
|
+
if (isActionKey(event)) {
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
}
|
|
28
|
+
} })), renderBody: ({ closeDropdown }) => (_jsx(ParameterControlDropdown, { name: title, value: value, constraints: constraints, onApply: (next) => {
|
|
29
|
+
onChange?.(ref, next);
|
|
30
|
+
closeDropdown();
|
|
31
|
+
}, onCancel: closeDropdown })) }));
|
|
32
|
+
}
|