@gooddata/sdk-ui-dashboard 10.10.0-alpha.34 → 10.10.0-alpha.35
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/sharedHooks/useFiltersNamings.d.ts +7 -0
- package/esm/_staging/sharedHooks/useFiltersNamings.d.ts.map +1 -0
- package/esm/_staging/sharedHooks/useFiltersNamings.js +70 -0
- package/esm/_staging/sharedHooks/useFiltersNamings.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.d.ts.map +1 -1
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.js +3 -4
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.js.map +1 -1
- package/esm/presentation/localization/bundles/en-US.json +75 -20
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useAttachmentDashboardFilters.d.ts +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useAttachmentDashboardFilters.d.ts.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useAttachmentDashboardFilters.js +5 -68
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useAttachmentDashboardFilters.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts +6 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js +32 -10
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js +2 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js +28 -4
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts +30 -6
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js +73 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useAlertValidation.js +2 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useAlertValidation.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts +2 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js +10 -41
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.d.ts +9 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.js +22 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts +30 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js +30 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts +16 -5
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js +221 -9
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js.map +1 -1
- package/package.json +15 -15
- package/styles/css/alerting.css +17 -0
- package/styles/css/alerting.css.map +1 -1
- package/styles/css/main.css +17 -0
- package/styles/css/main.css.map +1 -1
- package/styles/scss/alerting.scss +17 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.d.ts +0 -4
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.d.ts.map +0 -1
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.js +0 -31
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.js.map +0 -1
|
@@ -8,7 +8,9 @@ import { AlertDestinationSelect } from "./AlertDestinationSelect.js";
|
|
|
8
8
|
import { EditAlertConfiguration } from "./EditAlertConfiguration.js";
|
|
9
9
|
import { useEditAlert } from "./hooks/useEditAlert.js";
|
|
10
10
|
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
|
11
|
+
import { AlertMetricComparatorType } from "../../types.js";
|
|
11
12
|
import { useAlertValidation } from "./hooks/useAlertValidation.js";
|
|
13
|
+
import { getAlertCompareOperator, getAlertMeasure, getAlertRelativeOperator, getAlertThreshold, getValueSuffix, isChangeOrDifferenceOperator, } from "./utils.js";
|
|
12
14
|
const TOOLTIP_ALIGN_POINTS = [{ align: "cl cr" }, { align: "cr cl" }];
|
|
13
15
|
const messages = defineMessages({
|
|
14
16
|
invalidDefault: {
|
|
@@ -25,7 +27,7 @@ const invalidMessagesObj = {
|
|
|
25
27
|
export const EditAlert = ({ alert, isNewAlert, hasAlerts, destinations, measures, onClose, onCancel, onCreate, onUpdate, maxAutomationsReached = false, overlayPositionType, }) => {
|
|
26
28
|
const { viewMode, updatedAlert, canSubmit,
|
|
27
29
|
//
|
|
28
|
-
changeComparisonOperator, changeMeasure, changeValue, changeDestination,
|
|
30
|
+
changeComparisonOperator, changeRelativeOperator, changeMeasure, changeValue, changeDestination,
|
|
29
31
|
//
|
|
30
32
|
configureAlert, saveAlertConfiguration, cancelAlertConfiguration,
|
|
31
33
|
//
|
|
@@ -36,9 +38,10 @@ export const EditAlert = ({ alert, isNewAlert, hasAlerts, destinations, measures
|
|
|
36
38
|
});
|
|
37
39
|
const intl = useIntl();
|
|
38
40
|
const disableCreateButtonDueToLimits = isNewAlert && maxAutomationsReached;
|
|
39
|
-
const selectedMeasureIdentifier = updatedAlert.alert
|
|
41
|
+
const selectedMeasureIdentifier = getAlertMeasure(updatedAlert.alert);
|
|
40
42
|
const selectedMeasure = measures.find((measure) => measure.measure.measure.localIdentifier === selectedMeasureIdentifier);
|
|
41
43
|
const { isValid, invalidityReason } = useAlertValidation(alert, isNewAlert);
|
|
44
|
+
const filters = alert.alert?.execution?.filters ?? [];
|
|
42
45
|
return viewMode === "edit" ? (React.createElement(DashboardInsightSubmenuContainer, { title: isNewAlert
|
|
43
46
|
? intl.formatMessage({ id: "insightAlert.config.createAlert" })
|
|
44
47
|
: intl.formatMessage({ id: "insightAlert.config.editAlert" }), onClose: onClose, onBack: hasAlerts ? onCancel : undefined },
|
|
@@ -48,8 +51,29 @@ export const EditAlert = ({ alert, isNewAlert, hasAlerts, destinations, measures
|
|
|
48
51
|
React.createElement("div", { className: "gd-edit-alert__measure-label" },
|
|
49
52
|
React.createElement(FormattedMessage, { id: "insightAlert.config.when" })),
|
|
50
53
|
React.createElement(AlertMeasureSelect, { selectedMeasure: selectedMeasure, onMeasureChange: changeMeasure, measures: measures, overlayPositionType: overlayPositionType }),
|
|
51
|
-
React.createElement(
|
|
52
|
-
|
|
54
|
+
filters.length > 0 && (React.createElement("div", { className: "gd-edit-alert__measure-info" },
|
|
55
|
+
React.createElement(FormattedMessage, { id: "insightAlert.config.filters", values: {
|
|
56
|
+
n: filters.length,
|
|
57
|
+
} }),
|
|
58
|
+
React.createElement("div", { role: "item-info", className: "gd-list-item-bubble" },
|
|
59
|
+
React.createElement(BubbleHoverTrigger, { tagName: "div", showDelay: 200, hideDelay: 0, eventsOnBubble: false },
|
|
60
|
+
React.createElement("div", { className: "inlineBubbleHelp" }),
|
|
61
|
+
React.createElement(Bubble, { className: "bubble-primary", alignPoints: [{ align: "cr cl" }], arrowOffsets: { "cr cl": [15, 0] } },
|
|
62
|
+
React.createElement(FormattedMessage, { id: "insightAlert.config.filters.info", values: {
|
|
63
|
+
spacer: (React.createElement("div", { className: "gd-alert-comparison-operator-tooltip-spacer" })),
|
|
64
|
+
} })))))),
|
|
65
|
+
React.createElement(AlertComparisonOperatorSelect, { measure: selectedMeasure, selectedComparisonOperator: getAlertCompareOperator(updatedAlert.alert), selectedRelativeOperator: getAlertRelativeOperator(updatedAlert.alert), onComparisonOperatorChange: changeComparisonOperator, onRelativeOperatorChange: changeRelativeOperator, overlayPositionType: overlayPositionType }),
|
|
66
|
+
React.createElement(Input, { className: "gd-edit-alert__value-input s-alert-value-input", isSmall: true, autofocus: true, value: getAlertThreshold(updatedAlert.alert), onChange: (e) => changeValue(e !== "" ? parseFloat(e) : undefined), type: "number", suffix: getValueSuffix(updatedAlert.alert) }),
|
|
67
|
+
selectedMeasure?.comparators.some((a) => a.comparator === AlertMetricComparatorType.SamePeriodPreviousYear) &&
|
|
68
|
+
isChangeOrDifferenceOperator(updatedAlert.alert) && (React.createElement("div", { className: "gd-edit-alert__measure-info" },
|
|
69
|
+
React.createElement(FormattedMessage, { id: "insightAlert.config.compare_with" }),
|
|
70
|
+
" ",
|
|
71
|
+
React.createElement(FormattedMessage, { id: "insightAlert.config.compare_with_sp" }))),
|
|
72
|
+
selectedMeasure?.comparators.some((a) => a.comparator === AlertMetricComparatorType.PreviousPeriod) &&
|
|
73
|
+
isChangeOrDifferenceOperator(updatedAlert.alert) && (React.createElement("div", { className: "gd-edit-alert__measure-info" },
|
|
74
|
+
React.createElement(FormattedMessage, { id: "insightAlert.config.compare_with" }),
|
|
75
|
+
" ",
|
|
76
|
+
React.createElement(FormattedMessage, { id: "insightAlert.config.compare_with_pp" }))),
|
|
53
77
|
destinations.length > 1 && (React.createElement(AlertDestinationSelect, { selectedDestination: updatedAlert.notificationChannel, onDestinationChange: changeDestination, destinations: destinations, overlayPositionType: overlayPositionType }))),
|
|
54
78
|
!isValid ? (React.createElement(Message, { type: "error" },
|
|
55
79
|
React.createElement(FormattedMessage, { id: invalidMessagesObj[invalidityReason].id }))) : null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditAlert.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACH,MAAM,EACN,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,OAAO,GAEV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gCAAgC,EAAE,MAAM,2GAA2G,CAAC;AAC7J,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAqB,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"EditAlert.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACH,MAAM,EACN,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,OAAO,GAEV,MAAM,sBAAsB,CA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,gCAAgC,IAC7B,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,2BAA2B,EAAE,CAAC,EAC9D,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,wBAAwB;QAEhC,oBAAC,sBAAsB,IACnB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,wBAAwB,EAClC,mBAAmB,EAAE,mBAAmB,GAC1C,CAC6B,CACtC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,20 +1,44 @@
|
|
|
1
1
|
import { IAlertComparisonOperator } from "@gooddata/sdk-model";
|
|
2
|
-
|
|
2
|
+
import { SingleSelectListItemType } from "@gooddata/sdk-ui-kit";
|
|
3
|
+
type OperatorItemType<T = IAlertComparisonOperator> = {
|
|
4
|
+
title: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
id: T;
|
|
7
|
+
type?: SingleSelectListItemType;
|
|
8
|
+
info?: string;
|
|
9
|
+
};
|
|
3
10
|
export declare const COMPARISON_OPERATOR_LESS_THAN = "LESS_THAN";
|
|
4
11
|
export declare const COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO = "LESS_THAN_OR_EQUAL_TO";
|
|
5
12
|
export declare const COMPARISON_OPERATOR_GREATER_THAN = "GREATER_THAN";
|
|
6
13
|
export declare const COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO = "GREATER_THAN_OR_EQUAL_TO";
|
|
14
|
+
export declare const RELATIVE_OPERATOR_INCREASE_BY = "INCREASES_BY";
|
|
15
|
+
export declare const RELATIVE_OPERATOR_DECREASE_BY = "DECREASES_BY";
|
|
16
|
+
export declare const RELATIVE_OPERATOR_CHANGES_BY = "CHANGES_BY";
|
|
17
|
+
export declare const ARITHMETIC_OPERATOR_DIFFERENCE = "DIFFERENCE";
|
|
18
|
+
export declare const ARITHMETIC_OPERATOR_CHANGE = "CHANGE";
|
|
7
19
|
export declare const COMPARISON_OPERATORS: {
|
|
8
20
|
readonly COMPARISON_OPERATOR_LESS_THAN: "LESS_THAN";
|
|
9
21
|
readonly COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO: "LESS_THAN_OR_EQUAL_TO";
|
|
10
22
|
readonly COMPARISON_OPERATOR_GREATER_THAN: "GREATER_THAN";
|
|
11
23
|
readonly COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO: "GREATER_THAN_OR_EQUAL_TO";
|
|
12
24
|
};
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
25
|
+
export declare const RELATIVE_OPERATORS: {
|
|
26
|
+
readonly RELATIVE_OPERATOR_INCREASE_BY: "INCREASES_BY";
|
|
27
|
+
readonly RELATIVE_OPERATOR_DECREASE_BY: "DECREASES_BY";
|
|
28
|
+
readonly RELATIVE_OPERATOR_CHANGES_BY: "CHANGES_BY";
|
|
29
|
+
};
|
|
30
|
+
export declare const ARITHMETIC_OPERATORS: {
|
|
31
|
+
readonly ARITHMETIC_OPERATOR_DIFFERENCE: "DIFFERENCE";
|
|
32
|
+
readonly ARITHMETIC_OPERATOR_CHANGE: "CHANGE";
|
|
33
|
+
};
|
|
34
|
+
export declare const COMPARISON_OPERATOR_OPTIONS: OperatorItemType[];
|
|
35
|
+
export declare const RELATIVE_CHANGE_OPERATOR_OPTIONS: OperatorItemType<any>[];
|
|
36
|
+
export declare const RELATIVE_DIFFERENCE_OPERATOR_OPTIONS: OperatorItemType<any>[];
|
|
37
|
+
export declare const OPERATORS: OperatorItemType<any>[];
|
|
38
|
+
export declare const CHANGE_HEADER: OperatorItemType<string>;
|
|
39
|
+
export declare const DIFFERENCE_HEADER: OperatorItemType<string>;
|
|
40
|
+
export declare const SEPARATOR: OperatorItemType<string>;
|
|
18
41
|
export declare const DROPDOWN_ITEM_HEIGHT = 28;
|
|
19
42
|
export declare const DROPDOWN_SEPARATOR_ITEM_HEIGHT = 10;
|
|
43
|
+
export {};
|
|
20
44
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,KAAK,gBAAgB,CAAC,CAAC,GAAG,wBAAwB,IAAI;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,6BAA6B,cAAc,CAAC;AACzD,eAAO,MAAM,yCAAyC,0BAA0B,CAAC;AACjF,eAAO,MAAM,gCAAgC,iBAAiB,CAAC;AAC/D,eAAO,MAAM,4CAA4C,6BAA6B,CAAC;AAEvF,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,4BAA4B,eAAe,CAAC;AAEzD,eAAO,MAAM,8BAA8B,eAAe,CAAC;AAC3D,eAAO,MAAM,0BAA0B,WAAW,CAAC;AAEnD,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC;AAEX,eAAO,MAAM,2BAA2B,EAAE,gBAAgB,EAqBzD,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAgBnE,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAgBvE,CAAC;AAEF,eAAO,MAAM,SAAS,yBAIrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,MAAM,CAMlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,MAAM,CAMtD,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAK9C,CAAC;AAEF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,8BAA8B,KAAK,CAAC"}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { messages } from "./messages.js";
|
|
2
|
-
export const LOADING_MASK_HEIGHT = 100;
|
|
3
2
|
export const COMPARISON_OPERATOR_LESS_THAN = "LESS_THAN";
|
|
4
3
|
export const COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO = "LESS_THAN_OR_EQUAL_TO";
|
|
5
4
|
export const COMPARISON_OPERATOR_GREATER_THAN = "GREATER_THAN";
|
|
6
5
|
export const COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO = "GREATER_THAN_OR_EQUAL_TO";
|
|
6
|
+
export const RELATIVE_OPERATOR_INCREASE_BY = "INCREASES_BY";
|
|
7
|
+
export const RELATIVE_OPERATOR_DECREASE_BY = "DECREASES_BY";
|
|
8
|
+
export const RELATIVE_OPERATOR_CHANGES_BY = "CHANGES_BY";
|
|
9
|
+
export const ARITHMETIC_OPERATOR_DIFFERENCE = "DIFFERENCE";
|
|
10
|
+
export const ARITHMETIC_OPERATOR_CHANGE = "CHANGE";
|
|
7
11
|
export const COMPARISON_OPERATORS = {
|
|
8
12
|
COMPARISON_OPERATOR_LESS_THAN,
|
|
9
13
|
COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO,
|
|
10
14
|
COMPARISON_OPERATOR_GREATER_THAN,
|
|
11
15
|
COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO,
|
|
12
16
|
};
|
|
17
|
+
export const RELATIVE_OPERATORS = {
|
|
18
|
+
RELATIVE_OPERATOR_INCREASE_BY,
|
|
19
|
+
RELATIVE_OPERATOR_DECREASE_BY,
|
|
20
|
+
RELATIVE_OPERATOR_CHANGES_BY,
|
|
21
|
+
};
|
|
22
|
+
export const ARITHMETIC_OPERATORS = {
|
|
23
|
+
ARITHMETIC_OPERATOR_DIFFERENCE,
|
|
24
|
+
ARITHMETIC_OPERATOR_CHANGE,
|
|
25
|
+
};
|
|
13
26
|
export const COMPARISON_OPERATOR_OPTIONS = [
|
|
14
27
|
{
|
|
15
28
|
title: messages.comparisonOperatorGreaterThan.id,
|
|
@@ -32,6 +45,65 @@ export const COMPARISON_OPERATOR_OPTIONS = [
|
|
|
32
45
|
id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO,
|
|
33
46
|
},
|
|
34
47
|
];
|
|
48
|
+
export const RELATIVE_CHANGE_OPERATOR_OPTIONS = [
|
|
49
|
+
{
|
|
50
|
+
title: messages.comparisonOperatorChangeIncreasesBy.id,
|
|
51
|
+
icon: "gd-icon-increases-by",
|
|
52
|
+
id: `${ARITHMETIC_OPERATORS.ARITHMETIC_OPERATOR_CHANGE}.${RELATIVE_OPERATORS.RELATIVE_OPERATOR_INCREASE_BY}`,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: messages.comparisonOperatorChangeDecreasesBy.id,
|
|
56
|
+
icon: "gd-icon-decreases-by",
|
|
57
|
+
id: `${ARITHMETIC_OPERATORS.ARITHMETIC_OPERATOR_CHANGE}.${RELATIVE_OPERATORS.RELATIVE_OPERATOR_DECREASE_BY}`,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: messages.comparisonOperatorChangeChangesBy.id,
|
|
61
|
+
icon: "gd-icon-changes-by",
|
|
62
|
+
id: `${ARITHMETIC_OPERATORS.ARITHMETIC_OPERATOR_CHANGE}.${RELATIVE_OPERATORS.RELATIVE_OPERATOR_CHANGES_BY}`,
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
export const RELATIVE_DIFFERENCE_OPERATOR_OPTIONS = [
|
|
66
|
+
{
|
|
67
|
+
title: messages.comparisonOperatorDifferenceIncreasesBy.id,
|
|
68
|
+
icon: "gd-icon-increases-by",
|
|
69
|
+
id: `${ARITHMETIC_OPERATORS.ARITHMETIC_OPERATOR_DIFFERENCE}.${RELATIVE_OPERATORS.RELATIVE_OPERATOR_INCREASE_BY}`,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: messages.comparisonOperatorDifferenceDecreasesBy.id,
|
|
73
|
+
icon: "gd-icon-decreases-by",
|
|
74
|
+
id: `${ARITHMETIC_OPERATORS.ARITHMETIC_OPERATOR_DIFFERENCE}.${RELATIVE_OPERATORS.RELATIVE_OPERATOR_DECREASE_BY}`,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: messages.comparisonOperatorDifferenceChangesBy.id,
|
|
78
|
+
icon: "gd-icon-changes-by",
|
|
79
|
+
id: `${ARITHMETIC_OPERATORS.ARITHMETIC_OPERATOR_DIFFERENCE}.${RELATIVE_OPERATORS.RELATIVE_OPERATOR_CHANGES_BY}`,
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
export const OPERATORS = [
|
|
83
|
+
...COMPARISON_OPERATOR_OPTIONS,
|
|
84
|
+
...RELATIVE_CHANGE_OPERATOR_OPTIONS,
|
|
85
|
+
...RELATIVE_DIFFERENCE_OPERATOR_OPTIONS,
|
|
86
|
+
];
|
|
87
|
+
export const CHANGE_HEADER = {
|
|
88
|
+
title: messages.comparisonOperatorChangeHeader.id,
|
|
89
|
+
type: "header",
|
|
90
|
+
icon: "",
|
|
91
|
+
id: "",
|
|
92
|
+
info: messages.comparisonOperatorChangeHeaderInfo.id,
|
|
93
|
+
};
|
|
94
|
+
export const DIFFERENCE_HEADER = {
|
|
95
|
+
title: messages.comparisonOperatorDifferenceHeader.id,
|
|
96
|
+
type: "header",
|
|
97
|
+
icon: "",
|
|
98
|
+
id: "",
|
|
99
|
+
info: messages.comparisonOperatorDifferenceHeaderInfo.id,
|
|
100
|
+
};
|
|
101
|
+
export const SEPARATOR = {
|
|
102
|
+
type: "separator",
|
|
103
|
+
title: "",
|
|
104
|
+
icon: "",
|
|
105
|
+
id: "",
|
|
106
|
+
};
|
|
35
107
|
export const DROPDOWN_ITEM_HEIGHT = 28;
|
|
36
108
|
export const DROPDOWN_SEPARATOR_ITEM_HEIGHT = 10;
|
|
37
109
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/constants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAUzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,WAAW,CAAC;AACzD,MAAM,CAAC,MAAM,yCAAyC,GAAG,uBAAuB,CAAC;AACjF,MAAM,CAAC,MAAM,gCAAgC,GAAG,cAAc,CAAC;AAC/D,MAAM,CAAC,MAAM,4CAA4C,GAAG,0BAA0B,CAAC;AAEvF,MAAM,CAAC,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAC5D,MAAM,CAAC,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAC5D,MAAM,CAAC,MAAM,4BAA4B,GAAG,YAAY,CAAC;AAEzD,MAAM,CAAC,MAAM,8BAA8B,GAAG,YAAY,CAAC;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,QAAQ,CAAC;AAEnD,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,6BAA6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,CAAC,sCAAsC,CAAC,EAAE;CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAA6B;IAC/C,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,EAAE,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useAlertValidation.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// (C) 2024 GoodData Corporation
|
|
2
2
|
import { selectInsightByWidgetRef, selectWidgetByRef, useDashboardSelector, } from "../../../../../../model/index.js";
|
|
3
|
-
import { getSupportedInsightMeasuresByInsight } from "../utils.js";
|
|
3
|
+
import { getAlertMeasure, getSupportedInsightMeasuresByInsight } from "../utils.js";
|
|
4
4
|
export const useAlertValidation = (alert, isNewAlert) => {
|
|
5
5
|
const widgetLocalId = alert.metadata?.widget;
|
|
6
6
|
const widgetRef = widgetLocalId ? { identifier: widgetLocalId } : undefined;
|
|
7
|
-
const selectedMeasure = alert.alert
|
|
7
|
+
const selectedMeasure = getAlertMeasure(alert.alert);
|
|
8
8
|
const widget = useDashboardSelector(selectWidgetByRef(widgetRef));
|
|
9
9
|
const insight = useDashboardSelector(selectInsightByWidgetRef(widget?.ref));
|
|
10
10
|
const supportedMeasures = getSupportedInsightMeasuresByInsight(insight);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAlertValidation.js","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useAlertValidation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EACH,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,oCAAoC,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useAlertValidation.js","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useAlertValidation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EACH,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,oCAAoC,EAAE,MAAM,aAAa,CAAC;AAKpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAC9B,KAAgC,EAChC,UAAoB,EACqD,EAAE;IAC3E,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC7C,MAAM,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5E,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,oBAAoB,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5E,MAAM,iBAAiB,GAAG,oCAAoC,CAAC,OAAO,CAAC,CAAC;IAExE,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,IAAI,CAChD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,KAAK,eAAe,CAC3E,CAAC;IAEF,MAAM,OAAO,GAAG,UAAU,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,qBAAqB,CAAC,CAAC;IAElE,IAAI,gBAAgB,GAAsC,SAAS,CAAC;IACpE,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,gBAAgB,GAAG,eAAe,CAAC;IACvC,CAAC;SAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAChC,gBAAgB,GAAG,eAAe,CAAC;IACvC,CAAC;IAED,OAAO;QACH,OAAO;QACP,gBAAgB;KACnB,CAAC;AACN,CAAC,CAAC"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAlertComparisonOperator, IAutomationMetadataObject, IAutomationMetadataObjectDefinition } from "@gooddata/sdk-model";
|
|
1
|
+
import { IAlertComparisonOperator, IAlertRelativeArithmeticOperator, IAlertRelativeOperator, IAutomationMetadataObject, IAutomationMetadataObjectDefinition } from "@gooddata/sdk-model";
|
|
2
2
|
import { AlertMetric } from "../../../types.js";
|
|
3
3
|
export interface IUseEditAlertProps {
|
|
4
4
|
alert: IAutomationMetadataObject;
|
|
@@ -10,6 +10,7 @@ export declare const useEditAlert: ({ alert, onCreate, onUpdate }: IUseEditAlert
|
|
|
10
10
|
updatedAlert: IAutomationMetadataObject;
|
|
11
11
|
canSubmit: boolean;
|
|
12
12
|
changeComparisonOperator: (comparisonOperator: IAlertComparisonOperator) => void;
|
|
13
|
+
changeRelativeOperator: (relativeOperator: IAlertRelativeOperator, arithmeticOperator: IAlertRelativeArithmeticOperator) => void;
|
|
13
14
|
changeMeasure: (measure: AlertMetric) => void;
|
|
14
15
|
changeValue: (value: number) => void;
|
|
15
16
|
changeDestination: (destinationId: string) => void;
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditAlert.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,mCAAmC,EACtC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditAlert.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,wBAAwB,EACxB,gCAAgC,EAChC,sBAAsB,EACtB,yBAAyB,EACzB,mCAAmC,EACtC,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,yBAAyB,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACzD;AAED,eAAO,MAAM,YAAY,kCAAmC,kBAAkB;;;;mDAQpB,wBAAwB;+CAKxD,sBAAsB,sBACpB,gCAAgC;6BAVxB,WAAW;yBAiBf,MAAM;uCAIQ,MAAM;;oCAQT,yBAAyB;;;;CAuCnE,CAAC"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js
CHANGED
|
@@ -1,56 +1,24 @@
|
|
|
1
1
|
// (C) 2022-2024 GoodData Corporation
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import isEqual from "lodash/isEqual.js";
|
|
4
|
-
import {
|
|
4
|
+
import { isAlertValueDefined, transformAlertByComparisonOperator, transformAlertByDestination, transformAlertByMetric, transformAlertByRelativeOperator, transformAlertByValue, } from "../utils.js";
|
|
5
5
|
export const useEditAlert = ({ alert, onCreate, onUpdate }) => {
|
|
6
6
|
const [viewMode, setViewMode] = useState("edit");
|
|
7
7
|
const [updatedAlert, setUpdatedAlert] = useState(alert);
|
|
8
8
|
const changeMeasure = (measure) => {
|
|
9
|
-
setUpdatedAlert((alert) => (
|
|
10
|
-
...alert,
|
|
11
|
-
title: getMeasureTitle(measure.measure) ?? "",
|
|
12
|
-
alert: {
|
|
13
|
-
...alert.alert,
|
|
14
|
-
condition: {
|
|
15
|
-
...alert.alert.condition,
|
|
16
|
-
left: measure.measure.measure.localIdentifier,
|
|
17
|
-
},
|
|
18
|
-
execution: {
|
|
19
|
-
...alert.alert.execution,
|
|
20
|
-
measures: [measure.measure],
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
}));
|
|
9
|
+
setUpdatedAlert((alert) => transformAlertByMetric(alert, measure));
|
|
24
10
|
};
|
|
25
11
|
const changeComparisonOperator = (comparisonOperator) => {
|
|
26
|
-
setUpdatedAlert((alert) => (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
condition: {
|
|
31
|
-
...alert.alert.condition,
|
|
32
|
-
operator: comparisonOperator,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
}));
|
|
12
|
+
setUpdatedAlert((alert) => transformAlertByComparisonOperator(alert, comparisonOperator));
|
|
13
|
+
};
|
|
14
|
+
const changeRelativeOperator = (relativeOperator, arithmeticOperator) => {
|
|
15
|
+
setUpdatedAlert((alert) => transformAlertByRelativeOperator(alert, relativeOperator, arithmeticOperator));
|
|
36
16
|
};
|
|
37
17
|
const changeValue = (value) => {
|
|
38
|
-
setUpdatedAlert((alert) => (
|
|
39
|
-
...alert,
|
|
40
|
-
alert: {
|
|
41
|
-
...alert.alert,
|
|
42
|
-
condition: {
|
|
43
|
-
...alert.alert.condition,
|
|
44
|
-
right: value,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
}));
|
|
18
|
+
setUpdatedAlert((alert) => transformAlertByValue(alert, value));
|
|
48
19
|
};
|
|
49
20
|
const changeDestination = (destinationId) => {
|
|
50
|
-
setUpdatedAlert((alert) => (
|
|
51
|
-
...alert,
|
|
52
|
-
notificationChannel: destinationId,
|
|
53
|
-
}));
|
|
21
|
+
setUpdatedAlert((alert) => transformAlertByDestination(alert, destinationId));
|
|
54
22
|
};
|
|
55
23
|
const configureAlert = () => {
|
|
56
24
|
setViewMode("configuration");
|
|
@@ -68,7 +36,7 @@ export const useEditAlert = ({ alert, onCreate, onUpdate }) => {
|
|
|
68
36
|
const updateAlert = () => {
|
|
69
37
|
onUpdate?.(updatedAlert);
|
|
70
38
|
};
|
|
71
|
-
const isValueDefined =
|
|
39
|
+
const isValueDefined = isAlertValueDefined(updatedAlert.alert);
|
|
72
40
|
const isAlertChanged = !isEqual(updatedAlert, alert);
|
|
73
41
|
const canSubmit = isValueDefined && isAlertChanged;
|
|
74
42
|
return {
|
|
@@ -77,6 +45,7 @@ export const useEditAlert = ({ alert, onCreate, onUpdate }) => {
|
|
|
77
45
|
canSubmit,
|
|
78
46
|
//
|
|
79
47
|
changeComparisonOperator,
|
|
48
|
+
changeRelativeOperator,
|
|
80
49
|
changeMeasure,
|
|
81
50
|
changeValue,
|
|
82
51
|
changeDestination,
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditAlert.js","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditAlert.js","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQjC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EACH,mBAAmB,EACnB,kCAAkC,EAClC,2BAA2B,EAC3B,sBAAsB,EACtB,gCAAgC,EAChC,qBAAqB,GACxB,MAAM,aAAa,CAAC;AASrB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAsB,EAAE,EAAE;IAC9E,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAA2B,MAAM,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QAClC,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,QAAQ,EAAE,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,QAAQ,EAAE,CAAC,YAAyC,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,cAAc,IAAI,cAAc,CAAC;IAEnD,OAAO;QACH,QAAQ;QACR,YAAY;QACZ,SAAS;QACT,EAAE;QACF,wBAAwB;QACxB,sBAAsB;QACtB,aAAa;QACb,WAAW;QACX,iBAAiB;QACjB,EAAE;QACF,cAAc;QACd,sBAAsB;QACtB,wBAAwB;QACxB,EAAE;QACF,WAAW;QACX,WAAW;KACd,CAAC;AACN,CAAC,CAAC"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AlertMetric } from "../../../types.js";
|
|
2
|
+
export declare function useOperators(measure: AlertMetric | undefined): {
|
|
3
|
+
title: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
id: any;
|
|
6
|
+
type?: import("@gooddata/sdk-ui-kit").SingleSelectListItemType | undefined;
|
|
7
|
+
info?: string | undefined;
|
|
8
|
+
}[];
|
|
9
|
+
//# sourceMappingURL=useOperators.d.ts.map
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOperators.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAA6B,MAAM,mBAAmB,CAAC;AAU3E,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS;;;;;;IAqB5D"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// (C) 2024 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { AlertMetricComparatorType } from "../../../types.js";
|
|
4
|
+
import { COMPARISON_OPERATOR_OPTIONS, RELATIVE_CHANGE_OPERATOR_OPTIONS, RELATIVE_DIFFERENCE_OPERATOR_OPTIONS, CHANGE_HEADER, DIFFERENCE_HEADER, SEPARATOR, } from "../constants.js";
|
|
5
|
+
export function useOperators(measure) {
|
|
6
|
+
return useMemo(() => {
|
|
7
|
+
if (measure?.comparators.find((a) => a.comparator === AlertMetricComparatorType.PreviousPeriod ||
|
|
8
|
+
a.comparator === AlertMetricComparatorType.SamePeriodPreviousYear)) {
|
|
9
|
+
return [
|
|
10
|
+
...COMPARISON_OPERATOR_OPTIONS,
|
|
11
|
+
SEPARATOR,
|
|
12
|
+
CHANGE_HEADER,
|
|
13
|
+
...RELATIVE_CHANGE_OPERATOR_OPTIONS,
|
|
14
|
+
SEPARATOR,
|
|
15
|
+
DIFFERENCE_HEADER,
|
|
16
|
+
...RELATIVE_DIFFERENCE_OPERATOR_OPTIONS,
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
return COMPARISON_OPERATOR_OPTIONS;
|
|
20
|
+
}, [measure]);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=useOperators.js.map
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOperators.js","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useOperators.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAe,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACH,2BAA2B,EAC3B,gCAAgC,EAChC,oCAAoC,EACpC,aAAa,EACb,iBAAiB,EACjB,SAAS,GACZ,MAAM,iBAAiB,CAAC;AAEzB,MAAM,UAAU,YAAY,CAAC,OAAgC;IACzD,OAAO,OAAO,CAAC,GAAG,EAAE;QAChB,IACI,OAAO,EAAE,WAAW,CAAC,IAAI,CACrB,CAAC,CAAC,EAAE,EAAE,CACF,CAAC,CAAC,UAAU,KAAK,yBAAyB,CAAC,cAAc;YACzD,CAAC,CAAC,UAAU,KAAK,yBAAyB,CAAC,sBAAsB,CACxE,EACH,CAAC;YACC,OAAO;gBACH,GAAG,2BAA2B;gBAC9B,SAAS;gBACT,aAAa;gBACb,GAAG,gCAAgC;gBACnC,SAAS;gBACT,iBAAiB;gBACjB,GAAG,oCAAoC;aAC1C,CAAC;QACN,CAAC;QACD,OAAO,2BAA2B,CAAC;IACvC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -23,6 +23,36 @@ export declare const messages: {
|
|
|
23
23
|
comparisonOperatorGreaterThanOrEquals: {
|
|
24
24
|
id: string;
|
|
25
25
|
};
|
|
26
|
+
comparisonOperatorChangeHeader: {
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
comparisonOperatorChangeHeaderInfo: {
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
comparisonOperatorChangeIncreasesBy: {
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
comparisonOperatorChangeDecreasesBy: {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
comparisonOperatorChangeChangesBy: {
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
41
|
+
comparisonOperatorDifferenceHeader: {
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
comparisonOperatorDifferenceHeaderInfo: {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
comparisonOperatorDifferenceIncreasesBy: {
|
|
48
|
+
id: string;
|
|
49
|
+
};
|
|
50
|
+
comparisonOperatorDifferenceDecreasesBy: {
|
|
51
|
+
id: string;
|
|
52
|
+
};
|
|
53
|
+
comparisonOperatorDifferenceChangesBy: {
|
|
54
|
+
id: string;
|
|
55
|
+
};
|
|
26
56
|
alertTriggerModeAlways: {
|
|
27
57
|
id: string;
|
|
28
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/messages.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/messages.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFnB,CAAC"}
|
|
@@ -25,6 +25,36 @@ export const messages = defineMessages({
|
|
|
25
25
|
comparisonOperatorGreaterThanOrEquals: {
|
|
26
26
|
id: "insightAlert.config.comparisonOperator.greaterThanOrEquals",
|
|
27
27
|
},
|
|
28
|
+
comparisonOperatorChangeHeader: {
|
|
29
|
+
id: "insightAlert.config.changeOperator.header",
|
|
30
|
+
},
|
|
31
|
+
comparisonOperatorChangeHeaderInfo: {
|
|
32
|
+
id: "insightAlert.config.changeOperator.header.info",
|
|
33
|
+
},
|
|
34
|
+
comparisonOperatorChangeIncreasesBy: {
|
|
35
|
+
id: "insightAlert.config.changeOperator.increasesBy",
|
|
36
|
+
},
|
|
37
|
+
comparisonOperatorChangeDecreasesBy: {
|
|
38
|
+
id: "insightAlert.config.changeOperator.decreasesBy",
|
|
39
|
+
},
|
|
40
|
+
comparisonOperatorChangeChangesBy: {
|
|
41
|
+
id: "insightAlert.config.changeOperator.changesBy",
|
|
42
|
+
},
|
|
43
|
+
comparisonOperatorDifferenceHeader: {
|
|
44
|
+
id: "insightAlert.config.differenceOperator.header",
|
|
45
|
+
},
|
|
46
|
+
comparisonOperatorDifferenceHeaderInfo: {
|
|
47
|
+
id: "insightAlert.config.differenceOperator.header.info",
|
|
48
|
+
},
|
|
49
|
+
comparisonOperatorDifferenceIncreasesBy: {
|
|
50
|
+
id: "insightAlert.config.differenceOperator.increasesBy",
|
|
51
|
+
},
|
|
52
|
+
comparisonOperatorDifferenceDecreasesBy: {
|
|
53
|
+
id: "insightAlert.config.differenceOperator.decreasesBy",
|
|
54
|
+
},
|
|
55
|
+
comparisonOperatorDifferenceChangesBy: {
|
|
56
|
+
id: "insightAlert.config.differenceOperator.changesBy",
|
|
57
|
+
},
|
|
28
58
|
alertTriggerModeAlways: {
|
|
29
59
|
id: "insightAlert.config.triggerMode.always",
|
|
30
60
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/messages.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;IACnC,eAAe,EAAE;QACb,EAAE,EAAE,iCAAiC;KACxC;IACD,gBAAgB,EAAE;QACd,EAAE,EAAE,kCAAkC;KACzC;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,0BAA0B,EAAE;QACxB,EAAE,EAAE,iDAAiD;KACxD;IACD,kCAAkC,EAAE;QAChC,EAAE,EAAE,yDAAyD;KAChE;IACD,6BAA6B,EAAE;QAC3B,EAAE,EAAE,oDAAoD;KAC3D;IACD,qCAAqC,EAAE;QACnC,EAAE,EAAE,4DAA4D;KACnE;IACD,sBAAsB,EAAE;QACpB,EAAE,EAAE,wCAAwC;KAC/C;IACD,oBAAoB,EAAE;QAClB,EAAE,EAAE,sCAAsC;KAC7C;IACD,kBAAkB,EAAE;QAChB,EAAE,EAAE,oCAAoC;KAC3C;IACD,eAAe,EAAE;QACb,EAAE,EAAE,iCAAiC;KACxC;IACD,kBAAkB,EAAE;QAChB,EAAE,EAAE,oCAAoC;KAC3C;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,kBAAkB,EAAE;QAChB,EAAE,EAAE,oCAAoC;KAC3C;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,cAAc,EAAE;QACZ,EAAE,EAAE,gCAAgC;KACvC;IACD,gBAAgB,EAAE;QACd,EAAE,EAAE,kCAAkC;KACzC;CACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/messages.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;IACnC,eAAe,EAAE;QACb,EAAE,EAAE,iCAAiC;KACxC;IACD,gBAAgB,EAAE;QACd,EAAE,EAAE,kCAAkC;KACzC;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,0BAA0B,EAAE;QACxB,EAAE,EAAE,iDAAiD;KACxD;IACD,kCAAkC,EAAE;QAChC,EAAE,EAAE,yDAAyD;KAChE;IACD,6BAA6B,EAAE;QAC3B,EAAE,EAAE,oDAAoD;KAC3D;IACD,qCAAqC,EAAE;QACnC,EAAE,EAAE,4DAA4D;KACnE;IACD,8BAA8B,EAAE;QAC5B,EAAE,EAAE,2CAA2C;KAClD;IACD,kCAAkC,EAAE;QAChC,EAAE,EAAE,gDAAgD;KACvD;IACD,mCAAmC,EAAE;QACjC,EAAE,EAAE,gDAAgD;KACvD;IACD,mCAAmC,EAAE;QACjC,EAAE,EAAE,gDAAgD;KACvD;IACD,iCAAiC,EAAE;QAC/B,EAAE,EAAE,8CAA8C;KACrD;IACD,kCAAkC,EAAE;QAChC,EAAE,EAAE,+CAA+C;KACtD;IACD,sCAAsC,EAAE;QACpC,EAAE,EAAE,oDAAoD;KAC3D;IACD,uCAAuC,EAAE;QACrC,EAAE,EAAE,oDAAoD;KAC3D;IACD,uCAAuC,EAAE;QACrC,EAAE,EAAE,oDAAoD;KAC3D;IACD,qCAAqC,EAAE;QACnC,EAAE,EAAE,kDAAkD;KACzD;IACD,sBAAsB,EAAE;QACpB,EAAE,EAAE,wCAAwC;KAC/C;IACD,oBAAoB,EAAE;QAClB,EAAE,EAAE,sCAAsC;KAC7C;IACD,kBAAkB,EAAE;QAChB,EAAE,EAAE,oCAAoC;KAC3C;IACD,eAAe,EAAE;QACb,EAAE,EAAE,iCAAiC;KACxC;IACD,kBAAkB,EAAE;QAChB,EAAE,EAAE,oCAAoC;KAC3C;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,kBAAkB,EAAE;QAChB,EAAE,EAAE,oCAAoC;KAC3C;IACD,iBAAiB,EAAE;QACf,EAAE,EAAE,mCAAmC;KAC1C;IACD,cAAc,EAAE;QACZ,EAAE,EAAE,gCAAgC;KACvC;IACD,gBAAgB,EAAE;QACd,EAAE,EAAE,kCAAkC;KACzC;CACJ,CAAC,CAAC"}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import { IAlertComparisonOperator, IAutomationMetadataObjectDefinition, IFilter, IInsight, IMeasure } from "@gooddata/sdk-model";
|
|
1
|
+
import { IAlertComparisonOperator, IAlertRelativeArithmeticOperator, IAlertRelativeOperator, IAutomationAlert, IAutomationMetadataObject, IAutomationMetadataObjectDefinition, IFilter, IInsight, IMeasure } from "@gooddata/sdk-model";
|
|
2
2
|
import { IntlShape } from "react-intl";
|
|
3
3
|
import { AlertMetric } from "../../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
7
|
export declare const getMeasureTitle: (measure: IMeasure) => string | undefined;
|
|
8
|
-
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare const getComparisonOperatorTitle: (operator: IAlertComparisonOperator, intl: IntlShape) => string;
|
|
8
|
+
export declare const getOperatorTitle: (intl: IntlShape, alert?: IAutomationAlert) => string;
|
|
12
9
|
/**
|
|
13
10
|
* @internal
|
|
14
11
|
*/
|
|
15
12
|
export declare const createDefaultAlert: (filters: IFilter[], measure: AlertMetric, notificationChannelId: string, comparisonOperator?: IAlertComparisonOperator) => IAutomationMetadataObjectDefinition;
|
|
16
13
|
export declare const getSupportedInsightMeasuresByInsight: (insight: IInsight | null | undefined) => AlertMetric[];
|
|
17
14
|
export declare const isSupportedInsightVisType: (insight: IInsight | null | undefined) => boolean;
|
|
15
|
+
export declare function getValueSuffix(alert?: IAutomationAlert): string | undefined;
|
|
16
|
+
export declare function isChangeOperator(alert?: IAutomationAlert): boolean;
|
|
17
|
+
export declare function isDifferenceOperator(alert?: IAutomationAlert): boolean;
|
|
18
|
+
export declare function isChangeOrDifferenceOperator(alert?: IAutomationAlert): boolean;
|
|
19
|
+
export declare function isAlertValueDefined(alert?: IAutomationAlert): boolean;
|
|
20
|
+
export declare function getAlertThreshold(alert?: IAutomationAlert): number | undefined;
|
|
21
|
+
export declare function getAlertMeasure(alert?: IAutomationAlert): string | undefined;
|
|
22
|
+
export declare function getAlertCompareOperator(alert?: IAutomationAlert): IAlertComparisonOperator | undefined;
|
|
23
|
+
export declare function getAlertRelativeOperator(alert?: IAutomationAlert): [IAlertRelativeOperator, IAlertRelativeArithmeticOperator] | undefined;
|
|
24
|
+
export declare function transformAlertByMetric(alert: IAutomationMetadataObject, measure: AlertMetric): IAutomationMetadataObject;
|
|
25
|
+
export declare function transformAlertByComparisonOperator(alert: IAutomationMetadataObject, comparisonOperator: IAlertComparisonOperator): IAutomationMetadataObject;
|
|
26
|
+
export declare function transformAlertByRelativeOperator(alert: IAutomationMetadataObject, relativeOperator: IAlertRelativeOperator, arithmeticOperator: IAlertRelativeArithmeticOperator): IAutomationMetadataObject;
|
|
27
|
+
export declare function transformAlertByValue(alert: IAutomationMetadataObject, value: number): IAutomationMetadataObject;
|
|
28
|
+
export declare function transformAlertByDestination(alert: IAutomationMetadataObject, notificationChannel: string): IAutomationMetadataObject;
|
|
18
29
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,wBAAwB,EACxB,mCAAmC,EAEnC,OAAO,EACP,QAAQ,EACR,QAAQ,EAWX,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,wBAAwB,EACxB,gCAAgC,EAChC,sBAAsB,EACtB,gBAAgB,EAIhB,yBAAyB,EACzB,mCAAmC,EAEnC,OAAO,EACP,QAAQ,EACR,QAAQ,EAWX,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,WAAW,EAA6B,MAAM,gBAAgB,CAAC;AAKxE;;GAEG;AACH,eAAO,MAAM,eAAe,YAAa,QAAQ,uBAEhD,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,SAAS,UAA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