@gooddata/sdk-ui-dashboard 10.9.0-alpha.1 → 10.9.0-alpha.11

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.
Files changed (141) hide show
  1. package/esm/__version.d.ts +1 -1
  2. package/esm/__version.d.ts.map +1 -1
  3. package/esm/__version.js +1 -1
  4. package/esm/__version.js.map +1 -1
  5. package/esm/model/commandHandlers/drill/crossFilteringHandler.d.ts.map +1 -1
  6. package/esm/model/commandHandlers/drill/crossFilteringHandler.js +4 -1
  7. package/esm/model/commandHandlers/drill/crossFilteringHandler.js.map +1 -1
  8. package/esm/model/commandHandlers/filterContext/attributeFilter/changeAttributeDisplayFormHandler.d.ts.map +1 -1
  9. package/esm/model/commandHandlers/filterContext/attributeFilter/changeAttributeDisplayFormHandler.js +24 -0
  10. package/esm/model/commandHandlers/filterContext/attributeFilter/changeAttributeDisplayFormHandler.js.map +1 -1
  11. package/esm/presentation/constants/index.d.ts +1 -0
  12. package/esm/presentation/constants/index.d.ts.map +1 -1
  13. package/esm/presentation/constants/index.js +2 -1
  14. package/esm/presentation/constants/index.js.map +1 -1
  15. package/esm/presentation/localization/bundles/de-DE.json +1 -0
  16. package/esm/presentation/localization/bundles/en-AU.json +475 -0
  17. package/esm/presentation/localization/bundles/en-GB.json +1 -0
  18. package/esm/presentation/localization/bundles/en-US.json +135 -0
  19. package/esm/presentation/localization/bundles/es-419.json +1 -0
  20. package/esm/presentation/localization/bundles/es-ES.json +1 -0
  21. package/esm/presentation/localization/bundles/fi-FI.json +475 -0
  22. package/esm/presentation/localization/bundles/fr-CA.json +1 -0
  23. package/esm/presentation/localization/bundles/fr-FR.json +1 -0
  24. package/esm/presentation/localization/bundles/it-IT.json +1 -0
  25. package/esm/presentation/localization/bundles/ja-JP.json +1 -0
  26. package/esm/presentation/localization/bundles/nl-NL.json +1 -0
  27. package/esm/presentation/localization/bundles/pt-BR.json +1 -0
  28. package/esm/presentation/localization/bundles/pt-PT.json +1 -0
  29. package/esm/presentation/localization/bundles/zh-Hans.json +1 -0
  30. package/esm/presentation/localization/bundles/zh-Hant.json +475 -0
  31. package/esm/presentation/localization/bundles/zh-Yue.json +475 -0
  32. package/esm/presentation/localization/translations.d.ts.map +1 -1
  33. package/esm/presentation/localization/translations.js +8 -0
  34. package/esm/presentation/localization/translations.js.map +1 -1
  35. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +1 -1
  36. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +1 -1
  37. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +1 -1
  38. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js.map +1 -1
  39. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.d.ts +12 -0
  40. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.d.ts.map +1 -0
  41. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.js +74 -0
  42. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.js.map +1 -0
  43. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts +8 -0
  44. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts.map +1 -0
  45. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js +25 -0
  46. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js.map +1 -0
  47. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.d.ts +7 -0
  48. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.d.ts.map +1 -0
  49. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.js +13 -0
  50. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.js.map +1 -0
  51. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.d.ts +9 -0
  52. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.d.ts.map +1 -0
  53. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.js +23 -0
  54. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.js.map +1 -0
  55. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.d.ts +9 -0
  56. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.d.ts.map +1 -0
  57. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.js +22 -0
  58. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.js.map +1 -0
  59. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.d.ts +8 -0
  60. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.d.ts.map +1 -0
  61. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.js +35 -0
  62. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.js.map +1 -0
  63. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.d.ts +15 -0
  64. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.d.ts.map +1 -0
  65. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.js +19 -0
  66. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.js.map +1 -0
  67. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.d.ts +12 -0
  68. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.d.ts.map +1 -0
  69. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js +16 -0
  70. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js.map +1 -0
  71. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts +15 -0
  72. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts.map +1 -0
  73. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.js +7 -0
  74. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.js.map +1 -0
  75. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts +17 -0
  76. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts.map +1 -0
  77. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js +46 -0
  78. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js.map +1 -0
  79. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.d.ts +10 -0
  80. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.d.ts.map +1 -0
  81. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.js +47 -0
  82. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.js.map +1 -0
  83. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts +23 -0
  84. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts.map +1 -0
  85. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js +36 -0
  86. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js.map +1 -0
  87. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts +48 -0
  88. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts.map +1 -0
  89. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js +50 -0
  90. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js.map +1 -0
  91. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useEditAlert.d.ts +21 -0
  92. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useEditAlert.d.ts.map +1 -0
  93. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useEditAlert.js +97 -0
  94. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useEditAlert.js.map +1 -0
  95. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useInsightAlerting.d.ts +27 -0
  96. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useInsightAlerting.d.ts.map +1 -0
  97. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useInsightAlerting.js +128 -0
  98. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/useInsightAlerting.js.map +1 -0
  99. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts +16 -0
  100. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts.map +1 -0
  101. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js +86 -0
  102. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js.map +1 -0
  103. package/esm/presentation/widget/insight/configuration/InsightAlerts.d.ts +4 -0
  104. package/esm/presentation/widget/insight/configuration/InsightAlerts.d.ts.map +1 -0
  105. package/esm/presentation/widget/insight/configuration/InsightAlerts.js +38 -0
  106. package/esm/presentation/widget/insight/configuration/InsightAlerts.js.map +1 -0
  107. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.d.ts.map +1 -1
  108. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js +1 -1
  109. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js.map +1 -1
  110. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.d.ts +1 -1
  111. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.d.ts.map +1 -1
  112. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.js +1 -1
  113. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.d.ts +1 -1
  114. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.d.ts.map +1 -1
  115. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.js +4 -3
  116. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.js.map +1 -1
  117. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.d.ts.map +1 -1
  118. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js +3 -3
  119. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js.map +1 -1
  120. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.d.ts +2 -0
  121. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.d.ts.map +1 -1
  122. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.js +28 -7
  123. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.js.map +1 -1
  124. package/esm/presentation/widget/insightMenu/index.d.ts +1 -1
  125. package/esm/presentation/widget/insightMenu/index.d.ts.map +1 -1
  126. package/esm/presentation/widget/insightMenu/types.d.ts +28 -6
  127. package/esm/presentation/widget/insightMenu/types.d.ts.map +1 -1
  128. package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js +7 -2
  129. package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js.map +1 -1
  130. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.d.ts +2 -0
  131. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.d.ts.map +1 -1
  132. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.js +13 -8
  133. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.js.map +1 -1
  134. package/esm/sdk-ui-dashboard.d.ts +30 -5
  135. package/package.json +15 -15
  136. package/styles/css/alerting.css +211 -0
  137. package/styles/css/alerting.css.map +1 -0
  138. package/styles/css/main.css +210 -0
  139. package/styles/css/main.css.map +1 -1
  140. package/styles/scss/alerting.scss +253 -0
  141. package/styles/scss/main.scss +1 -0
