@gooddata/sdk-ui-dashboard 11.48.0-alpha.1 → 11.48.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/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/_staging/automation/index.d.ts +7 -9
- package/esm/_staging/automation/index.d.ts.map +1 -1
- package/esm/_staging/automation/index.js +22 -12
- package/esm/kdaDialog/composition/KdaAttributesDropdown.d.ts +15 -0
- package/esm/kdaDialog/composition/KdaAttributesDropdown.d.ts.map +1 -0
- package/esm/kdaDialog/composition/KdaAttributesDropdown.js +66 -0
- package/esm/kdaDialog/composition/KdaAttributesSelectItem.d.ts +14 -0
- package/esm/kdaDialog/composition/KdaAttributesSelectItem.d.ts.map +1 -0
- package/esm/kdaDialog/composition/KdaAttributesSelectItem.js +33 -0
- package/esm/kdaDialog/composition/KeyDriversFooter.d.ts.map +1 -1
- package/esm/kdaDialog/composition/KeyDriversFooter.js +24 -78
- package/esm/kdaDialog/composition/hooks/useKdaAttributesSelection.d.ts +15 -0
- package/esm/kdaDialog/composition/hooks/useKdaAttributesSelection.d.ts.map +1 -0
- package/esm/kdaDialog/composition/hooks/useKdaAttributesSelection.js +51 -0
- package/esm/kdaDialog/composition/hooks/useKdaValidAttributes.d.ts +9 -0
- package/esm/kdaDialog/composition/hooks/useKdaValidAttributes.d.ts.map +1 -0
- package/esm/kdaDialog/composition/hooks/useKdaValidAttributes.js +45 -0
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts +10 -3
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.js +5 -4
- package/esm/model/commandHandlers/scheduledEmail/createScheduledEmailHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/createScheduledEmailHandler.js +11 -2
- package/esm/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.d.ts +9 -1
- package/esm/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/csvRawExecutionDefinition.js +4 -4
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.js +9 -2
- package/esm/model/commandHandlers/scheduledEmail/saveScheduledEmailHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/saveScheduledEmailHandler.js +11 -2
- package/esm/model/commandHandlers/widgets/exportInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/exportInsightWidgetHandler.js +47 -13
- package/esm/model/react/useExportTemplates.d.ts +7 -2
- package/esm/model/react/useExportTemplates.d.ts.map +1 -1
- package/esm/model/react/useExportTemplates.js +50 -6
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.js +10 -11
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +0 -20
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersSelectors.js +8 -34
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertThreshold.d.ts +20 -0
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertThreshold.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useAlertThreshold.js +16 -0
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.js +12 -8
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.js +2 -2
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.test.js +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js +2 -2
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js +1 -1
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts +20 -17
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/automationParameters.js +57 -40
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts +3 -3
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.js +3 -3
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.js +9 -5
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.js +13 -5
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts +3 -3
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationExportParameters.js +18 -10
- package/esm/presentation/automations/shared/automationFilters/useParameterAnnouncements.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/useParameterAnnouncements.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/selectionMode/SelectionModeItem.js +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/selectionType/SelectionTypeItem.js +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +13 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +17 -5
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +6 -2
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +5 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +5 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +5 -1
- package/esm/presentation/topBar/buttonBar/button/settingButton/DefaultSettingButton.d.ts +1 -1
- package/esm/presentation/topBar/buttonBar/button/settingButton/DefaultSettingButton.d.ts.map +1 -1
- package/esm/presentation/topBar/buttonBar/button/settingButton/DefaultSettingButton.js +6 -7
- package/esm/sdk-ui-dashboard.d.ts +1 -1
- package/package.json +21 -21
- package/styles/css/kdaDialog.css +30 -9
- package/styles/css/kdaDialog.css.map +1 -1
- package/styles/css/main.css +33 -22
- package/styles/css/main.css.map +1 -1
- package/styles/css/topBar.css +3 -13
- package/styles/css/topBar.css.map +1 -1
- package/styles/scss/kdaDialog.scss +30 -9
- package/styles/scss/topBar.scss +3 -15
|
@@ -8,11 +8,11 @@ import { useAutomationAlertParameters } from "../../../shared/automationFilters/
|
|
|
8
8
|
import { getAppliedWidgetFilters, getVisibleFiltersByFilters, resolveMvfDimensionalityLocalRefs, } from "../../../shared/automationFilters/utils.js";
|
|
9
9
|
import { convertCurrentUserToAutomationRecipient, convertCurrentUserToWorkspaceUser, convertExternalRecipientToAutomationRecipient, } from "../../../shared/utils/automationUtils.js";
|
|
10
10
|
import { createDefaultAlert } from "../utils/convertors.js";
|
|
11
|
-
import { transformAlertByAnomalyDetection, transformAlertByAttribute, transformAlertByComparisonOperator, transformAlertByDestination, transformAlertByGranularity, transformAlertByMetric, transformAlertByRelativeOperator, transformAlertBySensitivity,
|
|
11
|
+
import { transformAlertByAnomalyDetection, transformAlertByAttribute, transformAlertByComparisonOperator, transformAlertByDestination, transformAlertByGranularity, transformAlertByMetric, transformAlertByRelativeOperator, transformAlertBySensitivity, } from "../utils/transformation.js";
|
|
12
12
|
import { useAlertFormValidation } from "./useAlertFormValidation.js";
|
|
13
13
|
import { useAlertSelectedValues } from "./useAlertSelectedValues.js";
|
|
14
14
|
import { useAlertSupportedMetrics } from "./useAlertSupportedMetrics.js";
|
|
15
|
-
import {
|
|
15
|
+
import { useAlertThreshold } from "./useAlertThreshold.js";
|
|
16
16
|
export function useEditAlert({ alertToEdit, notificationChannels, insight, widget, users, editedAutomationFilters, maxAutomationsRecipients, setEditedAutomationFilters, availableFiltersAsVisibleFilters, filtersForNewAutomation, externalRecipientOverride, }) {
|
|
17
17
|
const intl = useIntl();
|
|
18
18
|
const { catalogDateDatasets, catalogAttributes, currentUser, separators, weekStart, timezone, settings, allowHourlyRecurrence, features: { enableAlertOncePerInterval }, } = useAutomationsContext();
|
|
@@ -20,8 +20,6 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
|
|
|
20
20
|
const { dashboardId, hiddenFilters: dashboardHiddenFilters, commonDateFilterId, dashboardEvaluationFrequency, widgetLocalIdToTabIdMap: widgetTabMap, parameterValues, } = useAlertingDialogContext();
|
|
21
21
|
// Determine target tab ID if widget is present
|
|
22
22
|
const targetTabIdentifier = widget?.localIdentifier ? widgetTabMap[widget.localIdentifier] : undefined;
|
|
23
|
-
// Computed values
|
|
24
|
-
const isNewAlert = !alertToEdit;
|
|
25
23
|
const { measureFormatMap, supportedMeasures, supportedAttributes, isResultLoading, getAttributeValues, getMetricValue, } = useAlertSupportedMetrics({ insight, widget, alertToEdit });
|
|
26
24
|
// Default values
|
|
27
25
|
const defaultMeasure = supportedMeasures[0];
|
|
@@ -99,9 +97,6 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
|
|
|
99
97
|
? transformAlertByAttribute(supportedAttributes, alert, attribute, value)
|
|
100
98
|
: undefined);
|
|
101
99
|
}, [supportedAttributes]);
|
|
102
|
-
const onValueChange = useCallback((value) => {
|
|
103
|
-
setEditedAutomation((alert) => alert ? transformAlertByValue(alert, value) : undefined);
|
|
104
|
-
}, []);
|
|
105
100
|
const onComparisonOperatorChange = useCallback((measure, comparisonOperator) => {
|
|
106
101
|
setEditedAutomation((alert) => alert
|
|
107
102
|
? transformAlertByComparisonOperator(supportedMeasures, alert, measure, comparisonOperator)
|
|
@@ -237,7 +232,16 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
|
|
|
237
232
|
const onApplyCurrentFilters = useCallback(() => {
|
|
238
233
|
onFiltersChange(filtersForNewAutomation);
|
|
239
234
|
}, [filtersForNewAutomation, onFiltersChange]);
|
|
240
|
-
const { value, onChange, onBlur,
|
|
235
|
+
const { value, onChange, onBlur, thresholdErrorMessage } = useAlertThreshold({
|
|
236
|
+
setEditedAutomation,
|
|
237
|
+
editedAutomation,
|
|
238
|
+
getMetricValue,
|
|
239
|
+
isNewAlert: !alertToEdit,
|
|
240
|
+
selectedRelativeOperator,
|
|
241
|
+
selectedMeasure,
|
|
242
|
+
selectedAttribute,
|
|
243
|
+
selectedValue,
|
|
244
|
+
});
|
|
241
245
|
const { isSubmitDisabled, validationErrorMessage, isParentValid } = useAlertFormValidation({
|
|
242
246
|
editedAutomation,
|
|
243
247
|
originalAutomation,
|
|
@@ -7,7 +7,7 @@ import { selectExecutionResultEntities } from "../../../../model/store/execution
|
|
|
7
7
|
import { selectAutomationCommonDateFilterId, selectAutomationDefaultSelectedFilters, selectDashboardHiddenFilters, } from "../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
8
8
|
import { selectDashboardId, selectEvaluationFrequency } from "../../../../model/store/meta/metaSelectors.js";
|
|
9
9
|
import { selectWidgetLocalIdToTabIdMap } from "../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
10
|
-
import {
|
|
10
|
+
import { selectEffectiveParameterValuesForWidget } from "../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
11
11
|
import { getWidgetTitle } from "../../../../model/utils/dashboardItemUtils.js";
|
|
12
12
|
import { useCommandAsPromise, useDeleteAutomation } from "./useCommandAsPromise.js";
|
|
13
13
|
export function useBuildAlertingDialogContext(opts) {
|
|
@@ -19,7 +19,7 @@ export function useBuildAlertingDialogContext(opts) {
|
|
|
19
19
|
const executionResultEntities = useDashboardSelector(selectExecutionResultEntities);
|
|
20
20
|
const commonDateFilterId = useDashboardSelector(selectAutomationCommonDateFilterId);
|
|
21
21
|
const dashboardEvaluationFrequency = useDashboardSelector(selectEvaluationFrequency);
|
|
22
|
-
const parameterValues = useDashboardSelector(
|
|
22
|
+
const parameterValues = useDashboardSelector(selectEffectiveParameterValuesForWidget(widget?.ref));
|
|
23
23
|
const widgetTitle = useMemo(() => {
|
|
24
24
|
if (widget) {
|
|
25
25
|
return getWidgetTitle(widget);
|
|
@@ -43,7 +43,7 @@ vi.mock("../../../../model/store/tabs/layout/layoutSelectors.js", () => ({
|
|
|
43
43
|
selectWidgetLocalIdToTabIdMap: () => ({}),
|
|
44
44
|
}));
|
|
45
45
|
vi.mock("../../../../model/store/tabs/parameters/parametersSelectors.js", () => ({
|
|
46
|
-
|
|
46
|
+
selectEffectiveParameterValuesForWidget: () => () => [],
|
|
47
47
|
}));
|
|
48
48
|
vi.mock("../../../../model/utils/dashboardItemUtils.js", () => ({
|
|
49
49
|
getWidgetTitle: () => "widget title",
|
package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.js
CHANGED
|
@@ -12,7 +12,7 @@ import { selectEffectiveAttributeFiltersModeMap } from "../../../../model/store/
|
|
|
12
12
|
import { selectEffectiveDateFilterMode } from "../../../../model/store/tabs/dateFilterConfig/dateFilterConfigSelectors.js";
|
|
13
13
|
import { selectEffectiveDateFiltersModeMap } from "../../../../model/store/tabs/dateFilterConfigs/dateFilterConfigsSelectors.js";
|
|
14
14
|
import { selectWidgetLocalIdToTabIdMap } from "../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
15
|
-
import {
|
|
15
|
+
import { selectExportEffectiveParameters } from "../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
16
16
|
import { selectTabs } from "../../../../model/store/tabs/tabsSelectors.js";
|
|
17
17
|
import { getWidgetTitle } from "../../../../model/utils/dashboardItemUtils.js";
|
|
18
18
|
import { useCommandAsPromise, useDeleteAutomation } from "./useCommandAsPromise.js";
|
|
@@ -24,7 +24,7 @@ export function useBuildScheduledEmailDialogContext(opts) {
|
|
|
24
24
|
const dashboardTitle = useDashboardSelector(selectDashboardTitle);
|
|
25
25
|
const widgetLocalIdToTabIdMap = useDashboardSelector(selectWidgetLocalIdToTabIdMap);
|
|
26
26
|
const commonDateFilterId = useDashboardSelector(selectAutomationCommonDateFilterId);
|
|
27
|
-
const exportParametersByTab = useDashboardSelector(
|
|
27
|
+
const exportParametersByTab = useDashboardSelector(selectExportEffectiveParameters(widget ? [objRefToString(widget.ref)] : undefined));
|
|
28
28
|
const exportTemplates = useExportTemplates();
|
|
29
29
|
const dateFormat = useDashboardSelector(selectDateFormat);
|
|
30
30
|
const isCrossFiltering = useDashboardSelector(selectIsCrossFiltering);
|
package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js
CHANGED
|
@@ -60,7 +60,7 @@ vi.mock("../../../../model/store/tabs/tabsSelectors.js", () => ({
|
|
|
60
60
|
selectTabs: () => [],
|
|
61
61
|
}));
|
|
62
62
|
vi.mock("../../../../model/store/tabs/parameters/parametersSelectors.js", () => ({
|
|
63
|
-
|
|
63
|
+
selectExportEffectiveParameters: () => () => ({}),
|
|
64
64
|
}));
|
|
65
65
|
vi.mock("../../../../model/react/useExportTemplates.js", () => ({
|
|
66
66
|
useExportTemplates: () => [],
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import { type DashboardParameterMode, type IAutomationMetadataObjectDefinition, type IDashboardExportParameter, type IDashboardParameter, type IInsightParameterValue, type
|
|
1
|
+
import { type DashboardParameterMode, type IAutomationMetadataObjectDefinition, type IDashboardExportParameter, type IDashboardParameter, type IInsightParameterValue, type IParameterDefinition, type IParameterMetadataObject, type IdentifierRef, type ParameterValue } from "@gooddata/sdk-model";
|
|
2
2
|
/**
|
|
3
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
|
|
4
|
+
* dialog. The `value` is the current effective value the headless run will capture; `definition`
|
|
5
|
+
* picks which control renders.
|
|
5
6
|
*
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
9
|
export interface IAutomationParameter {
|
|
9
10
|
ref: IdentifierRef;
|
|
10
11
|
title: string;
|
|
11
|
-
value:
|
|
12
|
+
value: ParameterValue;
|
|
12
13
|
mode: DashboardParameterMode;
|
|
13
|
-
|
|
14
|
+
definition: IParameterDefinition;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Stored {@link IInsightParameterValue} overrides carry only {ref, value}; title, mode and
|
|
17
|
-
*
|
|
18
|
+
* definition are re-derived from the current dashboard and workspace catalog. Rows without a
|
|
19
|
+
* resolvable definition (see {@link resolveParameterDefinition}) are dropped.
|
|
18
20
|
*
|
|
19
21
|
* @internal
|
|
20
22
|
*/
|
|
21
|
-
export declare function reconstructAutomationParametersFromValues(stored: IInsightParameterValue[], dashboardParameters: IDashboardParameter[], catalog: IParameterMetadataObject[]): IAutomationParameter[];
|
|
23
|
+
export declare function reconstructAutomationParametersFromValues(stored: IInsightParameterValue[], dashboardParameters: IDashboardParameter[], catalog: IParameterMetadataObject[], isStringParametersEnabled: boolean): IAutomationParameter[];
|
|
22
24
|
/**
|
|
23
25
|
* Stored export overrides ({@link IDashboardExportParameter}) carry the value as a string; it is
|
|
24
|
-
*
|
|
25
|
-
* re-derived from the current dashboard and workspace catalog, mirroring
|
|
26
|
+
* decoded back by the row's own type tag (see `exportParametersToValues`). Title, mode and
|
|
27
|
+
* definition are re-derived from the current dashboard and workspace catalog, mirroring
|
|
26
28
|
* {@link reconstructAutomationParametersFromValues}.
|
|
27
29
|
*
|
|
28
30
|
* @internal
|
|
29
31
|
*/
|
|
30
|
-
export declare function reconstructAutomationParametersFromExportParameters(stored: IDashboardExportParameter[], dashboardParameters: IDashboardParameter[], catalog: IParameterMetadataObject[]): IAutomationParameter[];
|
|
32
|
+
export declare function reconstructAutomationParametersFromExportParameters(stored: IDashboardExportParameter[], dashboardParameters: IDashboardParameter[], catalog: IParameterMetadataObject[], isStringParametersEnabled: boolean): IAutomationParameter[];
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
34
|
+
* Dashboard-`hidden` and `readonly` parameters are dropped — once added they would derive back to
|
|
35
|
+
* an invisible or locked (undeletable) parameter. Catalog STRING parameters are dropped too while
|
|
36
|
+
* `isStringParametersEnabled` is off.
|
|
35
37
|
*
|
|
36
38
|
* @internal
|
|
37
39
|
*/
|
|
38
|
-
export declare function availableAutomationParameters(catalog: IParameterMetadataObject[], selected: IAutomationParameter[], dashboardParameters
|
|
40
|
+
export declare function availableAutomationParameters(catalog: IParameterMetadataObject[], selected: IAutomationParameter[], dashboardParameters: IDashboardParameter[] | undefined, widgetParameterValues: IInsightParameterValue[] | undefined, isStringParametersEnabled: boolean): IAutomationParameter[];
|
|
39
41
|
/**
|
|
40
42
|
* Returns a copy of the automation with `alert.execution.parameters` replaced. No-op when the
|
|
41
43
|
* automation carries no alert.
|
|
@@ -45,7 +47,8 @@ export declare function availableAutomationParameters(catalog: IParameterMetadat
|
|
|
45
47
|
export declare function setAlertExecutionParameters(automation: IAutomationMetadataObjectDefinition, parameters: IInsightParameterValue[]): IAutomationMetadataObjectDefinition;
|
|
46
48
|
/**
|
|
47
49
|
* A param dropped from the *dashboard* is not stale: parameters are workspace-scoped, so only
|
|
48
|
-
* removal from the workspace catalog counts
|
|
50
|
+
* removal from the workspace catalog counts — as does a parameter recreated with the same id but
|
|
51
|
+
* the other type, where the decoded value kind disagrees with the current definition.
|
|
49
52
|
*
|
|
50
53
|
* @internal
|
|
51
54
|
*/
|
|
@@ -57,9 +60,9 @@ export declare function hasStaleAlertParameters(stored: IInsightParameterValue[]
|
|
|
57
60
|
*/
|
|
58
61
|
export declare function dropStaleAlertParameters(stored: IInsightParameterValue[], catalog: IParameterMetadataObject[]): IInsightParameterValue[];
|
|
59
62
|
/**
|
|
60
|
-
* Encodes the display-ready
|
|
61
|
-
* title}). The full per-tab execution set (including `hidden` entries) is converted, not just the
|
|
62
|
-
* visible
|
|
63
|
+
* Encodes the display-ready parameter set back to the neutral export wire shape ({id, value:string,
|
|
64
|
+
* title, parameterType}). The full per-tab execution set (including `hidden` entries) is converted, not just the
|
|
65
|
+
* visible ones, so the server resolver does not drop omitted parameters to the workspace default.
|
|
63
66
|
*
|
|
64
67
|
* @internal
|
|
65
68
|
*/
|
|
@@ -1 +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,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,
|
|
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,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,cAAc,EAKtB,MAAM,qBAAqB,CAAC;AAI7B;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,sBAAsB,CAAC;IAC7B,UAAU,EAAE,oBAAoB,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,yCAAyC,CACrD,MAAM,EAAE,sBAAsB,EAAE,EAChC,mBAAmB,EAAE,mBAAmB,EAAE,EAC1C,OAAO,EAAE,wBAAwB,EAAE,EACnC,yBAAyB,EAAE,OAAO,GACnC,oBAAoB,EAAE,CAyBxB;AAED;;;;;;;GAOG;AACH,wBAAgB,mDAAmD,CAC/D,MAAM,EAAE,yBAAyB,EAAE,EACnC,mBAAmB,EAAE,mBAAmB,EAAE,EAC1C,OAAO,EAAE,wBAAwB,EAAE,EACnC,yBAAyB,EAAE,OAAO,GACnC,oBAAoB,EAAE,CAOxB;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CACzC,OAAO,EAAE,wBAAwB,EAAE,EACnC,QAAQ,EAAE,oBAAoB,EAAE,EAChC,mBAAmB,mCAA4B,EAC/C,qBAAqB,sCAA+B,EACpD,yBAAyB,EAAE,OAAO,GACnC,oBAAoB,EAAE,CAmCxB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACvC,UAAU,EAAE,mCAAmC,EAC/C,UAAU,EAAE,sBAAsB,EAAE,GACrC,mCAAmC,CAcrC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,sBAAsB,EAAE,GAAG,SAAS,EAC5C,OAAO,EAAE,wBAAwB,EAAE,GACpC,OAAO,CAMT;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,sBAAsB,EAAE,EAChC,OAAO,EAAE,wBAAwB,EAAE,GACpC,sBAAsB,EAAE,CAG1B;AAED;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CAClD,UAAU,EAAE,oBAAoB,EAAE,GACnC,yBAAyB,EAAE,CAO7B;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACtC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,EACvD,WAAW,EAAE,OAAO,GACrB,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,CASzD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,gBAAgB,EAAE,OAAO,EAAE,YAAY,UAAQ,GAAG,OAAO,CAEpG"}
|
|
@@ -1,61 +1,59 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { DashboardParameterModeValues, isIdentifierRef,
|
|
3
|
-
import { exportParametersToValues
|
|
2
|
+
import { DashboardParameterModeValues, isIdentifierRef, objRefToString, parameterValueMatchesType, sanitizeParameterValue, } from "@gooddata/sdk-model";
|
|
3
|
+
import { exportParametersToValues } from "../../../../_staging/automation/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Stored {@link IInsightParameterValue} overrides carry only {ref, value}; title, mode and
|
|
6
|
-
*
|
|
6
|
+
* definition are re-derived from the current dashboard and workspace catalog. Rows without a
|
|
7
|
+
* resolvable definition (see {@link resolveParameterDefinition}) are dropped.
|
|
7
8
|
*
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
10
|
-
export function reconstructAutomationParametersFromValues(stored, dashboardParameters, catalog) {
|
|
11
|
+
export function reconstructAutomationParametersFromValues(stored, dashboardParameters, catalog, isStringParametersEnabled) {
|
|
11
12
|
const dashboardByRef = new Map(dashboardParameters.map((parameter) => [objRefToString(parameter.ref), parameter]));
|
|
12
13
|
const workspaceByRef = new Map(catalog.map((parameter) => [objRefToString(parameter.ref), parameter]));
|
|
13
14
|
return stored.flatMap((row) => {
|
|
14
|
-
if (!isAutomationSupportedParameterValue(row.value)) {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
15
|
const refKey = objRefToString(row.ref);
|
|
18
16
|
const dashboardParameter = dashboardByRef.get(refKey);
|
|
19
17
|
const workspaceParameter = workspaceByRef.get(refKey);
|
|
20
|
-
const
|
|
18
|
+
const definition = resolveParameterDefinition(workspaceParameter, row.value, isStringParametersEnabled);
|
|
19
|
+
if (!definition) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
21
22
|
return {
|
|
22
23
|
ref: row.ref,
|
|
23
24
|
title: dashboardParameter?.label ?? workspaceParameter?.title ?? row.ref.identifier,
|
|
24
25
|
value: row.value,
|
|
25
26
|
mode: dashboardParameter?.mode ?? DashboardParameterModeValues.ACTIVE,
|
|
26
|
-
|
|
27
|
+
definition,
|
|
27
28
|
};
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Stored export overrides ({@link IDashboardExportParameter}) carry the value as a string; it is
|
|
32
|
-
*
|
|
33
|
-
* re-derived from the current dashboard and workspace catalog, mirroring
|
|
33
|
+
* decoded back by the row's own type tag (see `exportParametersToValues`). Title, mode and
|
|
34
|
+
* definition are re-derived from the current dashboard and workspace catalog, mirroring
|
|
34
35
|
* {@link reconstructAutomationParametersFromValues}.
|
|
35
36
|
*
|
|
36
37
|
* @internal
|
|
37
38
|
*/
|
|
38
|
-
export function reconstructAutomationParametersFromExportParameters(stored, dashboardParameters, catalog) {
|
|
39
|
-
return reconstructAutomationParametersFromValues(exportParametersToValues(stored), dashboardParameters, catalog);
|
|
39
|
+
export function reconstructAutomationParametersFromExportParameters(stored, dashboardParameters, catalog, isStringParametersEnabled) {
|
|
40
|
+
return reconstructAutomationParametersFromValues(exportParametersToValues(stored, isStringParametersEnabled), dashboardParameters, catalog, isStringParametersEnabled);
|
|
40
41
|
}
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
* Dashboard-`hidden` and `readonly` parameters are dropped — once added they would derive back to
|
|
44
|
+
* an invisible or locked (undeletable) parameter. Catalog STRING parameters are dropped too while
|
|
45
|
+
* `isStringParametersEnabled` is off.
|
|
45
46
|
*
|
|
46
47
|
* @internal
|
|
47
48
|
*/
|
|
48
|
-
export function availableAutomationParameters(catalog, selected, dashboardParameters = [], widgetParameterValues = []) {
|
|
49
|
+
export function availableAutomationParameters(catalog, selected, dashboardParameters = [], widgetParameterValues = [], isStringParametersEnabled) {
|
|
49
50
|
const selectedRefKeys = new Set(selected.map((parameter) => objRefToString(parameter.ref)));
|
|
50
51
|
const dashboardByRef = new Map(dashboardParameters.map((parameter) => [objRefToString(parameter.ref), parameter]));
|
|
51
52
|
const widgetValueByRef = new Map(widgetParameterValues.map((row) => [objRefToString(row.ref), row.value]));
|
|
52
53
|
const result = [];
|
|
53
54
|
for (const workspaceParameter of catalog) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
const { ref } = workspaceParameter;
|
|
58
|
-
if (!isIdentifierRef(ref)) {
|
|
55
|
+
const { ref, definition } = workspaceParameter;
|
|
56
|
+
if (!isIdentifierRef(ref) || (definition.type === "STRING" && !isStringParametersEnabled)) {
|
|
59
57
|
continue;
|
|
60
58
|
}
|
|
61
59
|
const refKey = objRefToString(ref);
|
|
@@ -65,15 +63,14 @@ export function availableAutomationParameters(catalog, selected, dashboardParame
|
|
|
65
63
|
dashboardParameter?.mode === DashboardParameterModeValues.READONLY) {
|
|
66
64
|
continue;
|
|
67
65
|
}
|
|
68
|
-
const { defaultValue, constraints } = workspaceParameter.definition;
|
|
69
66
|
// mirror the live-render precedence: runtimeOverride/insight value > dashboard value > default
|
|
70
|
-
const effectiveValue = widgetValueByRef.get(refKey) ?? dashboardParameter?.value ?? defaultValue;
|
|
67
|
+
const effectiveValue = widgetValueByRef.get(refKey) ?? dashboardParameter?.value ?? definition.defaultValue;
|
|
71
68
|
result.push({
|
|
72
69
|
ref,
|
|
73
70
|
title: dashboardParameter?.label ?? workspaceParameter.title,
|
|
74
|
-
value:
|
|
71
|
+
value: sanitizeParameterValue(definition, effectiveValue),
|
|
75
72
|
mode: DashboardParameterModeValues.ACTIVE,
|
|
76
|
-
|
|
73
|
+
definition,
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
76
|
return result;
|
|
@@ -101,7 +98,8 @@ export function setAlertExecutionParameters(automation, parameters) {
|
|
|
101
98
|
}
|
|
102
99
|
/**
|
|
103
100
|
* A param dropped from the *dashboard* is not stale: parameters are workspace-scoped, so only
|
|
104
|
-
* removal from the workspace catalog counts
|
|
101
|
+
* removal from the workspace catalog counts — as does a parameter recreated with the same id but
|
|
102
|
+
* the other type, where the decoded value kind disagrees with the current definition.
|
|
105
103
|
*
|
|
106
104
|
* @internal
|
|
107
105
|
*/
|
|
@@ -109,8 +107,8 @@ export function hasStaleAlertParameters(stored, catalog) {
|
|
|
109
107
|
if (!stored?.length) {
|
|
110
108
|
return false;
|
|
111
109
|
}
|
|
112
|
-
const
|
|
113
|
-
return stored.some((parameter) => !
|
|
110
|
+
const catalogById = new Map(catalog.map((parameter) => [parameter.id, parameter]));
|
|
111
|
+
return stored.some((parameter) => !alertParameterMatchesCatalog(parameter, catalogById));
|
|
114
112
|
}
|
|
115
113
|
/**
|
|
116
114
|
* Removes the parameters {@link hasStaleAlertParameters} flags as stale.
|
|
@@ -118,13 +116,13 @@ export function hasStaleAlertParameters(stored, catalog) {
|
|
|
118
116
|
* @internal
|
|
119
117
|
*/
|
|
120
118
|
export function dropStaleAlertParameters(stored, catalog) {
|
|
121
|
-
const
|
|
122
|
-
return stored.filter((parameter) =>
|
|
119
|
+
const catalogById = new Map(catalog.map((parameter) => [parameter.id, parameter]));
|
|
120
|
+
return stored.filter((parameter) => alertParameterMatchesCatalog(parameter, catalogById));
|
|
123
121
|
}
|
|
124
122
|
/**
|
|
125
|
-
* Encodes the display-ready
|
|
126
|
-
* title}). The full per-tab execution set (including `hidden` entries) is converted, not just the
|
|
127
|
-
* visible
|
|
123
|
+
* Encodes the display-ready parameter set back to the neutral export wire shape ({id, value:string,
|
|
124
|
+
* title, parameterType}). The full per-tab execution set (including `hidden` entries) is converted, not just the
|
|
125
|
+
* visible ones, so the server resolver does not drop omitted parameters to the workspace default.
|
|
128
126
|
*
|
|
129
127
|
* @internal
|
|
130
128
|
*/
|
|
@@ -133,6 +131,7 @@ export function automationParametersToExportParameters(parameters) {
|
|
|
133
131
|
id: parameter.ref.identifier,
|
|
134
132
|
value: String(parameter.value),
|
|
135
133
|
title: parameter.title,
|
|
134
|
+
parameterType: parameter.definition.type,
|
|
136
135
|
}));
|
|
137
136
|
}
|
|
138
137
|
/**
|
|
@@ -161,11 +160,29 @@ export function toEffectiveParametersByTab(parametersByTab, shouldStore) {
|
|
|
161
160
|
export function shouldStoreExportParameters(isWidgetSchedule, storeFilters = false) {
|
|
162
161
|
return isWidgetSchedule || storeFilters;
|
|
163
162
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
163
|
+
function alertParameterMatchesCatalog(parameter, catalogById) {
|
|
164
|
+
const workspaceParameter = catalogById.get(parameter.ref.identifier);
|
|
165
|
+
return !!workspaceParameter && parameterValueMatchesType(workspaceParameter.definition, parameter.value);
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
/**
|
|
168
|
+
* Every parameter needs a definition — its `type` picks which control renders. The workspace
|
|
169
|
+
* parameter definition is the source of truth; when its type disagrees with the stored value the
|
|
170
|
+
* parameter was recreated as the other type, so the parameter is dropped.
|
|
171
|
+
*/
|
|
172
|
+
function resolveParameterDefinition(workspaceParameter, value, isStringParametersEnabled) {
|
|
173
|
+
const definition = workspaceParameter?.definition;
|
|
174
|
+
if (definition) {
|
|
175
|
+
if (definition.type === "STRING" && !isStringParametersEnabled) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
return parameterValueMatchesType(definition, value) ? definition : undefined;
|
|
179
|
+
}
|
|
180
|
+
// Deleted workspace parameter: synthesize a definition from the value so the parameter stays
|
|
181
|
+
// editable (the constraint-less M1 fallback). Its `defaultValue` is a shape-filling
|
|
182
|
+
// placeholder — rely only on `type`. STRING synthesis is gated the same way as the catalog
|
|
183
|
+
// branch above.
|
|
184
|
+
if (typeof value === "number") {
|
|
185
|
+
return { type: "NUMBER", defaultValue: value };
|
|
186
|
+
}
|
|
187
|
+
return isStringParametersEnabled ? { type: "STRING", defaultValue: value } : undefined;
|
|
171
188
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FilterContextItem, type ICatalogAttribute, type ICatalogDateDataset, type IDashboardAttributeFilterConfig, type IDashboardDateFilterConfigItem, type IdentifierRef, type ObjRef } from "@gooddata/sdk-model";
|
|
1
|
+
import { type FilterContextItem, type ICatalogAttribute, type ICatalogDateDataset, type IDashboardAttributeFilterConfig, type IDashboardDateFilterConfigItem, type IdentifierRef, type ObjRef, type ParameterValue } from "@gooddata/sdk-model";
|
|
2
2
|
import { type OverlayPositionType } from "@gooddata/sdk-ui-kit";
|
|
3
3
|
import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
|
|
4
4
|
import { type IAutomationParameter } from "../automationParameters.js";
|
|
@@ -60,7 +60,7 @@ export interface IAutomationFiltersSelectProps {
|
|
|
60
60
|
/**
|
|
61
61
|
* Called when an `active` parameter chip's value is edited.
|
|
62
62
|
*/
|
|
63
|
-
onParameterChange?: (ref: IdentifierRef, value:
|
|
63
|
+
onParameterChange?: (ref: IdentifierRef, value: ParameterValue) => void;
|
|
64
64
|
/**
|
|
65
65
|
* Called when an `active` parameter chip is removed.
|
|
66
66
|
*/
|
|
@@ -80,7 +80,7 @@ export interface IAutomationFiltersSelectProps {
|
|
|
80
80
|
/**
|
|
81
81
|
* Called when an `active` parameter chip's value is edited in a tab section.
|
|
82
82
|
*/
|
|
83
|
-
onParameterChangeByTab?: (tabId: string, ref: IdentifierRef, value:
|
|
83
|
+
onParameterChangeByTab?: (tabId: string, ref: IdentifierRef, value: ParameterValue) => void;
|
|
84
84
|
/**
|
|
85
85
|
* Called when an `active` parameter chip is removed in a tab section.
|
|
86
86
|
*/
|
|
@@ -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,aAAa,EAClB,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"AutomationFiltersSelect.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.tsx"],"names":[],"mappings":"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"}
|
package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type IdentifierRef } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IdentifierRef, type ParameterValue } from "@gooddata/sdk-model";
|
|
3
3
|
import { type OverlayPositionType } from "@gooddata/sdk-ui-kit";
|
|
4
4
|
import { type IAutomationParameter } from "../automationParameters.js";
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import { type IAutomationParameter } from "../automationParameters.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export interface IAutomationParameterProps {
|
|
9
9
|
parameter: IAutomationParameter;
|
|
10
|
-
onChange?: (ref: IdentifierRef, value:
|
|
10
|
+
onChange?: (ref: IdentifierRef, value: ParameterValue) => void;
|
|
11
11
|
onDelete?: (ref: IdentifierRef) => void;
|
|
12
12
|
overlayPositionType?: OverlayPositionType;
|
|
13
13
|
isReadOnly?: boolean;
|
|
@@ -1 +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;
|
|
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,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC5G,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,cAAc,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACb,EAAE,yBAAyB,GAAG,SAAS,CA0FvC"}
|
package/esm/presentation/automations/shared/automationFilters/components/AutomationParameter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { DashboardParameterModeValues } from "@gooddata/sdk-model";
|
|
4
|
-
import { Dropdown,
|
|
4
|
+
import { Dropdown, ParameterControl, UiChip, UiTooltip, isActionKey, useIdPrefixed, } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
/**
|
|
6
6
|
* Workspace parameter as an editable chip in automation dialogs.
|
|
7
7
|
*
|
|
@@ -9,7 +9,7 @@ import { Dropdown, NumberParameterControlDropdown, UiChip, UiTooltip, isActionKe
|
|
|
9
9
|
*/
|
|
10
10
|
export function AutomationParameter({ parameter, onChange, onDelete, overlayPositionType, isReadOnly, }) {
|
|
11
11
|
const intl = useIntl();
|
|
12
|
-
const { ref, title, value, mode,
|
|
12
|
+
const { ref, title, value, mode, definition } = parameter;
|
|
13
13
|
const testId = `automation-parameter-${ref.identifier}`;
|
|
14
14
|
const label = intl.formatMessage({ id: "dialogs.automation.parameters.chip" }, { title, value });
|
|
15
15
|
const lockedTooltip = intl.formatMessage({ id: "dialogs.automation.filters.lockedTooltip" });
|
|
@@ -33,7 +33,7 @@ export function AutomationParameter({ parameter, onChange, onDelete, overlayPosi
|
|
|
33
33
|
if (isActionKey(event)) {
|
|
34
34
|
event.stopPropagation();
|
|
35
35
|
}
|
|
36
|
-
} })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(
|
|
36
|
+
} })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(ParameterControl, { name: title, definition: definition, value: value, inputId: valueInputId, ariaAttributes: ariaAttributes, onApply: (next) => {
|
|
37
37
|
onChange?.(ref, next);
|
|
38
38
|
closeDropdown();
|
|
39
39
|
}, onCancel: closeDropdown })) }));
|
|
@@ -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;AAiB7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAuEzF,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC,EAAE,OAAO,CAAC;IAC7C,0CAA0C,EAAE,OAAO,CAAC;IACpD,mCAAmC,EAAE,OAAO,CAAC;IAC7C,0CAA0C,EAAE,OAAO,CAAC;IACpD,oCAAoC,EAAE,OAAO,CAAC;IAC9C,oCAAoC,EAAE,OAAO,CAAC;IAC9C,8CAA8C,EAAE,OAAO,CAAC;IACxD,oCAAoC,EAAE,OAAO,CAAC;IAC9C,wBAAwB,EAAE,OAAO,CAAC;IAClC,gDAAgD,EAAE,OAAO,CAAC;IAC1D;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAiBD,wBAAgB,oCAAoC,CAAC,EACjD,gBAAgB,EAChB,MAAM,EACN,OAAO,EACV,EAAE;IACC,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAC7C,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,OAAO,CAAC,EAAE,QAAQ,CAAC;CACtB,GAAG,2BAA2B,CAuD9B;AAoHD;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,EACjD,qBAAqB,EACrB,OAAO,EACP,wBAAwB,EACxB,cAAc,EACd,WAAW,EACd,EAAE;IACC,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,CAAC;IAC/E,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAChE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"useValidateExistingAutomationFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.ts"],"names":[],"mappings":"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"}
|
|
@@ -183,6 +183,9 @@ export function validateExistingAutomationParameters({ storedParametersByTab, ca
|
|
|
183
183
|
if (!workspaceParameter) {
|
|
184
184
|
return true;
|
|
185
185
|
}
|
|
186
|
+
if ((stored.parameterType ?? "NUMBER") !== workspaceParameter.definition.type) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
186
189
|
const dashboardParameter = dashboardById.get(stored.id);
|
|
187
190
|
const mode = dashboardParameter?.mode ?? DashboardParameterModeValues.ACTIVE;
|
|
188
191
|
const isPinnedByAuthor = mode === DashboardParameterModeValues.READONLY ||
|
|
@@ -190,11 +193,12 @@ export function validateExistingAutomationParameters({ storedParametersByTab, ca
|
|
|
190
193
|
if (!isPinnedByAuthor) {
|
|
191
194
|
continue;
|
|
192
195
|
}
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
const currentValue = dashboardParameter?.value ?? workspaceParameter.definition.defaultValue;
|
|
197
|
+
// NUMBER compares numerically so a non-canonical stored encoding (e.g. "1.50") doesn't read as drift
|
|
198
|
+
const valueDrifted = isNumberParameterDefinition(workspaceParameter.definition)
|
|
199
|
+
? Number(stored.value) !== currentValue
|
|
200
|
+
: String(currentValue) !== stored.value;
|
|
201
|
+
if (valueDrifted) {
|
|
198
202
|
return true;
|
|
199
203
|
}
|
|
200
204
|
}
|
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 IdentifierRef, type ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IAutomationMetadataObjectDefinition, type IdentifierRef, type ObjRef, type ParameterValue } from "@gooddata/sdk-model";
|
|
3
3
|
import { type IAutomationParameter } from "./automationParameters.js";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
@@ -15,7 +15,7 @@ export interface IUseAutomationAlertParameters {
|
|
|
15
15
|
*/
|
|
16
16
|
availableParameters: IAutomationParameter[];
|
|
17
17
|
onParameterAdd: (ref: IdentifierRef) => void;
|
|
18
|
-
onParameterChange: (ref: IdentifierRef, value:
|
|
18
|
+
onParameterChange: (ref: IdentifierRef, value: ParameterValue) => void;
|
|
19
19
|
onParameterDelete: (ref: IdentifierRef) => void;
|
|
20
20
|
/**
|
|
21
21
|
* Surgically drops stored parameters whose `ref` left the workspace catalog, keeping every
|
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,EAExC,KAAK,aAAa,EAClB,KAAK,MAAM,
|
|
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,EAExC,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,cAAc,EAEtB,MAAM,qBAAqB,CAAC;AAiB7B,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,SAAS,EACZ,EAAE;IACC,gBAAgB,EAAE,mCAAmC,GAAG,SAAS,CAAC;IAClE,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,GAAG,SAAS,CAAC,CAAC,CAAC;IAC/F,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,6BAA6B,CAiHhC"}
|
package/esm/presentation/automations/shared/automationFilters/useAutomationAlertParameters.js
CHANGED
|
@@ -4,7 +4,7 @@ import { DashboardParameterModeValues, areObjRefsEqual, } from "@gooddata/sdk-mo
|
|
|
4
4
|
import { getAutomationAlertParameters } from "../../../../_staging/automation/index.js";
|
|
5
5
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
6
6
|
import { selectCatalogParameters, selectCatalogParametersIsLoaded, } from "../../../../model/store/catalog/catalogSelectors.js";
|
|
7
|
-
import { selectEnableParameters } from "../../../../model/store/config/configSelectors.js";
|
|
7
|
+
import { selectEnableParameters, selectEnableStringParameters, } from "../../../../model/store/config/configSelectors.js";
|
|
8
8
|
import { selectEffectiveDashboardParametersForWidget, selectEffectiveParameterValuesForWidget, } from "../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
9
9
|
import { availableAutomationParameters, dropStaleAlertParameters, hasStaleAlertParameters, reconstructAutomationParametersFromValues, setAlertExecutionParameters, } from "./automationParameters.js";
|
|
10
10
|
const EMPTY_PARAMETERS = [];
|
|
@@ -16,6 +16,7 @@ const EMPTY_PARAMETERS = [];
|
|
|
16
16
|
*/
|
|
17
17
|
export function useAutomationAlertParameters({ editedAutomation, setEditedAutomation, widgetRef, }) {
|
|
18
18
|
const parametersEnabled = useDashboardSelector(selectEnableParameters);
|
|
19
|
+
const stringParametersEnabled = useDashboardSelector(selectEnableStringParameters);
|
|
19
20
|
const catalog = useDashboardSelector(selectCatalogParameters);
|
|
20
21
|
const catalogIsLoaded = useDashboardSelector(selectCatalogParametersIsLoaded);
|
|
21
22
|
const dashboardParameters = useDashboardSelector(selectEffectiveDashboardParametersForWidget(widgetRef));
|
|
@@ -25,13 +26,20 @@ export function useAutomationAlertParameters({ editedAutomation, setEditedAutoma
|
|
|
25
26
|
if (!parametersEnabled || !storedParameters?.length) {
|
|
26
27
|
return EMPTY_PARAMETERS;
|
|
27
28
|
}
|
|
28
|
-
return (reconstructAutomationParametersFromValues(storedParameters, dashboardParameters, catalog)
|
|
29
|
+
return (reconstructAutomationParametersFromValues(storedParameters, dashboardParameters, catalog, stringParametersEnabled)
|
|
29
30
|
// `hidden` parameters stay in the stored payload but are never rendered or user-editable
|
|
30
31
|
.filter((parameter) => parameter.mode !== DashboardParameterModeValues.HIDDEN));
|
|
31
|
-
}, [parametersEnabled, storedParameters, dashboardParameters, catalog]);
|
|
32
|
+
}, [parametersEnabled, stringParametersEnabled, storedParameters, dashboardParameters, catalog]);
|
|
32
33
|
const availableParameters = useMemo(() => parametersEnabled
|
|
33
|
-
? availableAutomationParameters(catalog, automationParameters, dashboardParameters, widgetParameterValues)
|
|
34
|
-
: EMPTY_PARAMETERS, [
|
|
34
|
+
? availableAutomationParameters(catalog, automationParameters, dashboardParameters, widgetParameterValues, stringParametersEnabled)
|
|
35
|
+
: EMPTY_PARAMETERS, [
|
|
36
|
+
parametersEnabled,
|
|
37
|
+
catalog,
|
|
38
|
+
automationParameters,
|
|
39
|
+
dashboardParameters,
|
|
40
|
+
widgetParameterValues,
|
|
41
|
+
stringParametersEnabled,
|
|
42
|
+
]);
|
|
35
43
|
const updateAlertParameters = useCallback((update) => {
|
|
36
44
|
setEditedAutomation((definition) => definition?.alert
|
|
37
45
|
? setAlertExecutionParameters(definition, update(getAutomationAlertParameters(definition) ?? []))
|