@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.
- package/NOTICE +35 -3
- package/esm/__version.d.ts +1 -1
- package/esm/__version.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/__version.js.map +1 -1
- package/esm/_staging/drills/drillingUtils.d.ts +2 -14
- package/esm/_staging/drills/drillingUtils.d.ts.map +1 -1
- package/esm/_staging/drills/drillingUtils.js +2 -62
- package/esm/_staging/drills/drillingUtils.js.map +1 -1
- package/esm/assets/ellipsis-hover.svg +1 -0
- package/esm/assets/ellipsis.svg +1 -0
- package/esm/assets/filter.svg +1 -0
- package/esm/locales.d.ts.map +1 -1
- package/esm/locales.js +9 -0
- package/esm/locales.js.map +1 -1
- package/esm/model/commandHandlers/alerts/createAlertHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/alerts/createAlertHandler.js +2 -4
- package/esm/model/commandHandlers/alerts/createAlertHandler.js.map +1 -1
- package/esm/model/commandHandlers/alerts/saveAlertHandler.d.ts +6 -0
- package/esm/model/commandHandlers/alerts/saveAlertHandler.d.ts.map +1 -0
- package/esm/model/commandHandlers/alerts/saveAlertHandler.js +15 -0
- package/esm/model/commandHandlers/alerts/saveAlertHandler.js.map +1 -0
- package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.d.ts +2 -2
- package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.js +4 -4
- package/esm/model/commandHandlers/dashboard/common/loadWorkspaceAutomations.js.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +6 -5
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js.map +1 -1
- package/esm/model/commandHandlers/drill/drillDownHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/drillDownHandler.js +24 -2
- package/esm/model/commandHandlers/drill/drillDownHandler.js.map +1 -1
- package/esm/model/commandHandlers/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/index.js +2 -4
- package/esm/model/commandHandlers/index.js.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/refreshAutomationsHandlers.js +3 -3
- package/esm/model/commandHandlers/scheduledEmail/refreshAutomationsHandlers.js.map +1 -1
- package/esm/model/commandHandlers/widgets/addDrillDownForInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/addDrillDownForInsightWidgetHandler.js +23 -2
- package/esm/model/commandHandlers/widgets/addDrillDownForInsightWidgetHandler.js.map +1 -1
- package/esm/model/commandHandlers/widgets/common/drillDown.d.ts +6 -0
- package/esm/model/commandHandlers/widgets/common/drillDown.d.ts.map +1 -0
- package/esm/model/commandHandlers/widgets/common/drillDown.js +22 -0
- package/esm/model/commandHandlers/widgets/common/drillDown.js.map +1 -0
- package/esm/model/commandHandlers/widgets/modifyDrillDownForInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/modifyDrillDownForInsightWidgetHandler.js +23 -2
- package/esm/model/commandHandlers/widgets/modifyDrillDownForInsightWidgetHandler.js.map +1 -1
- package/esm/model/commandHandlers/widgets/removeDrillDownForInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/removeDrillDownForInsightWidgetHandler.js +15 -2
- package/esm/model/commandHandlers/widgets/removeDrillDownForInsightWidgetHandler.js.map +1 -1
- package/esm/model/commands/alerts.d.ts +16 -45
- package/esm/model/commands/alerts.d.ts.map +1 -1
- package/esm/model/commands/alerts.js +6 -24
- package/esm/model/commands/alerts.js.map +1 -1
- package/esm/model/commands/base.d.ts +1 -1
- package/esm/model/commands/base.d.ts.map +1 -1
- package/esm/model/commands/index.d.ts +3 -3
- package/esm/model/commands/index.d.ts.map +1 -1
- package/esm/model/commands/index.js +1 -1
- package/esm/model/commands/index.js.map +1 -1
- package/esm/model/commands/insight.d.ts +17 -3
- package/esm/model/commands/insight.d.ts.map +1 -1
- package/esm/model/commands/insight.js +7 -3
- package/esm/model/commands/insight.js.map +1 -1
- package/esm/model/events/alerts.d.ts +10 -48
- package/esm/model/events/alerts.d.ts.map +1 -1
- package/esm/model/events/alerts.js +4 -24
- package/esm/model/events/alerts.js.map +1 -1
- package/esm/model/events/base.d.ts +1 -1
- package/esm/model/events/base.d.ts.map +1 -1
- package/esm/model/events/base.js.map +1 -1
- package/esm/model/events/index.d.ts +3 -3
- package/esm/model/events/index.d.ts.map +1 -1
- package/esm/model/events/index.js +1 -1
- package/esm/model/events/index.js.map +1 -1
- package/esm/model/react/index.d.ts +1 -0
- package/esm/model/react/index.d.ts.map +1 -1
- package/esm/model/react/index.js +1 -0
- package/esm/model/react/index.js.map +1 -1
- package/esm/model/react/useDashboardAlerts.d.ts +33 -0
- package/esm/model/react/useDashboardAlerts.d.ts.map +1 -0
- package/esm/model/react/useDashboardAlerts.js +145 -0
- package/esm/model/react/useDashboardAlerts.js.map +1 -0
- package/esm/model/react/useDashboardCommand.d.ts +1 -2
- package/esm/model/react/useDashboardCommand.d.ts.map +1 -1
- package/esm/model/react/useDashboardCommandProcessing.d.ts +2 -6
- package/esm/model/react/useDashboardCommandProcessing.d.ts.map +1 -1
- package/esm/model/react/useDashboardScheduledEmails.d.ts +3 -5
- package/esm/model/react/useDashboardScheduledEmails.d.ts.map +1 -1
- package/esm/model/react/useDashboardScheduledEmails.js +6 -29
- package/esm/model/react/useDashboardScheduledEmails.js.map +1 -1
- package/esm/model/store/automations/automationsReducers.d.ts +3 -2
- package/esm/model/store/automations/automationsReducers.d.ts.map +1 -1
- package/esm/model/store/automations/automationsReducers.js +2 -2
- package/esm/model/store/automations/automationsReducers.js.map +1 -1
- package/esm/model/store/automations/automationsSelectors.d.ts +31 -0
- package/esm/model/store/automations/automationsSelectors.d.ts.map +1 -1
- package/esm/model/store/automations/automationsSelectors.js +46 -1
- package/esm/model/store/automations/automationsSelectors.js.map +1 -1
- package/esm/model/store/automations/automationsState.d.ts +2 -1
- package/esm/model/store/automations/automationsState.d.ts.map +1 -1
- package/esm/model/store/automations/automationsState.js +1 -1
- package/esm/model/store/automations/automationsState.js.map +1 -1
- package/esm/model/store/automations/index.d.ts +2 -2
- package/esm/model/store/catalog/catalogSelectors.d.ts +23 -1
- package/esm/model/store/catalog/catalogSelectors.d.ts.map +1 -1
- package/esm/model/store/catalog/catalogSelectors.js +9 -3
- package/esm/model/store/catalog/catalogSelectors.js.map +1 -1
- package/esm/model/store/config/configSelectors.d.ts +10 -0
- package/esm/model/store/config/configSelectors.d.ts.map +1 -1
- package/esm/model/store/config/configSelectors.js +14 -0
- package/esm/model/store/config/configSelectors.js.map +1 -1
- package/esm/model/store/index.d.ts +4 -4
- package/esm/model/store/index.d.ts.map +1 -1
- package/esm/model/store/index.js +3 -3
- package/esm/model/store/index.js.map +1 -1
- package/esm/model/store/layout/index.d.ts +4 -0
- package/esm/model/store/layout/index.d.ts.map +1 -1
- package/esm/model/store/layout/layoutReducers.d.ts +6 -1
- package/esm/model/store/layout/layoutReducers.d.ts.map +1 -1
- package/esm/model/store/layout/layoutReducers.js +10 -0
- package/esm/model/store/layout/layoutReducers.js.map +1 -1
- package/esm/model/store/ui/index.d.ts +17 -0
- package/esm/model/store/ui/index.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.d.ts +18 -1
- package/esm/model/store/ui/uiReducers.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.js +23 -0
- package/esm/model/store/ui/uiReducers.js.map +1 -1
- package/esm/model/store/ui/uiSelectors.d.ts +17 -0
- package/esm/model/store/ui/uiSelectors.d.ts.map +1 -1
- package/esm/model/store/ui/uiSelectors.js +16 -0
- package/esm/model/store/ui/uiSelectors.js.map +1 -1
- package/esm/model/store/ui/uiState.d.ts +14 -0
- package/esm/model/store/ui/uiState.d.ts.map +1 -1
- package/esm/model/store/ui/uiState.js +10 -0
- package/esm/model/store/ui/uiState.js.map +1 -1
- package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts.map +1 -1
- package/esm/model/store/widgetDrills/widgetDrillSelectors.js +14 -11
- package/esm/model/store/widgetDrills/widgetDrillSelectors.js.map +1 -1
- package/esm/model/types/commonTypes.d.ts +2 -2
- package/esm/model/types/commonTypes.d.ts.map +1 -1
- package/esm/presentation/alerting/AlertingDialog.d.ts +7 -0
- package/esm/presentation/alerting/AlertingDialog.d.ts.map +1 -0
- package/esm/presentation/alerting/AlertingDialog.js +11 -0
- package/esm/presentation/alerting/AlertingDialog.js.map +1 -0
- package/esm/presentation/alerting/AlertingManagementDialog.d.ts +7 -0
- package/esm/presentation/alerting/AlertingManagementDialog.d.ts.map +1 -0
- package/esm/presentation/alerting/AlertingManagementDialog.js +11 -0
- package/esm/presentation/alerting/AlertingManagementDialog.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts +7 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +37 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/index.d.ts +2 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/index.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/index.js +3 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/index.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.d.ts +4 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.js +31 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/operator.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.d.ts +2 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.js +5 -0
- package/esm/presentation/alerting/DefaultAlertingDialog/utils/responsive.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.d.ts +7 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.js +59 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialog.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.d.ts +12 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.js +80 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/Alert.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.d.ts +4 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.js +51 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.d.ts +14 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.js +21 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/AlertsList.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.d.ts +12 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.js +29 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.d.ts +12 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.js +43 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.js.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.d.ts +2 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.d.ts.map +1 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.js +3 -0
- package/esm/presentation/alerting/DefaultAlertingManagementDialog/index.js.map +1 -0
- package/esm/presentation/alerting/index.d.ts +6 -0
- package/esm/presentation/alerting/index.d.ts.map +1 -0
- package/esm/presentation/alerting/index.js +6 -0
- package/esm/presentation/alerting/index.js.map +1 -0
- package/esm/presentation/alerting/types.d.ts +107 -0
- package/esm/presentation/alerting/types.d.ts.map +1 -0
- package/esm/presentation/alerting/types.js +2 -0
- package/esm/presentation/alerting/types.js.map +1 -0
- package/esm/presentation/constants/index.d.ts +1 -0
- package/esm/presentation/constants/index.d.ts.map +1 -1
- package/esm/presentation/constants/index.js +2 -1
- package/esm/presentation/constants/index.js.map +1 -1
- package/esm/presentation/constants/zIndex.d.ts +1 -0
- package/esm/presentation/constants/zIndex.d.ts.map +1 -1
- package/esm/presentation/constants/zIndex.js +3 -1
- package/esm/presentation/constants/zIndex.js.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.d.ts +3 -0
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.d.ts.map +1 -0
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.js +11 -0
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.js.map +1 -0
- package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.js +3 -1
- package/esm/presentation/dashboard/DashboardHeader/DashboardHeader.js.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.js +2 -5
- package/esm/presentation/dashboard/DashboardHeader/ScheduledEmailDialogProvider.js.map +1 -1
- package/esm/presentation/dashboard/components/DashboardRenderer.d.ts.map +1 -1
- package/esm/presentation/dashboard/components/DashboardRenderer.js +3 -1
- package/esm/presentation/dashboard/components/DashboardRenderer.js.map +1 -1
- package/esm/presentation/dashboard/types.d.ts +13 -0
- package/esm/presentation/dashboard/types.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/DashboardComponentsContext.d.ts +3 -0
- package/esm/presentation/dashboardContexts/DashboardComponentsContext.d.ts.map +1 -1
- package/esm/presentation/dashboardContexts/DashboardComponentsContext.js +2 -0
- package/esm/presentation/dashboardContexts/DashboardComponentsContext.js.map +1 -1
- package/esm/presentation/drill/types.d.ts +1 -0
- package/esm/presentation/drill/types.d.ts.map +1 -1
- package/esm/presentation/drill/types.js.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js +5 -8
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js +43 -12
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js.map +1 -1
- package/esm/presentation/index.d.ts +1 -0
- package/esm/presentation/index.d.ts.map +1 -1
- package/esm/presentation/index.js +2 -1
- package/esm/presentation/index.js.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.json +1 -0
- package/esm/presentation/localization/bundles/en-AU.json +475 -0
- package/esm/presentation/localization/bundles/en-GB.json +1 -0
- package/esm/presentation/localization/bundles/en-US.json +302 -2
- package/esm/presentation/localization/bundles/es-419.json +1 -0
- package/esm/presentation/localization/bundles/es-ES.json +1 -0
- package/esm/presentation/localization/bundles/fi-FI.json +475 -0
- package/esm/presentation/localization/bundles/fr-CA.json +1 -0
- package/esm/presentation/localization/bundles/fr-FR.json +1 -0
- package/esm/presentation/localization/bundles/it-IT.json +1 -0
- package/esm/presentation/localization/bundles/ja-JP.json +1 -0
- package/esm/presentation/localization/bundles/nl-NL.json +1 -0
- package/esm/presentation/localization/bundles/pt-BR.json +1 -0
- package/esm/presentation/localization/bundles/pt-PT.json +1 -0
- package/esm/presentation/localization/bundles/zh-HK.json +475 -0
- package/esm/presentation/localization/bundles/zh-Hans.json +1 -0
- package/esm/presentation/localization/bundles/zh-Hant.json +475 -0
- package/esm/presentation/localization/translations.d.ts.map +1 -1
- package/esm/presentation/localization/translations.js +8 -0
- package/esm/presentation/localization/translations.js.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.d.ts +2 -2
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.d.ts.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.js +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailDialog/components/DestinationSelect/DestinationSelect.js.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.d.ts.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.d.ts +2 -2
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.d.ts.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.js +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmail.js.map +1 -1
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmailsList.d.ts +2 -2
- package/esm/presentation/scheduledEmail/DefaultScheduledEmailManagementDialog/components/ScheduledEmailsList.d.ts.map +1 -1
- package/esm/presentation/scheduledEmail/types.d.ts +3 -3
- package/esm/presentation/scheduledEmail/types.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +166 -120
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js.map +1 -1
- package/esm/presentation/widget/common/configuration/ConfigurationBubble.d.ts +2 -1
- package/esm/presentation/widget/common/configuration/ConfigurationBubble.d.ts.map +1 -1
- package/esm/presentation/widget/common/configuration/ConfigurationBubble.js +3 -4
- package/esm/presentation/widget/common/configuration/ConfigurationBubble.js.map +1 -1
- package/esm/presentation/widget/common/useWidgetFilters.d.ts +1 -1
- package/esm/presentation/widget/common/useWidgetFilters.d.ts.map +1 -1
- package/esm/presentation/widget/common/useWidgetFilters.js +1 -1
- package/esm/presentation/widget/common/useWidgetFilters.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillTargets/DrillTargets.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillTargets/DrillTargets.js +1 -0
- package/esm/presentation/widget/insight/configuration/DrillTargets/DrillTargets.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.d.ts +12 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.js +77 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertActionsDropdown.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts +8 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js +25 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertComparisonOperatorSelect.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.d.ts +7 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.js +13 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDeleteDialog.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.d.ts +9 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.js +23 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertDestinationSelect.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.d.ts +9 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.js +26 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertMeasureSelect.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.d.ts +8 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.js +35 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertTriggerModeSelect.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.d.ts +18 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.js +31 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.d.ts +13 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js +16 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsListItem.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts +16 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.js +7 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/CreateAlert.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts +18 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js +57 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlert.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.d.ts +10 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.js +47 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts +20 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js +37 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/constants.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.d.ts +11 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.js +27 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts +21 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js +97 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.d.ts +28 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.js +179 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.d.ts +29 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.js +51 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.d.ts +11 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.js +27 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useUpdateAlert.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts +57 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js +59 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/messages.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts +16 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js +86 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/utils.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlerts.d.ts +4 -0
- package/esm/presentation/widget/insight/configuration/InsightAlerts.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlerts.js +38 -0
- package/esm/presentation/widget/insight/configuration/InsightAlerts.js.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.d.ts +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.js +23 -5
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigItem.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.d.ts +2 -2
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.js +25 -3
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/drillConfigMapper.js.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.d.ts +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.js +5 -4
- package/esm/presentation/widget/insight/configuration/InsightDrillConfigPanel/useInsightDrillConfigPanel.js.map +1 -1
- package/esm/presentation/widget/insight/index.d.ts +1 -0
- package/esm/presentation/widget/insight/index.d.ts.map +1 -1
- package/esm/presentation/widget/insight/index.js +2 -1
- package/esm/presentation/widget/insight/index.js.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.d.ts +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.js +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.d.ts +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.js +4 -3
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuHeader.js.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js +3 -3
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.d.ts +2 -0
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.js +28 -7
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/getDefaultInsightMenuItems.js.map +1 -1
- package/esm/presentation/widget/insightMenu/index.d.ts +1 -1
- package/esm/presentation/widget/insightMenu/index.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/types.d.ts +28 -6
- package/esm/presentation/widget/insightMenu/types.d.ts.map +1 -1
- package/esm/presentation/widget/kpi/ViewModeDashboardKpi/useKpiAlertOperations.d.ts.map +1 -1
- package/esm/presentation/widget/kpi/ViewModeDashboardKpi/useKpiAlertOperations.js +9 -20
- package/esm/presentation/widget/kpi/ViewModeDashboardKpi/useKpiAlertOperations.js.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js +8 -6
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.d.ts +2 -0
- package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.d.ts.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.js +13 -8
- package/esm/presentation/widget/widget/InsightWidget/useInsightMenu.js.map +1 -1
- package/esm/sdk-ui-dashboard.d.ts +401 -149
- package/esm/types.d.ts +9 -0
- package/esm/types.d.ts.map +1 -1
- package/esm/types.js.map +1 -1
- package/package.json +16 -15
- package/styles/css/alerting.css +286 -0
- package/styles/css/alerting.css.map +1 -0
- package/styles/css/configurationPanel.css +3 -0
- package/styles/css/configurationPanel.css.map +1 -1
- package/styles/css/dashboard.css +60 -5
- package/styles/css/dashboard.css.map +1 -1
- package/styles/css/icons.css +7 -0
- package/styles/css/icons.css.map +1 -1
- package/styles/css/main.css +355 -5
- package/styles/css/main.css.map +1 -1
- package/styles/css/scheduled_mail.css +60 -5
- package/styles/css/scheduled_mail.css.map +1 -1
- package/styles/scss/alerting.scss +292 -0
- package/styles/scss/configurationPanel.scss +5 -0
- package/styles/scss/icons.scss +9 -0
- package/styles/scss/main.scss +1 -0
- package/styles/scss/scheduled_mail.scss +69 -3
- package/esm/model/commandHandlers/alerts/removeAlertsHandler.d.ts +0 -6
- package/esm/model/commandHandlers/alerts/removeAlertsHandler.d.ts.map +0 -1
- package/esm/model/commandHandlers/alerts/removeAlertsHandler.js +0 -20
- package/esm/model/commandHandlers/alerts/removeAlertsHandler.js.map +0 -1
- package/esm/model/commandHandlers/alerts/updateAlertHandler.d.ts +0 -6
- package/esm/model/commandHandlers/alerts/updateAlertHandler.d.ts.map +0 -1
- package/esm/model/commandHandlers/alerts/updateAlertHandler.js +0 -17
- package/esm/model/commandHandlers/alerts/updateAlertHandler.js.map +0 -1
- package/esm/model/commandHandlers/alerts/validation/alertsValidation.d.ts +0 -20
- package/esm/model/commandHandlers/alerts/validation/alertsValidation.d.ts.map +0 -1
- package/esm/model/commandHandlers/alerts/validation/alertsValidation.js +0 -22
- 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,6BA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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"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.d.ts
ADDED
|
@@ -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"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/EditAlertConfiguration.js
ADDED
|
@@ -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,E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GAAG,YAAY,CAAC,KAAM;gCACtB,OAAO,EAAE;oCACL,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"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.d.ts
ADDED
|
@@ -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"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.js
ADDED
|
@@ -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
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useCreateAlert.js.map
ADDED
|
@@ -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"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts
ADDED
|
@@ -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
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts.map
ADDED
|
@@ -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"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js
ADDED
|
@@ -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
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEditAlert.js","sourceRoot":"","sources":["../../../../../../../src/present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,CAAC,KAAK,CAAC,CAAC;QACvB,wBAAwB,EAAE,CAAC;IAC/B,CAAC,CAAC;IAEF,MAAM,wBAAwB,GAAG,GAAG,EAAE;QAClC,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,QAAQ,EAAE,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,QAAQ,EAAE,CAAC,YAAyC,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,OAAO,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,KAAK,WAAW,CAAC;IAClF,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,cAAc,IAAI,cAAc,CAAC;IAEnD,OAAO;QACH,QAAQ;QACR,YAAY;QACZ,SAAS;QACT,EAAE;QACF,wBAAwB;QACxB,aAAa;QACb,WAAW;QACX,iBAAiB;QACjB,EAAE;QACF,cAAc;QACd,sBAAsB;QACtB,wBAAwB;QACxB,EAAE;QACF,WAAW;QACX,WAAW;KACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IAutomationMetadataObject, IAutomationMetadataObjectDefinition, IInsightWidget } from "@gooddata/sdk-model";
|
|
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"}
|
package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useInsightAlerting.js
ADDED
|
@@ -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
|