@@ -0,0 +1,23 @@
1
+ import { IAlertComparisonOperator } from "@gooddata/sdk-model";
2
+ export declare const COMPARISON_OPERATOR_LESS_THAN = "LESS_THAN";
3
+ export declare const COMPARISON_OPERATOR_LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS";
4
+ export declare const COMPARISON_OPERATOR_GREATER_THAN = "GREATER_THAN";
5
+ export declare const COMPARISON_OPERATOR_GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS";
6
+ export declare const COMPARISON_OPERATORS: {
7
+ readonly COMPARISON_OPERATOR_LESS_THAN: "LESS_THAN";
8
+ readonly COMPARISON_OPERATOR_LESS_THAN_OR_EQUALS: "LESS_THAN_OR_EQUALS";
9
+ readonly COMPARISON_OPERATOR_GREATER_THAN: "GREATER_THAN";
10
+ readonly COMPARISON_OPERATOR_GREATER_THAN_OR_EQUALS: "GREATER_THAN_OR_EQUALS";
11
+ };
12
+ export declare const COMPARISON_OPERATOR_OPTIONS: {
13
+ title: string;
14
+ icon: string;
15
+ id: IAlertComparisonOperator;
16
+ }[];
17
+ export declare const DROPDOWN_ITEM_HEIGHT = 28;
18
+ export declare const DROPDOWN_SEPARATOR_ITEM_HEIGHT = 10;
19
+ export interface INotificationChannel {
20
+ id: string;
21
+ title: string;
22
+ }
23
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +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;AAG/D,eAAO,MAAM,6BAA6B,cAAc,CAAC;AACzD,eAAO,MAAM,uCAAuC,wBAAwB,CAAC;AAC7E,eAAO,MAAM,gCAAgC,iBAAiB,CAAC;AAC/D,eAAO,MAAM,0CAA0C,2BAA2B,CAAC;AAEnF,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX,eAAO,MAAM,2BAA2B,EAAE;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,wBAAwB,CAAC;CAChC,EAqBA,CAAC;AAEF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAGjD,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,36 @@
1
+ import { messages } from "./messages.js";
2
+ export const COMPARISON_OPERATOR_LESS_THAN = "LESS_THAN";
3
+ export const COMPARISON_OPERATOR_LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS";
4
+ export const COMPARISON_OPERATOR_GREATER_THAN = "GREATER_THAN";
5
+ export const COMPARISON_OPERATOR_GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS";
6
+ export const COMPARISON_OPERATORS = {
7
+ COMPARISON_OPERATOR_LESS_THAN,
8
+ COMPARISON_OPERATOR_LESS_THAN_OR_EQUALS,
9
+ COMPARISON_OPERATOR_GREATER_THAN,
10
+ COMPARISON_OPERATOR_GREATER_THAN_OR_EQUALS,
11
+ };
12
+ export const COMPARISON_OPERATOR_OPTIONS = [
13
+ {
14
+ title: messages.comparisonOperatorGreaterThan.id,
15
+ icon: "gd-icon-greater-than",
16
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_GREATER_THAN,
17
+ },
18
+ {
19
+ title: messages.comparisonOperatorGreaterThanOrEquals.id,
20
+ icon: "gd-icon-greater-than-equal-to",
21
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_GREATER_THAN_OR_EQUALS,
22
+ },
23
+ {
24
+ title: messages.comparisonOperatorLessThan.id,
25
+ icon: "gd-icon-less-than",
26
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_LESS_THAN,
27
+ },
28
+ {
29
+ title: messages.comparisonOperatorLessThanOrEquals.id,
30
+ icon: "gd-icon-less-than-equal-to",
31
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_LESS_THAN_OR_EQUALS,
32
+ },
33
+ ];
34
+ export const DROPDOWN_ITEM_HEIGHT = 28;
35
+ export const DROPDOWN_SEPARATOR_ITEM_HEIGHT = 10;
36
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,WAAW,CAAC;AACzD,MAAM,CAAC,MAAM,uCAAuC,GAAG,qBAAqB,CAAC;AAC7E,MAAM,CAAC,MAAM,gCAAgC,GAAG,cAAc,CAAC;AAC/D,MAAM,CAAC,MAAM,0CAA0C,GAAG,wBAAwB,CAAC;AAEnF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,6BAA6B;IAC7B,uCAAuC;IACvC,gCAAgC;IAChC,0CAA0C;CACpC,CAAC;AAEX,MAAM,CAAC,MAAM,2BAA2B,GAIlC;IACF;QACI,KAAK,EAAE,QAAQ,CAAC,6BAA6B,CAAC,EAAE;QAChD,IAAI,EAAE,sBAAsB;QAC5B,EAAE,EAAE,oBAAoB,CAAC,gCAAgC;KAC5D;IACD;QACI,KAAK,EAAE,QAAQ,CAAC,qCAAqC,CAAC,EAAE;QACxD,IAAI,EAAE,+BAA+B;QACrC,EAAE,EAAE,oBAAoB,CAAC,0CAA0C;KACtE;IACD;QACI,KAAK,EAAE,QAAQ,CAAC,0BAA0B,CAAC,EAAE;QAC7C,IAAI,EAAE,mBAAmB;QACzB,EAAE,EAAE,oBAAoB,CAAC,6BAA6B;KACzD;IACD;QACI,KAAK,EAAE,QAAQ,CAAC,kCAAkC,CAAC,EAAE;QACrD,IAAI,EAAE,4BAA4B;QAClC,EAAE,EAAE,oBAAoB,CAAC,uCAAuC;KACnE;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC"}
@@ -0,0 +1,48 @@
1
+ export declare const messages: {
2
+ alertActionEdit: {
3
+ id: string;
4
+ };
5
+ alertActionPause: {
6
+ id: string;
7
+ };
8
+ alertActionResume: {
9
+ id: string;
10
+ };
11
+ alertActionDelete: {
12
+ id: string;
13
+ };
14
+ comparisonOperatorLessThan: {
15
+ id: string;
16
+ };
17
+ comparisonOperatorLessThanOrEquals: {
18
+ id: string;
19
+ };
20
+ comparisonOperatorGreaterThan: {
21
+ id: string;
22
+ };
23
+ comparisonOperatorGreaterThanOrEquals: {
24
+ id: string;
25
+ };
26
+ alertTriggerModeAlways: {
27
+ id: string;
28
+ };
29
+ alertTriggerModeOnce: {
30
+ id: string;
31
+ };
32
+ alertDeleteSuccess: {
33
+ id: string;
34
+ };
35
+ alertAddSuccess: {
36
+ id: string;
37
+ };
38
+ alertUpdateSuccess: {
39
+ id: string;
40
+ };
41
+ alertPauseSuccess: {
42
+ id: string;
43
+ };
44
+ alertResumeSuccess: {
45
+ id: string;
46
+ };
47
+ };
48
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/messages.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CnB,CAAC"}
@@ -0,0 +1,50 @@
1
+ // (C) 2024 GoodData Corporation
2
+ import { defineMessages } from "react-intl";
3
+ export const messages = defineMessages({
4
+ alertActionEdit: {
5
+ id: "insightAlert.config.action.edit",
6
+ },
7
+ alertActionPause: {
8
+ id: "insightAlert.config.action.pause",
9
+ },
10
+ alertActionResume: {
11
+ id: "insightAlert.config.action.resume",
12
+ },
13
+ alertActionDelete: {
14
+ id: "insightAlert.config.action.delete",
15
+ },
16
+ comparisonOperatorLessThan: {
17
+ id: "insightAlert.config.comparisonOperator.lessThan",
18
+ },
19
+ comparisonOperatorLessThanOrEquals: {
20
+ id: "insightAlert.config.comparisonOperator.lessThanOrEquals",
21
+ },
22
+ comparisonOperatorGreaterThan: {
23
+ id: "insightAlert.config.comparisonOperator.greaterThan",
24
+ },
25
+ comparisonOperatorGreaterThanOrEquals: {
26
+ id: "insightAlert.config.comparisonOperator.greaterThanOrEquals",
27
+ },
28
+ alertTriggerModeAlways: {
29
+ id: "insightAlert.config.triggerMode.always",
30
+ },
31
+ alertTriggerModeOnce: {
32
+ id: "insightAlert.config.triggerMode.once",
33
+ },
34
+ alertDeleteSuccess: {
35
+ id: "insightAlert.config.delete.success",
36
+ },
37
+ alertAddSuccess: {
38
+ id: "insightAlert.config.add.success",
39
+ },
40
+ alertUpdateSuccess: {
41
+ id: "insightAlert.config.update.success",
42
+ },
43
+ alertPauseSuccess: {
44
+ id: "insightAlert.config.pause.success",
45
+ },
46
+ alertResumeSuccess: {
47
+ id: "insightAlert.config.resume.success",
48
+ },
49
+ });
50
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +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;CACJ,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { IAlertComparisonOperator, IAutomationMetadataObject, IAutomationMetadataObjectDefinition, IMeasure } from "@gooddata/sdk-model";
2
+ export interface IUseEditAlertProps {
3
+ alert: IAutomationMetadataObject;
4
+ onCreate?: (alert: IAutomationMetadataObjectDefinition) => void;
5
+ onUpdate?: (alert: IAutomationMetadataObject) => void;
6
+ }
7
+ export declare const useEditAlert: ({ alert, onCreate, onUpdate }: IUseEditAlertProps) => {
8
+ viewMode: "configuration" | "edit";
9
+ updatedAlert: IAutomationMetadataObject;
10
+ canSubmit: boolean;
11
+ changeComparisonOperator: (comparisonOperator: IAlertComparisonOperator) => void;
12
+ changeMeasure: (measure: IMeasure) => void;
13
+ changeValue: (value: number) => void;
14
+ changeDestination: (destinationId: string) => void;
15
+ configureAlert: () => void;
16
+ saveAlertConfiguration: (alert: IAutomationMetadataObject) => void;
17
+ cancelAlertConfiguration: () => void;
18
+ createAlert: () => void;
19
+ updateAlert: () => void;
20
+ };
21
+ //# sourceMappingURL=useEditAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditAlert.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/useEditAlert.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,mCAAmC,EACnC,QAAQ,EACX,MAAM,qBAAqB,CAAC;AAK7B,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;;;;mDA0BpB,wBAAwB;6BArB9C,QAAQ;yBAqCZ,MAAM;uCAgBQ,MAAM;;oCAWT,yBAAyB;;;;CAsCnE,CAAC"}
@@ -0,0 +1,97 @@
1
+ // (C) 2022-2024 GoodData Corporation
2
+ import { useState } from "react";
3
+ import isEqual from "lodash/isEqual.js";
4
+ import { getComparisonOperatorTitle, getMeasureTitle } from "./utils.js";
5
+ import { useIntl } from "react-intl";
6
+ export const useEditAlert = ({ alert, onCreate, onUpdate }) => {
7
+ const [viewMode, setViewMode] = useState("edit");
8
+ const [updatedAlert, setUpdatedAlert] = useState(alert);
9
+ const intl = useIntl();
10
+ const changeMeasure = (measure) => {
11
+ setUpdatedAlert((alert) => ({
12
+ ...alert,
13
+ title: getMeasureTitle(measure) ?? "",
14
+ description: `${getComparisonOperatorTitle(updatedAlert.alert.condition.operator, intl)} ${alert.alert.condition.right}`,
15
+ alert: {
16
+ ...alert.alert,
17
+ condition: {
18
+ ...alert.alert.condition,
19
+ left: measure,
20
+ },
21
+ execution: {
22
+ ...alert.alert.execution,
23
+ measures: [measure],
24
+ },
25
+ },
26
+ }));
27
+ };
28
+ const changeComparisonOperator = (comparisonOperator) => {
29
+ setUpdatedAlert((alert) => ({
30
+ ...alert,
31
+ description: `${getComparisonOperatorTitle(comparisonOperator, intl)} ${updatedAlert.alert.condition.right}`,
32
+ alert: {
33
+ ...alert.alert,
34
+ condition: {
35
+ ...alert.alert.condition,
36
+ operator: comparisonOperator,
37
+ },
38
+ },
39
+ }));
40
+ };
41
+ const changeValue = (value) => {
42
+ setUpdatedAlert((alert) => ({
43
+ ...alert,
44
+ description: `${getComparisonOperatorTitle(updatedAlert.alert.condition.operator, intl)} ${alert.alert.condition.right}`,
45
+ alert: {
46
+ ...alert.alert,
47
+ condition: {
48
+ ...alert.alert.condition,
49
+ right: value,
50
+ },
51
+ },
52
+ }));
53
+ };
54
+ const changeDestination = (destinationId) => {
55
+ setUpdatedAlert((alert) => ({
56
+ ...alert,
57
+ webhook: destinationId,
58
+ }));
59
+ };
60
+ const configureAlert = () => {
61
+ setViewMode("configuration");
62
+ };
63
+ const saveAlertConfiguration = (alert) => {
64
+ setUpdatedAlert(alert);
65
+ cancelAlertConfiguration();
66
+ };
67
+ const cancelAlertConfiguration = () => {
68
+ setViewMode("edit");
69
+ };
70
+ const createAlert = () => {
71
+ onCreate?.(updatedAlert);
72
+ };
73
+ const updateAlert = () => {
74
+ onUpdate?.(updatedAlert);
75
+ };
76
+ const isValueDefined = typeof updatedAlert.alert?.condition.right !== "undefined";
77
+ const isAlertChanged = !isEqual(updatedAlert, alert);
78
+ const canSubmit = isValueDefined && isAlertChanged;
79
+ return {
80
+ viewMode,
81
+ updatedAlert,
82
+ canSubmit,
83
+ //
84
+ changeComparisonOperator,
85
+ changeMeasure,
86
+ changeValue,
87
+ changeDestination,
88
+ //
89
+ configureAlert,
90
+ saveAlertConfiguration,
91
+ cancelAlertConfiguration,
92
+ //
93
+ createAlert,
94
+ updateAlert,
95
+ };
96
+ };
97
+ //# sourceMappingURL=useEditAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditAlert.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/useEditAlert.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOjC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAQrC,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,CAAC,CAAC;IAC3E,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA4B,KAAK,CAAC,CAAC;IACnF,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,MAAM,aAAa,GAAG,CAAC,OAAiB,EAAE,EAAE;QACxC,eAAe,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxB,GAAG,KAAK;YACR,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE;YACrC,WAAW,EAAE,GAAG,0BAA0B,CAAC,YAAY,CAAC,KAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,IACpF,KA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import { INotificationChannel } from "./constants.js";
3
+ type InsightWidgetAlertingViewMode = "list" | "edit" | "create";
4
+ export interface IInsightWidgetAlertingProps {
5
+ widget: IInsightWidget;
6
+ closeInsightWidgetMenu: () => void;
7
+ }
8
+ export declare const useInsightWidgetAlerting: ({ widget, closeInsightWidgetMenu }: IInsightWidgetAlertingProps) => {
9
+ destinations: INotificationChannel[];
10
+ alerts: IAutomationMetadataObject[];
11
+ viewMode: InsightWidgetAlertingViewMode;
12
+ editingAlert: IAutomationMetadataObject | null;
13
+ creatingAlert: IAutomationMetadataObjectDefinition;
14
+ initiateAlertCreation: () => void;
15
+ initiateAlertEditing: (alert: IAutomationMetadataObject) => void;
16
+ updateExistingAlert: (alert: IAutomationMetadataObject) => void;
17
+ saveNewAlert: (alert: IAutomationMetadataObjectDefinition) => void;
18
+ pauseExistingAlert: (alert: IAutomationMetadataObject) => void;
19
+ resumeExistingAlert: (alert: IAutomationMetadataObject) => void;
20
+ deleteExistingAlert: (alert: IAutomationMetadataObject) => void;
21
+ cancelAlertEditing: () => void;
22
+ cancelAlertCreation: () => void;
23
+ hasAlerts: boolean;
24
+ supportedMeasures: import("@gooddata/sdk-model").IMeasure<import("@gooddata/sdk-model").IMeasureDefinitionType>[];
25
+ };
26
+ export {};
27
+ //# sourceMappingURL=useInsightAlerting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInsightAlerting.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/useInsightAlerting.ts"],"names":[],"mappings":"AACA,OAAO,EACH,yBAAyB,EACzB,mCAAmC,EAEnC,cAAc,EACjB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAItD,KAAK,6BAA6B,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhE,MAAM,WAAW,2BAA2B;IACxC,MAAM,EAAE,cAAc,CAAC;IACvB,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,wBAAwB,uCAAwC,2BAA2B;;;;;;;kCA8D/D,yBAAyB;iCAK1B,yBAAyB;0BAjChC,mCAAmC;gCA+C7B,yBAAyB;iCAexB,yBAAyB;iCAezB,yBAAyB;;;;;CA6BhE,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { useToastMessage } from "@gooddata/sdk-ui-kit";
2
+ import { useState } from "react";
3
+ import { v4 as uuidv4 } from "uuid";
4
+ import { useDashboardSelector, selectInsightByWidgetRef } from "../../../../../model/index.js";
5
+ import { createDefaultAlert, getSupportedInsightMeasuresByInsight } from "./utils.js";
6
+ import { messages } from "./messages.js";
7
+ export const useInsightWidgetAlerting = ({ widget, closeInsightWidgetMenu }) => {
8
+ const { addSuccess } = useToastMessage();
9
+ // TODO: load from backend
10
+ const [alerts, setAlerts] = useState([]);
11
+ const hasAlerts = alerts.length > 0;
12
+ // TODO: load from backend
13
+ const destinations = [
14
+ { id: "email", title: "Email" },
15
+ { id: "webhook", title: "Webhook" },
16
+ ];
17
+ // TODO: load from backend
18
+ const widgetFilters = [];
19
+ // const widgetFilters = useWidgetFilters(widget, insight);
20
+ const insight = useDashboardSelector(selectInsightByWidgetRef(widget.ref));
21
+ const supportedMeasures = getSupportedInsightMeasuresByInsight(insight);
22
+ const defaultMeasure = supportedMeasures[0];
23
+ const defaultNotificationChannelId = destinations[0].id;
24
+ const defaultAlert = createDefaultAlert(widgetFilters, defaultMeasure, defaultNotificationChannelId);
25
+ const [viewMode, setViewMode] = useState(alerts.length > 0 ? "list" : "create");
26
+ const [editingAlert, setEditingAlert] = useState(null);
27
+ const [creatingAlert, setCreatingAlert] = useState(defaultAlert);
28
+ const initiateAlertCreation = () => {
29
+ setCreatingAlert(defaultAlert);
30
+ setViewMode("create");
31
+ };
32
+ const saveNewAlert = (alert) => {
33
+ const id = uuidv4();
34
+ setAlerts((alertsToUpdate) => {
35
+ const updatedAlerts = [
36
+ ...alertsToUpdate,
37
+ {
38
+ ...alert,
39
+ id,
40
+ ref: { identifier: id, type: "automation" },
41
+ uri: id,
42
+ },
43
+ ];
44
+ addSuccess({ id: messages.alertAddSuccess.id });
45
+ return updatedAlerts;
46
+ });
47
+ setCreatingAlert(defaultAlert);
48
+ setViewMode("list");
49
+ };
50
+ const cancelAlertCreation = () => {
51
+ setCreatingAlert(defaultAlert);
52
+ if (hasAlerts) {
53
+ setViewMode("list");
54
+ }
55
+ else {
56
+ closeInsightWidgetMenu();
57
+ }
58
+ };
59
+ const initiateAlertEditing = (alert) => {
60
+ setEditingAlert(alert);
61
+ setViewMode("edit");
62
+ };
63
+ const updateExistingAlert = (alert) => {
64
+ setAlerts((alertsToUpdate) => {
65
+ const updatedAlerts = alertsToUpdate.map((a) => (a.id === alert.id ? alert : a));
66
+ addSuccess({ id: messages.alertUpdateSuccess.id });
67
+ return updatedAlerts;
68
+ });
69
+ cancelAlertEditing();
70
+ };
71
+ const cancelAlertEditing = () => {
72
+ setEditingAlert(null);
73
+ setViewMode("list");
74
+ };
75
+ const pauseExistingAlert = (alert) => {
76
+ setAlerts((alertsToUpdate) => {
77
+ const updatedAlerts = alertsToUpdate.map((a) => a.id === alert.id
78
+ ? {
79
+ ...a,
80
+ alert: { ...a.alert, trigger: { ...a.alert?.trigger, state: "PAUSED" } },
81
+ }
82
+ : a);
83
+ addSuccess({ id: messages.alertPauseSuccess.id });
84
+ return updatedAlerts;
85
+ });
86
+ };
87
+ const resumeExistingAlert = (alert) => {
88
+ setAlerts((alertsToUpdate) => {
89
+ const updatedAlerts = alertsToUpdate.map((a) => a.id === alert.id
90
+ ? {
91
+ ...a,
92
+ alert: { ...a.alert, trigger: { ...a.alert?.trigger, state: "ACTIVE" } },
93
+ }
94
+ : a);
95
+ addSuccess({ id: messages.alertResumeSuccess.id });
96
+ return updatedAlerts;
97
+ });
98
+ };
99
+ const deleteExistingAlert = (alert) => {
100
+ setAlerts((alertsToUpdate) => {
101
+ const updatedAlerts = alertsToUpdate.filter((a) => a.id !== alert.id);
102
+ if (updatedAlerts.length === 0) {
103
+ closeInsightWidgetMenu();
104
+ }
105
+ addSuccess({ id: messages.alertDeleteSuccess.id });
106
+ return updatedAlerts;
107
+ });
108
+ };
109
+ return {
110
+ destinations,
111
+ alerts,
112
+ viewMode,
113
+ editingAlert,
114
+ creatingAlert,
115
+ initiateAlertCreation,
116
+ initiateAlertEditing,
117
+ updateExistingAlert,
118
+ saveNewAlert,
119
+ pauseExistingAlert,
120
+ resumeExistingAlert,
121
+ deleteExistingAlert,
122
+ cancelAlertEditing,
123
+ cancelAlertCreation,
124
+ hasAlerts,
125
+ supportedMeasures,
126
+ };
127
+ };
128
+ //# sourceMappingURL=useInsightAlerting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInsightAlerting.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/useInsightAlerting.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAUzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAE,MAAM,EAAE,sBAAsB,EAA+B,EAAE,EAAE;IACxG,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC;IAEzC,0BAA0B;IAC1B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA8B,EAAE,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAEpC,0BAA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nD,OAAO,aAAa,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,CAAC,KAAgC,EAAE,EAAE;QAC7D,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE;YACzB,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC;YACtE,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,sBAAsB,EAAE,CAAC;YAC7B,CAAC;YACD,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC,CAAC;YACnD,OAAO,aAAa,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,OAAO;QACH,YAAY;QACZ,MAAM;QACN,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,qBAAqB;QACrB,oBAAoB;QACpB,mBAAmB;QACnB,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,mBAAmB;QACnB,kBAAkB;QAClB,mBAAmB;QACnB,SAAS;QACT,iBAAiB;KACpB,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { IAlertComparisonOperator, IAutomationMetadataObjectDefinition, IFilter, IInsight, IMeasure } from "@gooddata/sdk-model";
2
+ import { IntlShape } from "react-intl";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare const getMeasureTitle: (measure: IMeasure) => string | undefined;
7
+ /**
8
+ * @internal
9
+ */
10
+ export declare const getComparisonOperatorTitle: (operator: IAlertComparisonOperator, intl: IntlShape) => string;
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare const createDefaultAlert: (filters: IFilter[], measure: IMeasure, notificationChannelId: string, comparisonOperator?: IAlertComparisonOperator) => IAutomationMetadataObjectDefinition;
15
+ export declare const getSupportedInsightMeasuresByInsight: (insight: IInsight) => IMeasure<import("@gooddata/sdk-model").IMeasureDefinitionType>[];
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +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,EAIX,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,eAAe,YAAa,QAAQ,uBAEhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,aAAc,wBAAwB,QAAQ,SAAS,KAAG,MAWhG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,YAClB,OAAO,EAAE,WACT,QAAQ,yBACM,MAAM,uBACT,wBAAwB,KAC7C,mCAuBF,CAAC;AAyBF,eAAO,MAAM,oCAAoC,YAAa,QAAQ,qEAmCrE,CAAC"}
@@ -0,0 +1,86 @@
1
+ // (C) 2024 GoodData Corporation
2
+ import { bucketMeasures, insightBucket, measureAlias, measureTitle, } from "@gooddata/sdk-model";
3
+ import { COMPARISON_OPERATORS } from "./constants.js";
4
+ import { BucketNames } from "@gooddata/sdk-ui";
5
+ import { messages } from "./messages.js";
6
+ /**
7
+ * @internal
8
+ */
9
+ export const getMeasureTitle = (measure) => {
10
+ return measure ? measureTitle(measure) ?? measureAlias(measure) : undefined;
11
+ };
12
+ /**
13
+ * @internal
14
+ */
15
+ export const getComparisonOperatorTitle = (operator, intl) => {
16
+ const titleByOperator = {
17
+ [COMPARISON_OPERATORS.COMPARISON_OPERATOR_LESS_THAN]: messages.comparisonOperatorLessThan.id,
18
+ [COMPARISON_OPERATORS.COMPARISON_OPERATOR_LESS_THAN_OR_EQUALS]: messages.comparisonOperatorLessThanOrEquals.id,
19
+ [COMPARISON_OPERATORS.COMPARISON_OPERATOR_GREATER_THAN]: messages.comparisonOperatorGreaterThan.id,
20
+ [COMPARISON_OPERATORS.COMPARISON_OPERATOR_GREATER_THAN_OR_EQUALS]: messages.comparisonOperatorGreaterThanOrEquals.id,
21
+ };
22
+ return intl.formatMessage({ id: titleByOperator[operator] });
23
+ };
24
+ /**
25
+ * @internal
26
+ */
27
+ export const createDefaultAlert = (filters, measure, notificationChannelId, comparisonOperator = "GREATER_THAN") => {
28
+ return {
29
+ type: "automation",
30
+ title: getMeasureTitle(measure),
31
+ description: "",
32
+ webhook: notificationChannelId,
33
+ alert: {
34
+ condition: {
35
+ type: "comparison",
36
+ left: measure,
37
+ operator: comparisonOperator,
38
+ right: undefined,
39
+ },
40
+ execution: {
41
+ attributes: [],
42
+ measures: [measure],
43
+ filters,
44
+ },
45
+ trigger: {
46
+ state: "ACTIVE",
47
+ },
48
+ },
49
+ };
50
+ };
51
+ export const getSupportedInsightMeasuresByInsight = (insight) => {
52
+ const visualizationUrl = insight?.insight.visualizationUrl;
53
+ const insightType = visualizationUrl?.split(":")[1];
54
+ switch (insightType) {
55
+ case "headline": {
56
+ const insightMeasuresBucket = insight
57
+ ? insightBucket(insight, BucketNames.MEASURES)
58
+ : undefined;
59
+ return insightMeasuresBucket ? bucketMeasures(insightMeasuresBucket) : [];
60
+ }
61
+ case "scatter":
62
+ case "donut":
63
+ case "treemap":
64
+ case "combo2":
65
+ case "heatmap":
66
+ case "bubble":
67
+ case "bullet":
68
+ case "bar":
69
+ case "table":
70
+ case "area":
71
+ case "column":
72
+ case "line":
73
+ case "pushpin":
74
+ case "pie":
75
+ case "sankey":
76
+ case "dependencywheel":
77
+ case "funnel":
78
+ case "pyramid":
79
+ case "waterfall":
80
+ case "repeater":
81
+ default: {
82
+ return [];
83
+ }
84
+ }
85
+ };
86
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight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QACZ,KAAK,SAAS,CAAC;QACf,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ,CAAC;QACd,KAAK,iBAAiB,CAAC;QACvB,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,UAAU,CAAC;QAChB,OAAO,CAAC,CAAC,CAAC;YACN,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { IInsightMenuSubmenuComponentProps } from "../../insightMenu/types.js";
3
+ export declare const InsightAlerts: React.FC<IInsightMenuSubmenuComponentProps>;
4
+ //# sourceMappingURL=InsightAlerts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InsightAlerts.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/configuration/InsightAlerts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAS/E,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CAgFrE,CAAC"}
@@ -0,0 +1,38 @@
1
+ // (C) 2022-2024 GoodData Corporation
2
+ import React from "react";
3
+ import { isInsightWidget, objRefToString } from "@gooddata/sdk-model";
4
+ import { ScrollablePanel, OverlayControllerProvider, OverlayController } from "@gooddata/sdk-ui-kit";
5
+ import { stringUtils } from "@gooddata/util";
6
+ import cx from "classnames";
7
+ import { DASHBOARD_HEADER_OVERLAYS_Z_INDEX } from "../../../constants/index.js";
8
+ import { AlertsList } from "./InsightAlertConfig/AlertsList.js";
9
+ import { EditAlert } from "./InsightAlertConfig/EditAlert.js";
10
+ import { useInsightWidgetAlerting } from "./InsightAlertConfig/useInsightAlerting.js";
11
+ import { CreateAlert } from "./InsightAlertConfig/CreateAlert.js";
12
+ const overlayController = OverlayController.getInstance(DASHBOARD_HEADER_OVERLAYS_Z_INDEX);
13
+ export const InsightAlerts = ({ widget, onClose, onGoBack }) => {
14
+ const widgetRefSuffix = isInsightWidget(widget)
15
+ ? stringUtils.simplifyText(objRefToString(widget.ref))
16
+ : "";
17
+ const classes = cx("configuration-scrollable-panel", "s-configuration-scrollable-panel", `s-visualization-${widgetRefSuffix}`);
18
+ const { alerts, hasAlerts, destinations, viewMode, supportedMeasures,
19
+ //
20
+ creatingAlert, initiateAlertCreation, cancelAlertCreation,
21
+ //
22
+ editingAlert, initiateAlertEditing, cancelAlertEditing,
23
+ //
24
+ saveNewAlert, updateExistingAlert, pauseExistingAlert, resumeExistingAlert, deleteExistingAlert, } = useInsightWidgetAlerting({ closeInsightWidgetMenu: onClose, widget });
25
+ let content = null;
26
+ if (viewMode === "list") {
27
+ content = (React.createElement(AlertsList, { alerts: alerts, onCreateAlert: initiateAlertCreation, onEditAlert: initiateAlertEditing, onPauseAlert: pauseExistingAlert, onResumeAlert: resumeExistingAlert, onDeleteAlert: deleteExistingAlert, onClose: onClose, onGoBack: onGoBack }));
28
+ }
29
+ else if (viewMode === "edit" && editingAlert) {
30
+ content = (React.createElement(EditAlert, { alert: editingAlert, hasAlerts: hasAlerts, destinations: destinations, measures: supportedMeasures, onUpdate: updateExistingAlert, onCancel: cancelAlertEditing, onClose: onClose }));
31
+ }
32
+ else if (viewMode === "create") {
33
+ content = (React.createElement(CreateAlert, { alert: creatingAlert, measures: supportedMeasures, hasAlerts: hasAlerts, destinations: destinations, onCreate: saveNewAlert, onCancel: cancelAlertCreation, onClose: onClose }));
34
+ }
35
+ return (React.createElement(ScrollablePanel, { className: classes },
36
+ React.createElement(OverlayControllerProvider, { overlayController: overlayController }, content)));
37
+ };
38
+ //# sourceMappingURL=InsightAlerts.js.map