@gooddata/sdk-ui-dashboard 10.9.0-alpha.8 → 10.9.0-beta.0

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 (453) hide show
  1. package/NOTICE +35 -3
  2. package/esm/__version.d.ts +1 -1
  3. package/esm/__version.d.ts.map +1 -1
  4. package/esm/__version.js +1 -1
  5. package/esm/__version.js.map +1 -1
  6. package/esm/_staging/drills/drillingUtils.d.ts +2 -14
  7. package/esm/_staging/drills/drillingUtils.d.ts.map +1 -1
  8. package/esm/_staging/drills/drillingUtils.js +2 -62
  9. package/esm/_staging/drills/drillingUtils.js.map +1 -1
  10. package/esm/assets/ellipsis-hover.svg +1 -0
  11. package/esm/assets/ellipsis.svg +1 -0
  12. package/esm/assets/filter.svg +1 -0
  13. package/esm/locales.d.ts.map +1 -1
  14. package/esm/locales.js +9 -0
  15. package/esm/locales.js.map +1 -1
  16. package/esm/model/commandHandlers/alerts/createAlertHandler.d.ts.map +1 -1
  17. package/esm/model/commandHandlers/alerts/createAlertHandler.js +2 -4
  18. package/esm/model/commandHandlers/alerts/createAlertHandler.js.map +1 -1
  19. package/esm/model/commandHandlers/alerts/saveAlertHandler.d.ts +6 -0
  20. package/esm/model/commandHandlers/alerts/saveAlertHandler.d.ts.map +1 -0
  21. package/esm/model/commandHandlers/alerts/saveAlertHandler.js +15 -0
  22. package/esm/model/commandHandlers/alerts/saveAlertHandler.js.map +1 -0
  23. package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.d.ts +2 -2
  24. package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.d.ts.map +1 -1
  25. package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.js +4 -4
  26. package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.js.map +1 -1
  27. package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
  28. package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +6 -5
  29. package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js.map +1 -1
  30. package/esm/model/commandHandlers/drill/drillDownHandler.d.ts.map +1 -1
  31. package/esm/model/commandHandlers/drill/drillDownHandler.js +24 -2
  32. package/esm/model/commandHandlers/drill/drillDownHandler.js.map +1 -1
  33. package/esm/model/commandHandlers/index.d.ts.map +1 -1
  34. package/esm/model/commandHandlers/index.js +2 -4
  35. package/esm/model/commandHandlers/index.js.map +1 -1
  36. package/esm/model/commandHandlers/scheduledEmail/refreshAutomationsHandlers.js +3 -3
  37. package/esm/model/commandHandlers/scheduledEmail/refreshAutomationsHandlers.js.map +1 -1
  38. package/esm/model/commandHandlers/widgets/addDrillDownForInsightWidgetHandler.d.ts.map +1 -1
  39. package/esm/model/commandHandlers/widgets/addDrillDownForInsightWidgetHandler.js +23 -2
  40. package/esm/model/commandHandlers/widgets/addDrillDownForInsightWidgetHandler.js.map +1 -1
  41. package/esm/model/commandHandlers/widgets/common/drillDown.d.ts +6 -0
  42. package/esm/model/commandHandlers/widgets/common/drillDown.d.ts.map +1 -0
  43. package/esm/model/commandHandlers/widgets/common/drillDown.js +22 -0
  44. package/esm/model/commandHandlers/widgets/common/drillDown.js.map +1 -0
  45. package/esm/model/commandHandlers/widgets/modifyDrillDownForInsightWidgetHandler.d.ts.map +1 -1
  46. package/esm/model/commandHandlers/widgets/modifyDrillDownForInsightWidgetHandler.js +23 -2
  47. package/esm/model/commandHandlers/widgets/modifyDrillDownForInsightWidgetHandler.js.map +1 -1
  48. package/esm/model/commandHandlers/widgets/removeDrillDownForInsightWidgetHandler.d.ts.map +1 -1
  49. package/esm/model/commandHandlers/widgets/removeDrillDownForInsightWidgetHandler.js +15 -2
  50. package/esm/model/commandHandlers/widgets/removeDrillDownForInsightWidgetHandler.js.map +1 -1
  51. package/esm/model/commands/alerts.d.ts +16 -45
  52. package/esm/model/commands/alerts.d.ts.map +1 -1
  53. package/esm/model/commands/alerts.js +6 -24
  54. package/esm/model/commands/alerts.js.map +1 -1
  55. package/esm/model/commands/base.d.ts +1 -1
  56. package/esm/model/commands/base.d.ts.map +1 -1
  57. package/esm/model/commands/index.d.ts +3 -3
  58. package/esm/model/commands/index.d.ts.map +1 -1
  59. package/esm/model/commands/index.js +1 -1
  60. package/esm/model/commands/index.js.map +1 -1
  61. package/esm/model/commands/insight.d.ts +17 -3
  62. package/esm/model/commands/insight.d.ts.map +1 -1
  63. package/esm/model/commands/insight.js +7 -3
  64. package/esm/model/commands/insight.js.map +1 -1
  65. package/esm/model/events/alerts.d.ts +10 -48
  66. package/esm/model/events/alerts.d.ts.map +1 -1
  67. package/esm/model/events/alerts.js +4 -24
  68. package/esm/model/events/alerts.js.map +1 -1
  69. package/esm/model/events/base.d.ts +1 -1
  70. package/esm/model/events/base.d.ts.map +1 -1
  71. package/esm/model/events/base.js.map +1 -1
  72. package/esm/model/events/index.d.ts +3 -3
  73. package/esm/model/events/index.d.ts.map +1 -1
  74. package/esm/model/events/index.js +1 -1
  75. package/esm/model/events/index.js.map +1 -1
  76. package/esm/model/react/index.d.ts +1 -0
  77. package/esm/model/react/index.d.ts.map +1 -1
  78. package/esm/model/react/index.js +1 -0
  79. package/esm/model/react/index.js.map +1 -1
  80. package/esm/model/react/useDashboardAlerts.d.ts +33 -0
  81. package/esm/model/react/useDashboardAlerts.d.ts.map +1 -0
  82. package/esm/model/react/useDashboardAlerts.js +145 -0
  83. package/esm/model/react/useDashboardAlerts.js.map +1 -0
  84. package/esm/model/react/useDashboardCommand.d.ts +1 -2
  85. package/esm/model/react/useDashboardCommand.d.ts.map +1 -1
  86. package/esm/model/react/useDashboardCommandProcessing.d.ts +2 -6
  87. package/esm/model/react/useDashboardCommandProcessing.d.ts.map +1 -1
  88. package/esm/model/react/useDashboardScheduledEmails.d.ts +3 -5
  89. package/esm/model/react/useDashboardScheduledEmails.d.ts.map +1 -1
  90. package/esm/model/react/useDashboardScheduledEmails.js +6 -29
  91. package/esm/model/react/useDashboardScheduledEmails.js.map +1 -1
  92. package/esm/model/store/automations/automationsReducers.d.ts +3 -2
  93. package/esm/model/store/automations/automationsReducers.d.ts.map +1 -1
  94. package/esm/model/store/automations/automationsReducers.js +2 -2
  95. package/esm/model/store/automations/automationsReducers.js.map +1 -1
  96. package/esm/model/store/automations/automationsSelectors.d.ts +31 -0
  97. package/esm/model/store/automations/automationsSelectors.d.ts.map +1 -1
  98. package/esm/model/store/automations/automationsSelectors.js +46 -1
  99. package/esm/model/store/automations/automationsSelectors.js.map +1 -1
  100. package/esm/model/store/automations/automationsState.d.ts +2 -1
  101. package/esm/model/store/automations/automationsState.d.ts.map +1 -1
  102. package/esm/model/store/automations/automationsState.js +1 -1
  103. package/esm/model/store/automations/automationsState.js.map +1 -1
  104. package/esm/model/store/automations/index.d.ts +2 -2
  105. package/esm/model/store/catalog/catalogSelectors.d.ts +23 -1
  106. package/esm/model/store/catalog/catalogSelectors.d.ts.map +1 -1
  107. package/esm/model/store/catalog/catalogSelectors.js +9 -3
  108. package/esm/model/store/catalog/catalogSelectors.js.map +1 -1
  109. package/esm/model/store/config/configSelectors.d.ts +10 -0
  110. package/esm/model/store/config/configSelectors.d.ts.map +1 -1
  111. package/esm/model/store/config/configSelectors.js +14 -0
  112. package/esm/model/store/config/configSelectors.js.map +1 -1
  113. package/esm/model/store/index.d.ts +4 -4
  114. package/esm/model/store/index.d.ts.map +1 -1
  115. package/esm/model/store/index.js +3 -3
  116. package/esm/model/store/index.js.map +1 -1
  117. package/esm/model/store/layout/index.d.ts +4 -0
  118. package/esm/model/store/layout/index.d.ts.map +1 -1
  119. package/esm/model/store/layout/layoutReducers.d.ts +6 -1
  120. package/esm/model/store/layout/layoutReducers.d.ts.map +1 -1
  121. package/esm/model/store/layout/layoutReducers.js +10 -0
  122. package/esm/model/store/layout/layoutReducers.js.map +1 -1
  123. package/esm/model/store/ui/index.d.ts +17 -0
  124. package/esm/model/store/ui/index.d.ts.map +1 -1
  125. package/esm/model/store/ui/uiReducers.d.ts +18 -1
  126. package/esm/model/store/ui/uiReducers.d.ts.map +1 -1
  127. package/esm/model/store/ui/uiReducers.js +23 -0
  128. package/esm/model/store/ui/uiReducers.js.map +1 -1
  129. package/esm/model/store/ui/uiSelectors.d.ts +17 -0
  130. package/esm/model/store/ui/uiSelectors.d.ts.map +1 -1
  131. package/esm/model/store/ui/uiSelectors.js +16 -0
  132. package/esm/model/store/ui/uiSelectors.js.map +1 -1
  133. package/esm/model/store/ui/uiState.d.ts +14 -0
  134. package/esm/model/store/ui/uiState.d.ts.map +1 -1
  135. package/esm/model/store/ui/uiState.js +10 -0
  136. package/esm/model/store/ui/uiState.js.map +1 -1
  137. package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts.map +1 -1
  138. package/esm/model/store/widgetDrills/widgetDrillSelectors.js +14 -11
  139. package/esm/model/store/widgetDrills/widgetDrillSelectors.js.map +1 -1
  140. package/esm/model/types/commonTypes.d.ts +2 -2
  141. package/esm/model/types/commonTypes.d.ts.map +1 -1
  142. package/esm/presentation/alerting/AlertingDialog.d.ts +7 -0
  143. package/esm/presentation/alerting/AlertingDialog.d.ts.map +1 -0
  144. package/esm/presentation/alerting/AlertingDialog.js +11 -0
  145. package/esm/presentation/alerting/AlertingDialog.js.map +1 -0
  146. package/esm/presentation/alerting/AlertingManagementDialog.d.ts +7 -0
  147. package/esm/presentation/alerting/AlertingManagementDialog.d.ts.map +1 -0
  148. package/esm/presentation/alerting/AlertingManagementDialog.js +11 -0
  149. package/esm/presentation/alerting/AlertingManagementDialog.js.map +1 -0
  150. package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts +7 -0
  151. package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -0
  152. package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +37 -0
  153. package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js.map +1 -0
  154. package/esm/presentation/alerting/DefaultAlertingDialog/index.d.ts +2 -0
  155. package/esm/presentation/alerting/DefaultAlertingDialog/index.d.ts.map +1 -0
  156. package/esm/presentation/alerting/DefaultAlertingDialog/index.js +3 -0
  157. package/esm/presentation/alerting/DefaultAlertingDialog/index.js.map +1 -0
  158. package/esm/presentation/alerting/DefaultAlertingDialog/operator.d.ts +4 -0
  159. package/esm/presentation/alerting/DefaultAlertingDialog/operator.d.ts.map +1 -0
  160. package/esm/presentation/alerting/DefaultAlertingDialog/operator.js +31 -0
  161. package/esm/presentation/alerting/DefaultAlertingDialog/operator.js.map +1 -0
  162. package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.d.ts +2 -0
  163. package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.d.ts.map +1 -0
  164. package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.js +5 -0
  165. package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.js.map +1 -0
  166. package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.d.ts +7 -0
  167. package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.d.ts.map +1 -0
  168. package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.js +59 -0
  169. package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.js.map +1 -0
  170. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.d.ts +12 -0
  171. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.d.ts.map +1 -0
  172. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.js +80 -0
  173. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.js.map +1 -0
  174. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.d.ts +4 -0
  175. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.d.ts.map +1 -0
  176. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.js +51 -0
  177. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.js.map +1 -0
  178. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.d.ts +14 -0
  179. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.d.ts.map +1 -0
  180. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.js +21 -0
  181. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.js.map +1 -0
  182. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.d.ts +12 -0
  183. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.d.ts.map +1 -0
  184. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.js +29 -0
  185. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.js.map +1 -0
  186. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.d.ts +12 -0
  187. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.d.ts.map +1 -0
  188. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.js +43 -0
  189. package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.js.map +1 -0
  190. package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.d.ts +2 -0
  191. package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.d.ts.map +1 -0
  192. package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.js +3 -0
  193. package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.js.map +1 -0
  194. package/esm/presentation/alerting/index.d.ts +6 -0
  195. package/esm/presentation/alerting/index.d.ts.map +1 -0
  196. package/esm/presentation/alerting/index.js +6 -0
  197. package/esm/presentation/alerting/index.js.map +1 -0
  198. package/esm/presentation/alerting/types.d.ts +107 -0
  199. package/esm/presentation/alerting/types.d.ts.map +1 -0
  200. package/esm/presentation/alerting/types.js +2 -0
  201. package/esm/presentation/alerting/types.js.map +1 -0
  202. package/esm/presentation/constants/index.d.ts +1 -0
  203. package/esm/presentation/constants/index.d.ts.map +1 -1
  204. package/esm/presentation/constants/index.js +2 -1
  205. package/esm/presentation/constants/index.js.map +1 -1
  206. package/esm/presentation/constants/zIndex.d.ts +1 -0
  207. package/esm/presentation/constants/zIndex.d.ts.map +1 -1
  208. package/esm/presentation/constants/zIndex.js +3 -1
  209. package/esm/presentation/constants/zIndex.js.map +1 -1
  210. package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.d.ts +3 -0
  211. package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.d.ts.map +1 -0
  212. package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.js +11 -0
  213. package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.js.map +1 -0
  214. package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.d.ts.map +1 -1
  215. package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.js +3 -1
  216. package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.js.map +1 -1
  217. package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.d.ts.map +1 -1
  218. package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.js +2 -5
  219. package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.js.map +1 -1
  220. package/esm/presentation/dashboard/components/DashboardRenderer.d.ts.map +1 -1
  221. package/esm/presentation/dashboard/components/DashboardRenderer.js +3 -1
  222. package/esm/presentation/dashboard/components/DashboardRenderer.js.map +1 -1
  223. package/esm/presentation/dashboard/types.d.ts +13 -0
  224. package/esm/presentation/dashboard/types.d.ts.map +1 -1
  225. package/esm/presentation/dashboardContexts/DashboardComponentsContext.d.ts +3 -0
  226. package/esm/presentation/dashboardContexts/DashboardComponentsContext.d.ts.map +1 -1
  227. package/esm/presentation/dashboardContexts/DashboardComponentsContext.js +2 -0
  228. package/esm/presentation/dashboardContexts/DashboardComponentsContext.js.map +1 -1
  229. package/esm/presentation/drill/types.d.ts +1 -0
  230. package/esm/presentation/drill/types.d.ts.map +1 -1
  231. package/esm/presentation/drill/types.js.map +1 -1
  232. package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.d.ts.map +1 -1
  233. package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js +5 -8
  234. package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js.map +1 -1
  235. package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.d.ts.map +1 -1
  236. package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js +43 -12
  237. package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js.map +1 -1
  238. package/esm/presentation/index.d.ts +1 -0
  239. package/esm/presentation/index.d.ts.map +1 -1
  240. package/esm/presentation/index.js +2 -1
  241. package/esm/presentation/index.js.map +1 -1
  242. package/esm/presentation/localization/bundles/de-DE.json +1 -0
  243. package/esm/presentation/localization/bundles/en-AU.json +475 -0
  244. package/esm/presentation/localization/bundles/en-GB.json +1 -0
  245. package/esm/presentation/localization/bundles/en-US.json +302 -2
  246. package/esm/presentation/localization/bundles/es-419.json +1 -0
  247. package/esm/presentation/localization/bundles/es-ES.json +1 -0
  248. package/esm/presentation/localization/bundles/fi-FI.json +475 -0
  249. package/esm/presentation/localization/bundles/fr-CA.json +1 -0
  250. package/esm/presentation/localization/bundles/fr-FR.json +1 -0
  251. package/esm/presentation/localization/bundles/it-IT.json +1 -0
  252. package/esm/presentation/localization/bundles/ja-JP.json +1 -0
  253. package/esm/presentation/localization/bundles/nl-NL.json +1 -0
  254. package/esm/presentation/localization/bundles/pt-BR.json +1 -0
  255. package/esm/presentation/localization/bundles/pt-PT.json +1 -0
  256. package/esm/presentation/localization/bundles/zh-HK.json +475 -0
  257. package/esm/presentation/localization/bundles/zh-Hans.json +1 -0
  258. package/esm/presentation/localization/bundles/zh-Hant.json +475 -0
  259. package/esm/presentation/localization/translations.d.ts.map +1 -1
  260. package/esm/presentation/localization/translations.js +8 -0
  261. package/esm/presentation/localization/translations.js.map +1 -1
  262. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +1 -1
  263. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js.map +1 -1
  264. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.d.ts +2 -2
  265. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.d.ts.map +1 -1
  266. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.js +1 -1
  267. package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.js.map +1 -1
  268. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.d.ts.map +1 -1
  269. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js +1 -1
  270. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js.map +1 -1
  271. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.d.ts +2 -2
  272. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.d.ts.map +1 -1
  273. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.js +1 -1
  274. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.js.map +1 -1
  275. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmailsList.d.ts +2 -2
  276. package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmailsList.d.ts.map +1 -1
  277. package/esm/presentation/scheduledEmail/types.d.ts +3 -3
  278. package/esm/presentation/scheduledEmail/types.d.ts.map +1 -1
  279. package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
  280. package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +166 -120
  281. package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js.map +1 -1
  282. package/esm/presentation/widget/common/configuration/ConfigurationBubble.d.ts +2 -1
  283. package/esm/presentation/widget/common/configuration/ConfigurationBubble.d.ts.map +1 -1
  284. package/esm/presentation/widget/common/configuration/ConfigurationBubble.js +3 -4
  285. package/esm/presentation/widget/common/configuration/ConfigurationBubble.js.map +1 -1
  286. package/esm/presentation/widget/common/useWidgetFilters.d.ts +1 -1
  287. package/esm/presentation/widget/common/useWidgetFilters.d.ts.map +1 -1
  288. package/esm/presentation/widget/common/useWidgetFilters.js +1 -1
  289. package/esm/presentation/widget/common/useWidgetFilters.js.map +1 -1
  290. package/esm/presentation/widget/insight/configuration/DrillTargets/DrillTargets.d.ts.map +1 -1
  291. package/esm/presentation/widget/insight/configuration/DrillTargets/DrillTargets.js +1 -0
  292. package/esm/presentation/widget/insight/configuration/DrillTargets/DrillTargets.js.map +1 -1
  293. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.d.ts +12 -0
  294. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.d.ts.map +1 -0
  295. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.js +77 -0
  296. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.js.map +1 -0
  297. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts +8 -0
  298. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts.map +1 -0
  299. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js +25 -0
  300. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js.map +1 -0
  301. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.d.ts +7 -0
  302. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.d.ts.map +1 -0
  303. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.js +13 -0
  304. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.js.map +1 -0
  305. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.d.ts +9 -0
  306. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.d.ts.map +1 -0
  307. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.js +23 -0
  308. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.js.map +1 -0
  309. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.d.ts +9 -0
  310. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.d.ts.map +1 -0
  311. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.js +26 -0
  312. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.js.map +1 -0
  313. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.d.ts +8 -0
  314. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.d.ts.map +1 -0
  315. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.js +35 -0
  316. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.js.map +1 -0
  317. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.d.ts +18 -0
  318. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.d.ts.map +1 -0
  319. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.js +31 -0
  320. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.js.map +1 -0
  321. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.d.ts +13 -0
  322. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.d.ts.map +1 -0
  323. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js +16 -0
  324. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js.map +1 -0
  325. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts +16 -0
  326. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts.map +1 -0
  327. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.js +7 -0
  328. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.js.map +1 -0
  329. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts +18 -0
  330. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts.map +1 -0
  331. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js +57 -0
  332. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js.map +1 -0
  333. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.d.ts +10 -0
  334. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.d.ts.map +1 -0
  335. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.js +47 -0
  336. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.js.map +1 -0
  337. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts +20 -0
  338. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts.map +1 -0
  339. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js +37 -0
  340. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js.map +1 -0
  341. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.d.ts +11 -0
  342. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.d.ts.map +1 -0
  343. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.js +27 -0
  344. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.js.map +1 -0
  345. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts +21 -0
  346. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts.map +1 -0
  347. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js +97 -0
  348. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js.map +1 -0
  349. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.d.ts +28 -0
  350. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.d.ts.map +1 -0
  351. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.js +179 -0
  352. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.js.map +1 -0
  353. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.d.ts +29 -0
  354. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.d.ts.map +1 -0
  355. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.js +51 -0
  356. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.js.map +1 -0
  357. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.d.ts +11 -0
  358. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.d.ts.map +1 -0
  359. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.js +27 -0
  360. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.js.map +1 -0
  361. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts +57 -0
  362. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts.map +1 -0
  363. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js +59 -0
  364. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js.map +1 -0
  365. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts +16 -0
  366. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts.map +1 -0
  367. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js +86 -0
  368. package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js.map +1 -0
  369. package/esm/presentation/widget/insight/configuration/InsightAlerts.d.ts +4 -0
  370. package/esm/presentation/widget/insight/configuration/InsightAlerts.d.ts.map +1 -0
  371. package/esm/presentation/widget/insight/configuration/InsightAlerts.js +38 -0
  372. package/esm/presentation/widget/insight/configuration/InsightAlerts.js.map +1 -0
  373. package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.d.ts +1 -1
  374. package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.d.ts.map +1 -1
  375. package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.js +23 -5
  376. package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.js.map +1 -1
  377. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.d.ts +2 -2
  378. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.d.ts.map +1 -1
  379. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.js +25 -3
  380. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.js.map +1 -1
  381. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.d.ts +1 -1
  382. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.d.ts.map +1 -1
  383. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.js +5 -4
  384. package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.js.map +1 -1
  385. package/esm/presentation/widget/insight/index.d.ts +1 -0
  386. package/esm/presentation/widget/insight/index.d.ts.map +1 -1
  387. package/esm/presentation/widget/insight/index.js +2 -1
  388. package/esm/presentation/widget/insight/index.js.map +1 -1
  389. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.d.ts.map +1 -1
  390. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js +1 -1
  391. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js.map +1 -1
  392. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.d.ts +1 -1
  393. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.d.ts.map +1 -1
  394. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.js +1 -1
  395. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.d.ts +1 -1
  396. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.d.ts.map +1 -1
  397. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.js +4 -3
  398. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.js.map +1 -1
  399. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.d.ts.map +1 -1
  400. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js +3 -3
  401. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js.map +1 -1
  402. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.d.ts +2 -0
  403. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.d.ts.map +1 -1
  404. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.js +28 -7
  405. package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.js.map +1 -1
  406. package/esm/presentation/widget/insightMenu/index.d.ts +1 -1
  407. package/esm/presentation/widget/insightMenu/index.d.ts.map +1 -1
  408. package/esm/presentation/widget/insightMenu/types.d.ts +28 -6
  409. package/esm/presentation/widget/insightMenu/types.d.ts.map +1 -1
  410. package/esm/presentation/widget/kpi/ViewModeDashboardKpi/useKpiAlertOperations.d.ts.map +1 -1
  411. package/esm/presentation/widget/kpi/ViewModeDashboardKpi/useKpiAlertOperations.js +9 -20
  412. package/esm/presentation/widget/kpi/ViewModeDashboardKpi/useKpiAlertOperations.js.map +1 -1
  413. package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.d.ts.map +1 -1
  414. package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js +8 -6
  415. package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js.map +1 -1
  416. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.d.ts +2 -0
  417. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.d.ts.map +1 -1
  418. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.js +13 -8
  419. package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.js.map +1 -1
  420. package/esm/sdk-ui-dashboard.d.ts +401 -149
  421. package/esm/types.d.ts +9 -0
  422. package/esm/types.d.ts.map +1 -1
  423. package/esm/types.js.map +1 -1
  424. package/package.json +16 -15
  425. package/styles/css/alerting.css +286 -0
  426. package/styles/css/alerting.css.map +1 -0
  427. package/styles/css/configurationPanel.css +3 -0
  428. package/styles/css/configurationPanel.css.map +1 -1
  429. package/styles/css/dashboard.css +60 -5
  430. package/styles/css/dashboard.css.map +1 -1
  431. package/styles/css/icons.css +7 -0
  432. package/styles/css/icons.css.map +1 -1
  433. package/styles/css/main.css +355 -5
  434. package/styles/css/main.css.map +1 -1
  435. package/styles/css/scheduled_mail.css +60 -5
  436. package/styles/css/scheduled_mail.css.map +1 -1
  437. package/styles/scss/alerting.scss +292 -0
  438. package/styles/scss/configurationPanel.scss +5 -0
  439. package/styles/scss/icons.scss +9 -0
  440. package/styles/scss/main.scss +1 -0
  441. package/styles/scss/scheduled_mail.scss +69 -3
  442. package/esm/model/commandHandlers/alerts/removeAlertsHandler.d.ts +0 -6
  443. package/esm/model/commandHandlers/alerts/removeAlertsHandler.d.ts.map +0 -1
  444. package/esm/model/commandHandlers/alerts/removeAlertsHandler.js +0 -20
  445. package/esm/model/commandHandlers/alerts/removeAlertsHandler.js.map +0 -1
  446. package/esm/model/commandHandlers/alerts/updateAlertHandler.d.ts +0 -6
  447. package/esm/model/commandHandlers/alerts/updateAlertHandler.d.ts.map +0 -1
  448. package/esm/model/commandHandlers/alerts/updateAlertHandler.js +0 -17
  449. package/esm/model/commandHandlers/alerts/updateAlertHandler.js.map +0 -1
  450. package/esm/model/commandHandlers/alerts/validation/alertsValidation.d.ts +0 -20
  451. package/esm/model/commandHandlers/alerts/validation/alertsValidation.d.ts.map +0 -1
  452. package/esm/model/commandHandlers/alerts/validation/alertsValidation.js +0 -22
  453. package/esm/model/commandHandlers/alerts/validation/alertsValidation.js.map +0 -1
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { IAutomationMetadataObject, IAutomationMetadataObjectDefinition, IMeasure } from "@gooddata/sdk-model";
3
+ import { Webhooks } from "../../../../../model/index.js";
4
+ interface IEditAlertProps {
5
+ alert: IAutomationMetadataObject;
6
+ isNewAlert?: boolean;
7
+ hasAlerts: boolean;
8
+ destinations: Webhooks;
9
+ measures: IMeasure[];
10
+ onClose: () => void;
11
+ onCancel: () => void;
12
+ onCreate?: (alert: IAutomationMetadataObjectDefinition) => void;
13
+ onUpdate?: (alert: IAutomationMetadataObject) => void;
14
+ maxAutomationsReached?: boolean;
15
+ }
16
+ export declare const EditAlert: React.FC<IEditAlertProps>;
17
+ export {};
18
+ //# sourceMappingURL=EditAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditAlert.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,yBAAyB,EACzB,mCAAmC,EACnC,QAAQ,EACX,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAIzD,UAAU,eAAe;IACrB,KAAK,EAAE,yBAAyB,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,QAAQ,CAAC;IACvB,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyI/C,CAAC"}
@@ -0,0 +1,57 @@
1
+ // (C) 2022-2024 GoodData Corporation
2
+ import React from "react";
3
+ import { Bubble, BubbleHoverTrigger, Button, Input, Message } from "@gooddata/sdk-ui-kit";
4
+ import { DashboardInsightSubmenuContainer } from "../../../insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.js";
5
+ import { AlertMeasureSelect } from "./AlertMeasureSelect.js";
6
+ import { AlertComparisonOperatorSelect } from "./AlertComparisonOperatorSelect.js";
7
+ import { AlertDestinationSelect } from "./AlertDestinationSelect.js";
8
+ import { EditAlertConfiguration } from "./EditAlertConfiguration.js";
9
+ import { useEditAlert } from "./hooks/useEditAlert.js";
10
+ import { FormattedMessage, useIntl } from "react-intl";
11
+ const TOOLTIP_ALIGN_POINTS = [{ align: "cl cr" }, { align: "cr cl" }];
12
+ export const EditAlert = ({ alert, isNewAlert, hasAlerts, destinations, measures, onClose, onCancel, onCreate, onUpdate, maxAutomationsReached = false, }) => {
13
+ const { viewMode, updatedAlert, canSubmit,
14
+ //
15
+ changeComparisonOperator, changeMeasure, changeValue, changeDestination,
16
+ //
17
+ configureAlert, saveAlertConfiguration, cancelAlertConfiguration,
18
+ //
19
+ createAlert, updateAlert, } = useEditAlert({
20
+ alert,
21
+ onCreate,
22
+ onUpdate,
23
+ });
24
+ const intl = useIntl();
25
+ const disableCreateButtonDueToLimits = isNewAlert && maxAutomationsReached;
26
+ const selectedMeasureIdentifier = updatedAlert.alert.condition.left;
27
+ const selectedMeasure = measures.find((measure) => measure.measure.localIdentifier === selectedMeasureIdentifier);
28
+ return viewMode === "edit" ? (React.createElement(DashboardInsightSubmenuContainer, { title: isNewAlert
29
+ ? intl.formatMessage({ id: "insightAlert.config.createAlert" })
30
+ : intl.formatMessage({ id: "insightAlert.config.editAlert" }), onClose: onClose, onBack: hasAlerts ? onCancel : undefined },
31
+ React.createElement("div", { className: "gd-edit-alert" },
32
+ React.createElement("div", { className: "gd-edit-alert__form" },
33
+ React.createElement("div", { className: "gd-edit-alert__form-content" },
34
+ React.createElement("div", { className: "gd-edit-alert__measure-label" },
35
+ React.createElement(FormattedMessage, { id: "insightAlert.config.when" })),
36
+ React.createElement(AlertMeasureSelect, { selectedMeasure: selectedMeasure, onMeasureChange: changeMeasure, measures: measures }),
37
+ React.createElement(AlertComparisonOperatorSelect, { selectedComparisonOperator: updatedAlert.alert.condition.operator, onComparisonOperatorChange: changeComparisonOperator }),
38
+ React.createElement(Input, { className: "gd-edit-alert__value-input s-alert-value-input", isSmall: true, autofocus: true, value: updatedAlert.alert.condition.right, onChange: (e) => changeValue(e !== "" ? parseInt(e, 10) : undefined), type: "number" }),
39
+ destinations.length > 1 && (React.createElement(AlertDestinationSelect, { selectedDestination: updatedAlert.webhook, onDestinationChange: changeDestination, destinations: destinations }))),
40
+ !selectedMeasure ? (React.createElement(Message, { type: "error" },
41
+ React.createElement(FormattedMessage, { id: "insightAlert.config.invalid" }))) : null),
42
+ React.createElement("div", { className: "gd-edit-alert__buttons" },
43
+ React.createElement(Button, { className: "gd-edit-alert__configuration-button gd-button-link gd-button-icon-only gd-icon-settings gd-button-small s-alert-configuration", onClick: configureAlert }),
44
+ React.createElement("div", null,
45
+ React.createElement(Button, { variant: "secondary", size: "small", onClick: () => {
46
+ onCancel();
47
+ } },
48
+ React.createElement(FormattedMessage, { id: "cancel" })),
49
+ React.createElement(BubbleHoverTrigger, { hideDelay: 0, showDelay: 0 },
50
+ React.createElement(Button, { intent: "action", size: "small", disabled: !canSubmit || disableCreateButtonDueToLimits, onClick: isNewAlert ? createAlert : updateAlert, className: "gd-button-left-margin" }, isNewAlert
51
+ ? intl.formatMessage({ id: "create" })
52
+ : intl.formatMessage({ id: "save" })),
53
+ disableCreateButtonDueToLimits ? (React.createElement(Bubble, { alignPoints: TOOLTIP_ALIGN_POINTS },
54
+ React.createElement(FormattedMessage, { id: "insightAlert.maxAlertsReached" }))) : null)))))) : (React.createElement(DashboardInsightSubmenuContainer, { title: intl.formatMessage({ id: "insightAlert.config.title" }), onClose: onClose, onBack: cancelAlertConfiguration },
55
+ React.createElement(EditAlertConfiguration, { alert: updatedAlert, onUpdate: saveAlertConfiguration, onCancel: cancelAlertConfiguration })));
56
+ };
57
+ //# sourceMappingURL=EditAlert.js.map
@@ -0,0 +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;AAM1B,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1F,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,gBAAgB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGvD,MAAM,oBAAoB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAetE,MAAM,CAAC,MAAM,SAAS,GAA8B,CAAC,EACjD,KAAK,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,qBAAqB,GAAG,KAAK,GAChC,EAAE,EAAE;IACD,MAAM,EACF,QAAQ,EACR,YAAY,EACZ,SAAS;IACT,EAAE;IACF,wBAAwB,EACxB,aAAa,EACb,WAAW,EACX,iBAAiB;IACjB,EAAE;IACF,cAAc,EACd,sBAAsB,EACtB,wBAAwB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,UAAU;4BACP,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;4BACtC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CACnC;wBACR,8BAA8B,CAAC,CAAC,CAAC,CAC9B,oBAAC,MAAM,IAAC,WAAW,EAAE,oBAAoB;4BACrC,oBAAC,gBAAgB,IAAC,EAAE,EAAC,+BAA+B,GAAG,CAClD,CACZ,CAAC,CAAC,CAAC,IAAI,CACS,CACnB,CACJ,CACJ,CACyB,CACtC,CAAC,CAAC,CAAC,CACA,oBAAC,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,GACpC,CAC6B,CACtC,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { IAutomationMetadataObject } from "@gooddata/sdk-model";
3
+ interface IEditAlertConfigurationProps {
4
+ alert: IAutomationMetadataObject;
5
+ onCancel: () => void;
6
+ onUpdate: (alert: IAutomationMetadataObject) => void;
7
+ }
8
+ export declare const EditAlertConfiguration: React.FC<IEditAlertConfigurationProps>;
9
+ export {};
10
+ //# sourceMappingURL=EditAlertConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditAlertConfiguration.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAYhE,UAAU,4BAA4B;IAClC,KAAK,EAAE,yBAAyB,CAAC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAmEzE,CAAC"}
@@ -0,0 +1,47 @@
1
+ // (C) 2022-2024 GoodData Corporation
2
+ import React, { useState } from "react";
3
+ import { Bubble, BubbleHoverTrigger, Button, Icon } from "@gooddata/sdk-ui-kit";
4
+ import { AlertTriggerModeSelect } from "./AlertTriggerModeSelect.js";
5
+ import { useTheme } from "@gooddata/sdk-ui-theme-provider";
6
+ import { FormattedMessage } from "react-intl";
7
+ import { gdColorStateBlank } from "../../../../constants/index.js";
8
+ const TOOLTIP_ALIGN_POINTS = [
9
+ { align: "cr cl", offset: { x: 0, y: -1 } },
10
+ { align: "cl cr", offset: { x: 0, y: -1 } },
11
+ ];
12
+ export const EditAlertConfiguration = ({ alert, onCancel, onUpdate, }) => {
13
+ const [updatedAlert, setUpdatedAlert] = useState(alert);
14
+ const canSubmit = updatedAlert.alert?.trigger.mode !== alert.alert?.trigger.mode;
15
+ const theme = useTheme();
16
+ return (React.createElement("div", { className: "gd-edit-alert-configuration" },
17
+ React.createElement("div", { className: "gd-edit-alert-configuration__form" },
18
+ React.createElement("div", { className: "gd-edit-alert-configuration__trigger-label" },
19
+ React.createElement(FormattedMessage, { id: "insightAlert.config.trigger" }),
20
+ " ",
21
+ React.createElement(BubbleHoverTrigger, null,
22
+ React.createElement(Icon.QuestionMark, { className: "gd-edit-alert-configuration__trigger-label-icon", color: theme?.palette?.complementary?.c6 ?? gdColorStateBlank, width: 14, height: 14 }),
23
+ React.createElement(Bubble, { alignPoints: TOOLTIP_ALIGN_POINTS },
24
+ React.createElement(FormattedMessage, { id: "insightAlert.config.trigger.tooltip" })))),
25
+ React.createElement("div", { className: "gd-edit-alert-configuration__trigger-select" },
26
+ React.createElement(AlertTriggerModeSelect, { selectedTriggerMode: updatedAlert.alert?.trigger.mode ?? "ALWAYS", onTriggerModeChange: (triggerMode) => {
27
+ setUpdatedAlert({
28
+ ...updatedAlert,
29
+ alert: {
30
+ ...updatedAlert.alert,
31
+ trigger: {
32
+ ...updatedAlert.alert.trigger,
33
+ mode: triggerMode,
34
+ },
35
+ },
36
+ });
37
+ } }))),
38
+ React.createElement("div", { className: "gd-edit-alert-configuration__buttons" },
39
+ React.createElement("div", null,
40
+ React.createElement(Button, { variant: "secondary", size: "small", onClick: () => {
41
+ onCancel();
42
+ } },
43
+ React.createElement(FormattedMessage, { id: "cancel" })),
44
+ React.createElement(Button, { intent: "action", size: "small", disabled: !canSubmit, onClick: () => onUpdate(updatedAlert) },
45
+ React.createElement(FormattedMessage, { id: "save" }))))));
46
+ };
47
+ //# sourceMappingURL=EditAlertConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditAlertConfiguration.js","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,MAAM,oBAAoB,GAAG;IACzB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;IAC3C,EAAE,KAAK,EAAE,OAAO,EAA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ACL,GAAG,YAAY,CAAC,KAAM,CAAC,OAAO;oCAC9B,IAAI,EAAE,WAAW;iCACpB;6BACJ;yBACJ,CAAC,CAAC;oBACP,CAAC,GACH,CACA,CACJ;QACN,6BAAK,SAAS,EAAC,sCAAsC;YACjD;gBACI,oBAAC,MAAM,IACH,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;wBACV,QAAQ,EAAE,CAAC;oBACf,CAAC;oBAED,oBAAC,gBAAgB,IAAC,EAAE,EAAC,QAAQ,GAAG,CAC3B;gBACT,oBAAC,MAAM,IACH,MAAM,EAAC,QAAQ,EACf,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,CAAC,SAAS,EACpB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;oBAErC,oBAAC,gBAAgB,IAAC,EAAE,EAAC,MAAM,GAAG,CACzB,CACP,CACJ,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { IAlertComparisonOperator } from "@gooddata/sdk-model";
2
+ export declare const LOADING_MASK_HEIGHT = 100;
3
+ export declare const COMPARISON_OPERATOR_LESS_THAN = "LESS_THAN";
4
+ export declare const COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO = "LESS_THAN_OR_EQUAL_TO";
5
+ export declare const COMPARISON_OPERATOR_GREATER_THAN = "GREATER_THAN";
6
+ export declare const COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO = "GREATER_THAN_OR_EQUAL_TO";
7
+ export declare const COMPARISON_OPERATORS: {
8
+ readonly COMPARISON_OPERATOR_LESS_THAN: "LESS_THAN";
9
+ readonly COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO: "LESS_THAN_OR_EQUAL_TO";
10
+ readonly COMPARISON_OPERATOR_GREATER_THAN: "GREATER_THAN";
11
+ readonly COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO: "GREATER_THAN_OR_EQUAL_TO";
12
+ };
13
+ export declare const COMPARISON_OPERATOR_OPTIONS: {
14
+ title: string;
15
+ icon: string;
16
+ id: IAlertComparisonOperator;
17
+ }[];
18
+ export declare const DROPDOWN_ITEM_HEIGHT = 28;
19
+ export declare const DROPDOWN_SEPARATOR_ITEM_HEIGHT = 10;
20
+ //# 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,mBAAmB,MAAM,CAAC;AAEvC,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,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"}
@@ -0,0 +1,37 @@
1
+ import { messages } from "./messages.js";
2
+ export const LOADING_MASK_HEIGHT = 100;
3
+ export const COMPARISON_OPERATOR_LESS_THAN = "LESS_THAN";
4
+ export const COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO = "LESS_THAN_OR_EQUAL_TO";
5
+ export const COMPARISON_OPERATOR_GREATER_THAN = "GREATER_THAN";
6
+ export const COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO = "GREATER_THAN_OR_EQUAL_TO";
7
+ export const COMPARISON_OPERATORS = {
8
+ COMPARISON_OPERATOR_LESS_THAN,
9
+ COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO,
10
+ COMPARISON_OPERATOR_GREATER_THAN,
11
+ COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO,
12
+ };
13
+ export const COMPARISON_OPERATOR_OPTIONS = [
14
+ {
15
+ title: messages.comparisonOperatorGreaterThan.id,
16
+ icon: "gd-icon-greater-than",
17
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_GREATER_THAN,
18
+ },
19
+ {
20
+ title: messages.comparisonOperatorGreaterThanOrEquals.id,
21
+ icon: "gd-icon-greater-than-equal-to",
22
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL_TO,
23
+ },
24
+ {
25
+ title: messages.comparisonOperatorLessThan.id,
26
+ icon: "gd-icon-less-than",
27
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_LESS_THAN,
28
+ },
29
+ {
30
+ title: messages.comparisonOperatorLessThanOrEquals.id,
31
+ icon: "gd-icon-less-than-equal-to",
32
+ id: COMPARISON_OPERATORS.COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL_TO,
33
+ },
34
+ ];
35
+ export const DROPDOWN_ITEM_HEIGHT = 28;
36
+ export const DROPDOWN_SEPARATOR_ITEM_HEIGHT = 10;
37
+ //# 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,mBAAmB,GAAG,GAAG,CAAC;AAEvC,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,oBAAoB,GAAG;IAChC,6BAA6B;IAC7B,yCAAyC;IACzC,gCAAgC;IAChC,4CAA4C;CACtC,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,4CAA4C;KACxE;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,yCAAyC;KACrE;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { IAutomationMetadataObject, IAutomationMetadataObjectDefinition } from "@gooddata/sdk-model";
2
+ import { CommandProcessingStatus } from "../../../../../../model/index.js";
3
+ export declare const useCreateAlert: ({ onBeforeRun, onSuccess, onError, }?: {
4
+ onBeforeRun?: ((alertToCreate: IAutomationMetadataObjectDefinition) => void) | undefined;
5
+ onSuccess?: ((alert: IAutomationMetadataObject) => void) | undefined;
6
+ onError?: ((error: any) => void) | undefined;
7
+ }) => {
8
+ create: (alertToCreate: IAutomationMetadataObjectDefinition) => void;
9
+ creationStatus?: CommandProcessingStatus | undefined;
10
+ };
11
+ //# sourceMappingURL=useCreateAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCreateAlert.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,mCAAmC,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACH,uBAAuB,EAG1B,MAAM,kCAAkC,CAAC;AAE1C,eAAO,MAAM,cAAc;mCAKO,mCAAmC,KAAK,IAAI;yBACtD,yBAAyB,KAAK,IAAI;uBACpC,GAAG,KAAK,IAAI;;4BAEN,mCAAmC,KAAK,IAAI;;CA6BvE,CAAC"}
@@ -0,0 +1,27 @@
1
+ // (C) 2020-2024 GoodData Corporation
2
+ import { useCallback } from "react";
3
+ import { createAlert, useDashboardCommandProcessing, } from "../../../../../../model/index.js";
4
+ export const useCreateAlert = ({ onBeforeRun, onSuccess, onError, } = {}) => {
5
+ const alertCommandProcessing = useDashboardCommandProcessing({
6
+ commandCreator: createAlert,
7
+ errorEvent: "GDC.DASH/EVT.COMMAND.FAILED",
8
+ successEvent: "GDC.DASH/EVT.ALERT.CREATED",
9
+ onError: (event) => {
10
+ onError?.(event.payload.error);
11
+ },
12
+ onSuccess: (event) => {
13
+ onSuccess?.(event.payload.alert);
14
+ },
15
+ onBeforeRun: (cmd) => {
16
+ onBeforeRun?.(cmd.payload.alert);
17
+ },
18
+ });
19
+ const create = useCallback((alertToCreate) => {
20
+ alertCommandProcessing.run(alertToCreate);
21
+ }, [alertCommandProcessing]);
22
+ return {
23
+ create,
24
+ creationStatus: alertCommandProcessing.status,
25
+ };
26
+ };
27
+ //# sourceMappingURL=useCreateAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCreateAlert.js","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAEH,WAAW,EACX,6BAA6B,GAChC,MAAM,kCAAkC,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC3B,WAAW,EACX,SAAS,EACT,OAAO,MAKP,EAAE,EAGJ,EAAE;IACA,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;QACzD,cAAc,EAAE,WAAW;QAC3B,UAAU,EAAE,6BAA6B;QACzC,YAAY,EAAE,4BAA4B;QAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACf,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;QACD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;QACD,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE;YACjB,WAAW,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;KACJ,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,WAAW,CACtB,CAAC,aAAkD,EAAE,EAAE;QACnD,sBAAsB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC,EACD,CAAC,sBAAsB,CAAC,CAC3B,CAAC;IAEF,OAAO;QACH,MAAM;QACN,cAAc,EAAE,sBAAsB,CAAC,MAAM;KAChD,CAAC;AACN,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/hooks/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.measure.localIdentifier,
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/hooks/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,aAAa,CAAC;AAC1E,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,KAAK,CAAC,KAAM,CAA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2
+ type InsightWidgetAlertingViewMode = "list" | "edit" | "create";
3
+ export interface IInsightWidgetAlertingProps {
4
+ widget?: IInsightWidget | undefined;
5
+ closeInsightWidgetMenu: () => void;
6
+ }
7
+ export declare const useInsightWidgetAlerting: ({ widget, closeInsightWidgetMenu }: IInsightWidgetAlertingProps) => {
8
+ isLoading: boolean;
9
+ destinations: import("../../../../../../model/index.js").Webhooks;
10
+ alerts: IAutomationMetadataObject[];
11
+ viewMode: InsightWidgetAlertingViewMode;
12
+ editingAlert: IAutomationMetadataObject | null;
13
+ creatingAlert: IAutomationMetadataObject | IAutomationMetadataObjectDefinition | null;
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) => Promise<void>;
21
+ cancelAlertEditing: () => void;
22
+ cancelAlertCreation: () => void;
23
+ hasAlerts: boolean;
24
+ supportedMeasures: import("@gooddata/sdk-model").IMeasure<import("@gooddata/sdk-model").IMeasureDefinitionType>[];
25
+ maxAutomationsReached: boolean;
26
+ };
27
+ export {};
28
+ //# sourceMappingURL=useInsightAlerting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInsightAlerting.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.ts"],"names":[],"mappings":"AACA,OAAO,EACH,yBAAyB,EACzB,mCAAmC,EACnC,cAAc,EACjB,MAAM,qBAAqB,CAAC;AAwB7B,KAAK,6BAA6B,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhE,MAAM,WAAW,2BAA2B;IACxC,MAAM,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACpC,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,wBAAwB,uCAAwC,2BAA2B;;;;;;;;kCAkG/D,yBAAyB;iCA0B1B,yBAAyB;0BAhBhC,mCAAmC;gCAqB7B,yBAAyB;iCAQxB,yBAAyB;iCAQnB,yBAAyB;;;;;;CAwCtE,CAAC"}
@@ -0,0 +1,179 @@
1
+ import { useToastMessage } from "@gooddata/sdk-ui-kit";
2
+ import { useCallback, useEffect, useState } from "react";
3
+ import { v4 as uuidv4 } from "uuid";
4
+ import { useDashboardSelector, selectInsightByWidgetRef, selectEntitlementMaxAutomations, selectEntitlementUnlimitedAutomations, DEFAULT_MAX_AUTOMATIONS, selectAutomationsCount, selectWebhooks, refreshAutomations, useDashboardDispatch, dispatchAndWaitFor, selectAutomationsAlertsInContext, selectDashboardId, } from "../../../../../../model/index.js";
5
+ import { createDefaultAlert, getSupportedInsightMeasuresByInsight } from "../utils.js";
6
+ import { messages } from "../messages.js";
7
+ import { useWidgetFilters } from "../../../../common/useWidgetFilters.js";
8
+ import { useSaveAlertToBackend } from "./useSaveAlertToBackend.js";
9
+ import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
10
+ export const useInsightWidgetAlerting = ({ widget, closeInsightWidgetMenu }) => {
11
+ const { addSuccess, addError } = useToastMessage();
12
+ const dispatch = useDashboardDispatch();
13
+ const effectiveBackend = useBackendStrict();
14
+ const effectiveWorkspace = useWorkspaceStrict();
15
+ const destinations = useDashboardSelector(selectWebhooks);
16
+ const alerts = useDashboardSelector(selectAutomationsAlertsInContext(widget?.localIdentifier));
17
+ const dashboard = useDashboardSelector(selectDashboardId);
18
+ const insight = useDashboardSelector(selectInsightByWidgetRef(widget?.ref));
19
+ const automationsCount = useDashboardSelector(selectAutomationsCount);
20
+ const maxAutomationsEntitlement = useDashboardSelector(selectEntitlementMaxAutomations);
21
+ const unlimitedAutomationsEntitlement = useDashboardSelector(selectEntitlementUnlimitedAutomations);
22
+ const { handleCreateAlert, handleUpdateAlert, handlePauseAlert, handleResumeAlert } = useSaveAlertToBackend({
23
+ onCreateSuccess: () => {
24
+ setViewMode("list");
25
+ handleRefreshAutomations();
26
+ addSuccess(messages.alertAddSuccess);
27
+ },
28
+ onCreateError: () => {
29
+ setIsLoading(false);
30
+ setViewMode("list");
31
+ addError(messages.alertSaveError);
32
+ },
33
+ onUpdateSuccess: () => {
34
+ cancelAlertEditing();
35
+ handleRefreshAutomations();
36
+ addSuccess(messages.alertUpdateSuccess);
37
+ },
38
+ onUpdateError: () => {
39
+ setIsLoading(false);
40
+ cancelAlertEditing();
41
+ addError(messages.alertSaveError);
42
+ },
43
+ onPauseSuccess: () => {
44
+ addSuccess(messages.alertPauseSuccess);
45
+ },
46
+ onPauseError: () => {
47
+ addError(messages.alertSaveError);
48
+ },
49
+ onResumeSuccess: () => {
50
+ addSuccess(messages.alertResumeSuccess);
51
+ },
52
+ onResumeError: () => {
53
+ addError(messages.alertSaveError);
54
+ },
55
+ });
56
+ const { result: widgetFilters, status: widgetFiltersStatus } = useWidgetFilters(widget, insight);
57
+ const supportedMeasures = getSupportedInsightMeasuresByInsight(insight);
58
+ const defaultMeasure = supportedMeasures[0];
59
+ const defaultNotificationChannelId = destinations[0].id;
60
+ const hasAlerts = alerts.length > 0;
61
+ const maxAutomations = parseInt(maxAutomationsEntitlement?.value ?? DEFAULT_MAX_AUTOMATIONS, 10);
62
+ const maxAutomationsReached = automationsCount >= maxAutomations && !unlimitedAutomationsEntitlement;
63
+ // Handle async widget filters state
64
+ useEffect(() => {
65
+ if (widgetFiltersStatus === "success") {
66
+ setIsLoading(false);
67
+ setDefaultAlert(createDefaultAlert(widgetFilters, defaultMeasure, defaultNotificationChannelId));
68
+ }
69
+ else if (widgetFiltersStatus === "error") {
70
+ setIsLoading(false);
71
+ closeInsightWidgetMenu();
72
+ addError(messages.alertLoadingError);
73
+ }
74
+ // Avoid infinite loop by ignoring addError
75
+ // eslint-disable-next-line react-hooks/exhaustive-deps
76
+ }, [
77
+ closeInsightWidgetMenu,
78
+ defaultMeasure,
79
+ defaultNotificationChannelId,
80
+ widgetFilters,
81
+ widgetFiltersStatus,
82
+ ]);
83
+ const [isLoading, setIsLoading] = useState(true);
84
+ const [viewMode, setViewMode] = useState(alerts.length > 0 ? "list" : "create");
85
+ const [defaultAlert, setDefaultAlert] = useState(null);
86
+ const [editingAlert, setEditingAlert] = useState(null);
87
+ const initiateAlertCreation = () => {
88
+ setViewMode("create");
89
+ };
90
+ const cancelAlertCreation = () => {
91
+ if (hasAlerts) {
92
+ setViewMode("list");
93
+ }
94
+ else {
95
+ closeInsightWidgetMenu();
96
+ }
97
+ };
98
+ const initiateAlertEditing = (alert) => {
99
+ setEditingAlert(alert);
100
+ setViewMode("edit");
101
+ };
102
+ const cancelAlertEditing = () => {
103
+ setEditingAlert(null);
104
+ setViewMode("list");
105
+ };
106
+ const saveNewAlert = (alert) => {
107
+ const id = uuidv4();
108
+ const alertToCreate = {
109
+ ...alert,
110
+ id,
111
+ ref: { identifier: id, type: "automation" },
112
+ uri: id,
113
+ dashboard,
114
+ metadata: {
115
+ widget: widget?.localIdentifier,
116
+ },
117
+ };
118
+ setIsLoading(true);
119
+ handleCreateAlert(alertToCreate);
120
+ };
121
+ const updateExistingAlert = (alert) => {
122
+ setIsLoading(true);
123
+ handleUpdateAlert(alert);
124
+ };
125
+ const pauseExistingAlert = (alert) => {
126
+ const alertToPause = {
127
+ ...alert,
128
+ alert: { ...alert.alert, trigger: { ...alert.alert?.trigger, state: "PAUSED" } },
129
+ };
130
+ handlePauseAlert(alertToPause);
131
+ };
132
+ const resumeExistingAlert = (alert) => {
133
+ const alertToResume = {
134
+ ...alert,
135
+ alert: { ...alert.alert, trigger: { ...alert.alert?.trigger, state: "ACTIVE" } },
136
+ };
137
+ handleResumeAlert(alertToResume);
138
+ };
139
+ const deleteExistingAlert = async (alert) => {
140
+ setIsLoading(true);
141
+ try {
142
+ await effectiveBackend.workspace(effectiveWorkspace).automations().deleteAutomation(alert.id);
143
+ addSuccess(messages.alertDeleteSuccess);
144
+ setViewMode(alerts.length === 1 ? "create" : "list");
145
+ handleRefreshAutomations();
146
+ }
147
+ catch (err) {
148
+ addError(messages.alertDeleteError);
149
+ setIsLoading(false);
150
+ }
151
+ };
152
+ const handleRefreshAutomations = useCallback(() => {
153
+ setIsLoading(true);
154
+ dispatchAndWaitFor(dispatch, refreshAutomations()).then(() => {
155
+ setIsLoading(false);
156
+ });
157
+ }, [dispatch]);
158
+ return {
159
+ isLoading,
160
+ destinations,
161
+ alerts,
162
+ viewMode,
163
+ editingAlert,
164
+ creatingAlert: defaultAlert,
165
+ initiateAlertCreation,
166
+ initiateAlertEditing,
167
+ updateExistingAlert,
168
+ saveNewAlert,
169
+ pauseExistingAlert,
170
+ resumeExistingAlert,
171
+ deleteExistingAlert,
172
+ cancelAlertEditing,
173
+ cancelAlertCreation,
174
+ hasAlerts,
175
+ supportedMeasures,
176
+ maxAutomationsReached,
177
+ };
178
+ };
179
+ //# sourceMappingURL=useInsightAlerting.js.map