@gooddata/sdk-ui-dashboard 11.43.0-alpha.5 → 11.43.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/esm/__version.d.ts +1 -1
- package/esm/__version.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -2
- package/esm/presentation/automations/{_staging/alerting → alerting}/AlertingManagementDialog.d.ts +1 -1
- package/esm/presentation/automations/alerting/AlertingManagementDialog.d.ts.map +1 -0
- package/esm/presentation/automations/{_staging/alerting → alerting}/AlertingManagementDialog.js +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentBasic.d.ts.map +1 -0
- package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentBasic.js +8 -9
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.d.ts.map +1 -0
- package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.js +17 -29
- package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogNew.d.ts +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogNew.d.ts.map +1 -0
- package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogNew.js +9 -28
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/Alert.d.ts.map +1 -0
- package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/components/Alert.js +15 -18
- package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/components/AlertDropdown.d.ts +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/AlertsList.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.js +2 -2
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.js +31 -0
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.test.d.ts +2 -0
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.test.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.test.js +39 -0
- package/esm/presentation/automations/alerting/hooks/useAlertingDialogAccessibility.d.ts.map +1 -0
- package/esm/presentation/automations/alerting/hooks/useAlertingDialogAccessibility.js +11 -0
- package/esm/presentation/automations/connectors/AlertingConnector.d.ts +6 -3
- package/esm/presentation/automations/connectors/AlertingConnector.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/AlertingConnector.js +75 -12
- package/esm/presentation/automations/connectors/AlertingConnector.test.d.ts +2 -0
- package/esm/presentation/automations/connectors/AlertingConnector.test.d.ts.map +1 -0
- package/esm/presentation/automations/connectors/AlertingConnector.test.js +152 -0
- package/esm/presentation/automations/connectors/DefaultAlertingManagementDialogConnected.d.ts +11 -0
- package/esm/presentation/automations/connectors/DefaultAlertingManagementDialogConnected.d.ts.map +1 -0
- package/esm/presentation/automations/connectors/DefaultAlertingManagementDialogConnected.js +20 -0
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingManagementDialogContext.d.ts +3 -0
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingManagementDialogContext.d.ts.map +1 -0
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingManagementDialogContext.js +131 -0
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.js +4 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.test.js +2 -0
- package/esm/presentation/automations/contexts/AlertingManagementDialogContext.d.ts +27 -0
- package/esm/presentation/automations/contexts/AlertingManagementDialogContext.d.ts.map +1 -0
- package/esm/presentation/automations/contexts/AlertingManagementDialogContext.js +11 -0
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts +1 -0
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationDateFilter.test.js +1 -0
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardHeader/AlertingDialogProvider.js +3 -17
- package/esm/presentation/dashboard/components/DashboardRenderer.js +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/AlertsList.js +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlerts.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlerts.js +8 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertsNew.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertsNew.test.d.ts +2 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertsNew.test.d.ts.map +1 -0
- package/esm/presentation/widget/insight/configuration/InsightAlertsNew.test.js +124 -0
- package/esm/sdk-ui-dashboard.d.ts +6 -1
- package/package.json +20 -20
- package/esm/presentation/automations/_staging/alerting/AlertingManagementDialog.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentBasic.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogNew.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/Alert.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/AlertsList.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.d.ts +0 -11
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.js +0 -38
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.js +0 -50
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/hooks/useAlertValidation.d.ts +0 -7
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/hooks/useAlertValidation.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/hooks/useAlertValidation.js +0 -30
- package/esm/presentation/automations/_staging/alerting/hooks/useAlertingDialogAccessibility.d.ts.map +0 -1
- package/esm/presentation/automations/_staging/alerting/hooks/useAlertingDialogAccessibility.js +0 -12
- /package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentBasic.d.ts +0 -0
- /package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.d.ts +0 -0
- /package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/components/Alert.d.ts +0 -0
- /package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/components/AlertDropdown.js +0 -0
- /package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/components/AlertsList.d.ts +0 -0
- /package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/components/AlertsList.js +0 -0
- /package/esm/presentation/automations/{_staging/alerting → alerting}/DefaultAlertingManagementDialog/components/PauseAlertRunner.d.ts +0 -0
- /package/esm/presentation/automations/{_staging/alerting → alerting}/hooks/useAlertingDialogAccessibility.d.ts +0 -0
|
@@ -6,7 +6,7 @@ import { selectEnableAlertAttributes, selectEnableAlertOncePerInterval, selectEn
|
|
|
6
6
|
import { selectEntitlementMinimumRecurrenceMinutes, selectMaxAutomationRecipients, } from "../../../../model/store/entitlements/entitlementsSelectors.js";
|
|
7
7
|
import { selectAutomationAvailableDashboardFilters, selectAutomationCommonDateFilterId, selectAutomationDefaultSelectedFilters, selectAutomationFiltersByTab, selectDashboardFiltersWithoutCrossFiltering, selectDashboardHiddenFilters, selectDashboardLockedFilters, } from "../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
8
8
|
import { selectPersistedDashboardFilterContextDateFilterConfig } from "../../../../model/store/meta/metaSelectors.js";
|
|
9
|
-
import { selectCanManageWorkspace, selectCanUseAiAssistant, } from "../../../../model/store/permissions/permissionsSelectors.js";
|
|
9
|
+
import { selectCanCreateAutomation, selectCanManageWorkspace, selectCanUseAiAssistant, } from "../../../../model/store/permissions/permissionsSelectors.js";
|
|
10
10
|
import { selectAttributeFilterConfigsOverrides, selectAttributeFilterConfigsOverridesByTab, selectAttributeFilterConfigsSelectionTypeMap, selectAttributeFilterConfigsSelectionTypeMapByTab, } from "../../../../model/store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
|
|
11
11
|
import { selectDateFilterConfigOverridesByTab, selectEffectiveDateFilterAvailableGranularities, selectEffectiveDateFilterGranularitiesPerTab, selectEffectiveDateFilterOptions, selectEffectiveDateFilterOptionsPerTab, } from "../../../../model/store/tabs/dateFilterConfig/dateFilterConfigSelectors.js";
|
|
12
12
|
import { selectDateFilterConfigsOverrides, selectDateFilterConfigsOverridesByTab, } from "../../../../model/store/tabs/dateFilterConfigs/dateFilterConfigsSelectors.js";
|
|
@@ -57,6 +57,7 @@ export function useBuildAutomationsContext() {
|
|
|
57
57
|
const enableAlertOncePerInterval = useDashboardSelector(selectEnableAlertOncePerInterval);
|
|
58
58
|
const enableAnomalyDetectionAlert = useDashboardSelector(selectEnableAnomalyDetectionAlert);
|
|
59
59
|
const enableAutomationManagement = useDashboardSelector(selectEnableAutomationManagement);
|
|
60
|
+
const canCreateAutomation = useDashboardSelector(selectCanCreateAutomation);
|
|
60
61
|
const canUseAiAssistant = useDashboardSelector(selectCanUseAiAssistant);
|
|
61
62
|
const canManageWorkspace = useDashboardSelector(selectCanManageWorkspace);
|
|
62
63
|
const enableComparisonInAlerting = useDashboardSelector(selectEnableComparisonInAlerting);
|
|
@@ -76,6 +77,7 @@ export function useBuildAutomationsContext() {
|
|
|
76
77
|
getOptionsForTab: (tabId) => optionsPerTab[tabId],
|
|
77
78
|
}), [availableGranularities, dateFilterOptions, granularitiesPerTab, optionsPerTab]);
|
|
78
79
|
const features = useMemo(() => ({
|
|
80
|
+
canCreateAutomation,
|
|
79
81
|
enableAlertOncePerInterval,
|
|
80
82
|
enableAnomalyDetectionAlert,
|
|
81
83
|
enableAutomationManagement,
|
|
@@ -85,6 +87,7 @@ export function useBuildAutomationsContext() {
|
|
|
85
87
|
enableAlertAttributes,
|
|
86
88
|
canManageWorkspace,
|
|
87
89
|
}), [
|
|
90
|
+
canCreateAutomation,
|
|
88
91
|
enableAlertOncePerInterval,
|
|
89
92
|
enableAnomalyDetectionAlert,
|
|
90
93
|
enableAutomationManagement,
|
|
@@ -60,6 +60,7 @@ vi.mock("../../../../model/store/config/configSelectors.js", () => ({
|
|
|
60
60
|
selectWeekStart: () => "Sunday",
|
|
61
61
|
}));
|
|
62
62
|
vi.mock("../../../../model/store/permissions/permissionsSelectors.js", () => ({
|
|
63
|
+
selectCanCreateAutomation: () => true,
|
|
63
64
|
selectCanManageWorkspace: () => false,
|
|
64
65
|
selectCanUseAiAssistant: () => false,
|
|
65
66
|
}));
|
|
@@ -122,5 +123,6 @@ describe("useBuildAutomationsContext", () => {
|
|
|
122
123
|
expect(result.current.dateFilterConfig.getOptionsForTab("tab1")).toEqual(selectors.optionsPerTab["tab1"]);
|
|
123
124
|
expect(result.current.dateFilterConfig.getGranularitiesForTab("missing-tab")).toEqual([]);
|
|
124
125
|
expect(result.current.dateFilterConfig.getOptionsForTab("missing-tab")).toBeUndefined();
|
|
126
|
+
expect(result.current.features.canCreateAutomation).toBe(true);
|
|
125
127
|
});
|
|
126
128
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IAutomationMetadataObject, IInsight, IUser, IWidget, ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
/**
|
|
3
|
+
* Sub-context for the alerting management dialog.
|
|
4
|
+
* The connector hydrates this from dashboard state.
|
|
5
|
+
* The management dialog tree reads from this context instead of calling useDashboardSelector directly.
|
|
6
|
+
*/
|
|
7
|
+
export interface IAlertingManagementDialogContextValue {
|
|
8
|
+
currentUser?: IUser;
|
|
9
|
+
dashboardId?: string;
|
|
10
|
+
dashboardTitle?: string;
|
|
11
|
+
canManageWorkspace: boolean;
|
|
12
|
+
isAlertDialogOpen: boolean;
|
|
13
|
+
alertingDialogReturnFocusTo?: string;
|
|
14
|
+
managementDialogContext: {
|
|
15
|
+
widgetRef?: ObjRef;
|
|
16
|
+
};
|
|
17
|
+
automationsInvalidationId?: number;
|
|
18
|
+
isEmbedded: boolean;
|
|
19
|
+
enableAccessibilityMode: boolean;
|
|
20
|
+
getWidgetByRef: (ref: ObjRef | undefined) => IWidget | undefined;
|
|
21
|
+
getInsightByWidgetRef: (ref: ObjRef | undefined) => IInsight | undefined;
|
|
22
|
+
pauseAlert(alert: IAutomationMetadataObject): Promise<IAutomationMetadataObject>;
|
|
23
|
+
resumeAlert(alert: IAutomationMetadataObject): Promise<IAutomationMetadataObject>;
|
|
24
|
+
}
|
|
25
|
+
export declare const AlertingManagementDialogContextProvider: import("react").Provider<IAlertingManagementDialogContextValue | undefined>;
|
|
26
|
+
export declare function useAlertingManagementDialogContext(): IAlertingManagementDialogContextValue;
|
|
27
|
+
//# sourceMappingURL=AlertingManagementDialogContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertingManagementDialogContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/AlertingManagementDialogContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEvG;;;;GAIG;AACH,MAAM,WAAW,qCAAqC;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,uBAAuB,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,GAAG,SAAS,CAAC;IACjE,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,QAAQ,GAAG,SAAS,CAAC;IACzE,UAAU,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACjF,WAAW,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACrF;AAMD,eAAO,MAAM,uCAAuC,6EAA2C,CAAC;AAEhG,wBAAgB,kCAAkC,IAAI,qCAAqC,CAQ1F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const AlertingManagementDialogContext = createContext(undefined);
|
|
4
|
+
export const AlertingManagementDialogContextProvider = AlertingManagementDialogContext.Provider;
|
|
5
|
+
export function useAlertingManagementDialogContext() {
|
|
6
|
+
const ctx = useContext(AlertingManagementDialogContext);
|
|
7
|
+
if (!ctx) {
|
|
8
|
+
throw new Error("useAlertingManagementDialogContext must be used within AlertingManagementDialogContextProvider");
|
|
9
|
+
}
|
|
10
|
+
return ctx;
|
|
11
|
+
}
|
|
@@ -52,6 +52,7 @@ export interface IAutomationsContextValue {
|
|
|
52
52
|
isSecondaryTitleVisible: boolean;
|
|
53
53
|
externalRecipient: string | undefined;
|
|
54
54
|
features: {
|
|
55
|
+
canCreateAutomation: boolean;
|
|
55
56
|
enableAlertOncePerInterval: boolean;
|
|
56
57
|
enableAnomalyDetectionAlert: boolean;
|
|
57
58
|
enableAutomationManagement: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationsContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/AutomationsContext.ts"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"AutomationsContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/AutomationsContext.ts"],"names":[],"mappings":"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"}
|
|
@@ -61,6 +61,7 @@ function createAutomationsContextValue(overrides) {
|
|
|
61
61
|
isSecondaryTitleVisible: false,
|
|
62
62
|
externalRecipient: undefined,
|
|
63
63
|
features: {
|
|
64
|
+
canCreateAutomation: false,
|
|
64
65
|
enableAlertOncePerInterval: false,
|
|
65
66
|
enableAnomalyDetectionAlert: false,
|
|
66
67
|
enableAutomationManagement: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertingDialogProvider.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardHeader/AlertingDialogProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlertingDialogProvider.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardHeader/AlertingDialogProvider.tsx"],"names":[],"mappings":"AAOA,wBAAgB,sBAAsB,4CAMrC"}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
|
|
3
|
-
import { AlertingManagementDialog } from "../../automations/_staging/alerting/AlertingManagementDialog.js";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2022-2026 GoodData Corporation
|
|
4
3
|
import { AlertingAutomationsProvider, AlertingConnector, } from "../../automations/connectors/AlertingConnector.js";
|
|
5
4
|
export function AlertingDialogProvider() {
|
|
6
|
-
return (
|
|
7
|
-
_jsx(StagedManagementBridge, {}), _jsx(AlertingConnector, {})
|
|
8
|
-
] }));
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Renders the staged management dialog directly from Redux state.
|
|
12
|
-
* This bridge is removed in PR5 when management migrates out of _staging and into AlertingConnector.
|
|
13
|
-
*/
|
|
14
|
-
function StagedManagementBridge() {
|
|
15
|
-
const { isInitialized, isAlertManagementDialogOpen, automations, automationsLoading, automationsError, notificationChannels, onAlertingManagementClose, onAlertingManagementAdd, onAlertingManagementEdit, onAlertingManagementDeleteSuccess, onAlertingManagementDeleteError, onAlertingManagementPauseSuccess, onAlertingManagementPauseError, } = useDashboardAlerts();
|
|
16
|
-
if (!isInitialized || !isAlertManagementDialogOpen) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return (_jsx(AlertingManagementDialog, { automations: automations, notificationChannels: notificationChannels, alertDataError: automationsError, isLoadingAlertingData: automationsLoading, onAdd: onAlertingManagementAdd, onEdit: onAlertingManagementEdit, onClose: onAlertingManagementClose, onDeleteSuccess: onAlertingManagementDeleteSuccess, onDeleteError: onAlertingManagementDeleteError, onPauseSuccess: onAlertingManagementPauseSuccess, onPauseError: onAlertingManagementPauseError }));
|
|
5
|
+
return (_jsx(AlertingAutomationsProvider, { children: _jsx(AlertingConnector, {}) }));
|
|
20
6
|
}
|
|
@@ -6,8 +6,8 @@ import { BackendProvider, ErrorComponent as DefaultError, LoadingComponent as De
|
|
|
6
6
|
import { OverlayController, OverlayControllerProvider } from "@gooddata/sdk-ui-kit";
|
|
7
7
|
import { ThemeProvider } from "@gooddata/sdk-ui-theme-provider";
|
|
8
8
|
import { DashboardStoreProvider } from "../../../model/react/DashboardStoreProvider.js";
|
|
9
|
-
import { DefaultAlertingManagementDialogNew } from "../../automations/_staging/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogNew.js";
|
|
10
9
|
import { DefaultAlertingDialog } from "../../automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js";
|
|
10
|
+
import { DefaultAlertingManagementDialogNew } from "../../automations/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogNew.js";
|
|
11
11
|
import { DefaultScheduledEmailDialog } from "../../automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js";
|
|
12
12
|
import { ScheduledEmailManagementDialog as DefaultScheduledEmailManagementDialog } from "../../automations/scheduledEmail/DefaultScheduledEmailManagementDialog/DefaultScheduledEmailManagementDialog.js";
|
|
13
13
|
import { DASHBOARD_OVERLAYS_Z_INDEX } from "../../constants/zIndex.js";
|
|
@@ -4,7 +4,7 @@ import { useCallback, useState } from "react";
|
|
|
4
4
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
5
5
|
import Skeleton from "react-loading-skeleton";
|
|
6
6
|
import { AddButton, SeparatorLine, UiAutofocus, useIdPrefixed, useListWithActionsKeyboardNavigation, } from "@gooddata/sdk-ui-kit";
|
|
7
|
-
import { Alert } from "../../../../automations/
|
|
7
|
+
import { Alert } from "../../../../automations/alerting/DefaultAlertingManagementDialog/components/Alert.js";
|
|
8
8
|
import { DashboardInsightSubmenuContainer } from "../../../insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightSubmenuContainer.js";
|
|
9
9
|
const getItemAdditionalActions = () => {
|
|
10
10
|
return ["dropdown", "item"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightAlerts.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/configuration/InsightAlerts.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InsightAlerts.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/configuration/InsightAlerts.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAIpF,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,iCAAiC,2CAW7F"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2022-2026 GoodData Corporation
|
|
3
|
+
import { useBuildAlertingManagementDialogContext } from "../../../automations/connectors/hooks/useBuildAlertingManagementDialogContext.js";
|
|
4
|
+
import { useBuildAutomationsContext } from "../../../automations/connectors/hooks/useBuildAutomationsContext.js";
|
|
5
|
+
import { AlertingManagementDialogContextProvider } from "../../../automations/contexts/AlertingManagementDialogContext.js";
|
|
6
|
+
import { AutomationsContextProvider } from "../../../automations/contexts/AutomationsContext.js";
|
|
2
7
|
import { InsightAlertsNew } from "./InsightAlertsNew.js";
|
|
3
8
|
export function InsightAlerts({ widget, onClose, onGoBack }) {
|
|
4
|
-
|
|
9
|
+
const automationsCtx = useBuildAutomationsContext();
|
|
10
|
+
const managementCtx = useBuildAlertingManagementDialogContext();
|
|
11
|
+
return (_jsx(AutomationsContextProvider, { value: automationsCtx, children: _jsx(AlertingManagementDialogContextProvider, { value: managementCtx, children: _jsx(InsightAlertsNew, { widget: widget, onClose: onClose, onGoBack: onGoBack }) }) }));
|
|
5
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightAlertsNew.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/configuration/InsightAlertsNew.tsx"],"names":[],"mappings":"AAkDA,OAAO,EAAE,KAAK,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAQpF,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,iCAAiC,
|
|
1
|
+
{"version":3,"file":"InsightAlertsNew.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/configuration/InsightAlertsNew.tsx"],"names":[],"mappings":"AAkDA,OAAO,EAAE,KAAK,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAQpF,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,iCAAiC,2CAwKhG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InsightAlertsNew.test.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/configuration/InsightAlertsNew.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { render, screen } from "@testing-library/react";
|
|
4
|
+
import { describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { useAlertingManagementDialogContext } from "../../../automations/contexts/AlertingManagementDialogContext.js";
|
|
6
|
+
import { useAutomationsContext } from "../../../automations/contexts/AutomationsContext.js";
|
|
7
|
+
const fixtures = vi.hoisted(() => ({
|
|
8
|
+
automationsContext: { locale: "en-US" },
|
|
9
|
+
managementContext: {
|
|
10
|
+
canManageWorkspace: true,
|
|
11
|
+
currentUser: { login: "user" },
|
|
12
|
+
dashboardId: "dashboard-1",
|
|
13
|
+
dashboardTitle: "Dashboard",
|
|
14
|
+
isAlertDialogOpen: false,
|
|
15
|
+
managementDialogContext: {},
|
|
16
|
+
enableAccessibilityMode: false,
|
|
17
|
+
getWidgetByRef: () => undefined,
|
|
18
|
+
getInsightByWidgetRef: () => undefined,
|
|
19
|
+
pauseAlert: vi.fn(),
|
|
20
|
+
resumeAlert: vi.fn(),
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
23
|
+
vi.mock("@gooddata/sdk-ui", () => ({
|
|
24
|
+
fillMissingTitles: vi.fn((insight) => Promise.resolve(insight)),
|
|
25
|
+
useBackendStrict: () => ({ workspace: () => ({ automations: () => ({}) }) }),
|
|
26
|
+
useWorkspaceStrict: () => "workspace-id",
|
|
27
|
+
}));
|
|
28
|
+
vi.mock("@gooddata/sdk-ui-kit", async () => {
|
|
29
|
+
const actual = await vi.importActual("@gooddata/sdk-ui-kit");
|
|
30
|
+
return {
|
|
31
|
+
...actual,
|
|
32
|
+
OverlayController: { getInstance: () => ({}) },
|
|
33
|
+
OverlayControllerProvider: ({ children }) => children,
|
|
34
|
+
ScrollablePanel: ({ children }) => _jsx("div", { children: children }),
|
|
35
|
+
useToastMessage: () => ({ addSuccess: vi.fn(), addError: vi.fn() }),
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
vi.mock("../../../../model/react/DashboardStoreProvider.js", () => ({
|
|
39
|
+
useDashboardSelector: vi.fn((selector) => selector()),
|
|
40
|
+
}));
|
|
41
|
+
vi.mock("../../../../model/react/useDashboardAlerting/useDashboardAlerts.js", () => ({
|
|
42
|
+
useDashboardAlerts: () => ({ onAlertingOpen: vi.fn() }),
|
|
43
|
+
}));
|
|
44
|
+
vi.mock("../../../../model/react/useDashboardAutomations/useDashboardAutomations.js", () => ({
|
|
45
|
+
useDashboardAutomations: () => ({ refreshAutomations: vi.fn() }),
|
|
46
|
+
}));
|
|
47
|
+
vi.mock("../../../../model/store/automations/automationsSelectors.js", () => ({
|
|
48
|
+
selectAllAutomationsCount: () => 1,
|
|
49
|
+
selectAutomationsIsLoading: () => false,
|
|
50
|
+
selectDashboardUserAutomationAlertsInContext: () => () => [
|
|
51
|
+
{ id: "alert-1", title: "Alert 1", alert: { trigger: { state: "ACTIVE" } } },
|
|
52
|
+
],
|
|
53
|
+
}));
|
|
54
|
+
vi.mock("../../../../model/store/catalog/catalogSelectors.js", () => ({
|
|
55
|
+
selectCatalogDateDatasets: () => [],
|
|
56
|
+
}));
|
|
57
|
+
vi.mock("../../../../model/store/config/configSelectors.js", () => ({
|
|
58
|
+
selectEnableComparisonInAlerting: () => false,
|
|
59
|
+
selectLocale: () => "en-US",
|
|
60
|
+
}));
|
|
61
|
+
vi.mock("../../../../model/store/entitlements/entitlementsSelectors.js", () => ({
|
|
62
|
+
selectEntitlementMaxAutomations: () => ({ value: "10" }),
|
|
63
|
+
selectEntitlementUnlimitedAutomations: () => false,
|
|
64
|
+
}));
|
|
65
|
+
vi.mock("../../../../model/store/insights/insightsSelectors.js", () => ({
|
|
66
|
+
selectInsightByWidgetRef: () => () => ({ insight: { identifier: "insight-1" } }),
|
|
67
|
+
}));
|
|
68
|
+
vi.mock("../../../../model/store/permissions/permissionsSelectors.js", () => ({
|
|
69
|
+
selectCanCreateAutomation: () => true,
|
|
70
|
+
selectCanManageWorkspace: () => true,
|
|
71
|
+
}));
|
|
72
|
+
vi.mock("../../../../model/store/ui/uiSelectors.js", () => ({
|
|
73
|
+
selectExecutionTimestamp: () => undefined,
|
|
74
|
+
}));
|
|
75
|
+
vi.mock("../../../../model/store/user/userSelectors.js", () => ({
|
|
76
|
+
selectCurrentUser: () => ({ login: "user" }),
|
|
77
|
+
}));
|
|
78
|
+
vi.mock("../../../automations/alerting/DefaultAlertingDialog/components/AlertDeleteDialog.js", () => ({
|
|
79
|
+
AlertDeleteDialog: () => null,
|
|
80
|
+
}));
|
|
81
|
+
vi.mock("../../../automations/alerting/DefaultAlertingDialog/messages.js", () => ({
|
|
82
|
+
messages: {
|
|
83
|
+
alertPauseSuccess: { id: "alert.pause.success" },
|
|
84
|
+
alertResumeSuccess: { id: "alert.resume.success" },
|
|
85
|
+
alertSaveError: { id: "alert.save.error" },
|
|
86
|
+
alertDeleteSuccess: { id: "alert.delete.success" },
|
|
87
|
+
alertDeleteError: { id: "alert.delete.error" },
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
90
|
+
vi.mock("../../../automations/alerting/DefaultAlertingDialog/utils/items.js", () => ({
|
|
91
|
+
getSupportedInsightMeasuresByInsight: () => [{ id: "measure-1" }],
|
|
92
|
+
}));
|
|
93
|
+
vi.mock("../../../automations/contexts/AutomationsContext.js", () => ({
|
|
94
|
+
useAutomationsContext: () => fixtures.automationsContext,
|
|
95
|
+
AutomationsContextProvider: ({ children }) => children,
|
|
96
|
+
}));
|
|
97
|
+
vi.mock("../../../automations/contexts/AlertingManagementDialogContext.js", () => ({
|
|
98
|
+
useAlertingManagementDialogContext: () => fixtures.managementContext,
|
|
99
|
+
AlertingManagementDialogContextProvider: ({ children }) => children,
|
|
100
|
+
}));
|
|
101
|
+
vi.mock("./InsightAlertConfig/hooks/useSaveAlertToBackend.js", () => ({
|
|
102
|
+
useSaveAlertToBackend: () => ({
|
|
103
|
+
handlePauseAlert: vi.fn(),
|
|
104
|
+
handleResumeAlert: vi.fn(),
|
|
105
|
+
isSavingAlert: false,
|
|
106
|
+
}),
|
|
107
|
+
}));
|
|
108
|
+
vi.mock("./InsightAlertConfig/AlertsList.js", () => ({
|
|
109
|
+
AlertsList: () => {
|
|
110
|
+
useAutomationsContext();
|
|
111
|
+
useAlertingManagementDialogContext();
|
|
112
|
+
return _jsx("div", { children: "alerts list" });
|
|
113
|
+
},
|
|
114
|
+
}));
|
|
115
|
+
vi.mock("./InsightAlertConfig/NoAvailableAlerts.js", () => ({
|
|
116
|
+
NoAvailableMeasures: () => _jsx("div", { children: "no measures" }),
|
|
117
|
+
}));
|
|
118
|
+
import { InsightAlertsNew } from "./InsightAlertsNew.js";
|
|
119
|
+
describe("InsightAlertsNew", () => {
|
|
120
|
+
it("renders the alerts list when automation contexts are provided", () => {
|
|
121
|
+
render(_jsx(InsightAlertsNew, { widget: { ref: { identifier: "widget-1" }, localIdentifier: "widget-1" }, onClose: vi.fn(), onGoBack: vi.fn() }));
|
|
122
|
+
expect(screen.getByText("alerts list")).toBeInTheDocument();
|
|
123
|
+
});
|
|
124
|
+
});
|
|
@@ -3767,9 +3767,14 @@ export declare const DEFAULT_TAB_ID = "defaultTabId";
|
|
|
3767
3767
|
export declare function DefaultAlertingDialog(props: IAlertingDialogProps): JSX.Element;
|
|
3768
3768
|
|
|
3769
3769
|
/**
|
|
3770
|
+
* Self-contained version of DefaultAlertingManagementDialogNew that builds the required
|
|
3771
|
+
* AutomationsContext and AlertingManagementDialogContext internally from the dashboard
|
|
3772
|
+
* Redux store. Use this export when mounting the management dialog outside of
|
|
3773
|
+
* AlertingConnector (e.g. embedding scenarios, storybooks, or custom dashboard shells).
|
|
3774
|
+
*
|
|
3770
3775
|
* @alpha
|
|
3771
3776
|
*/
|
|
3772
|
-
export declare function DefaultAlertingManagementDialogNew(
|
|
3777
|
+
export declare function DefaultAlertingManagementDialogNew(props: IAlertingManagementDialogProps): JSX.Element;
|
|
3773
3778
|
|
|
3774
3779
|
/**
|
|
3775
3780
|
* @alpha
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-dashboard",
|
|
3
|
-
"version": "11.43.0
|
|
3
|
+
"version": "11.43.0",
|
|
4
4
|
"description": "GoodData SDK - Dashboard Component",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -60,19 +60,19 @@
|
|
|
60
60
|
"ts-invariant": "0.10.3",
|
|
61
61
|
"tslib": "2.8.1",
|
|
62
62
|
"uuid": "11.1.1",
|
|
63
|
-
"@gooddata/sdk-backend-base": "11.43.0
|
|
64
|
-
"@gooddata/sdk-backend-spi": "11.43.0
|
|
65
|
-
"@gooddata/sdk-
|
|
66
|
-
"@gooddata/sdk-
|
|
67
|
-
"@gooddata/sdk-ui
|
|
68
|
-
"@gooddata/sdk-ui-filters": "11.43.0
|
|
69
|
-
"@gooddata/sdk-ui-ext": "11.43.0
|
|
70
|
-
"@gooddata/sdk-ui-
|
|
71
|
-
"@gooddata/sdk-ui-
|
|
72
|
-
"@gooddata/sdk-ui-
|
|
73
|
-
"@gooddata/sdk-ui-
|
|
74
|
-
"@gooddata/
|
|
75
|
-
"@gooddata/
|
|
63
|
+
"@gooddata/sdk-backend-base": "11.43.0",
|
|
64
|
+
"@gooddata/sdk-backend-spi": "11.43.0",
|
|
65
|
+
"@gooddata/sdk-ui-charts": "11.43.0",
|
|
66
|
+
"@gooddata/sdk-model": "11.43.0",
|
|
67
|
+
"@gooddata/sdk-ui": "11.43.0",
|
|
68
|
+
"@gooddata/sdk-ui-filters": "11.43.0",
|
|
69
|
+
"@gooddata/sdk-ui-ext": "11.43.0",
|
|
70
|
+
"@gooddata/sdk-ui-geo": "11.43.0",
|
|
71
|
+
"@gooddata/sdk-ui-kit": "11.43.0",
|
|
72
|
+
"@gooddata/sdk-ui-pivot": "11.43.0",
|
|
73
|
+
"@gooddata/sdk-ui-theme-provider": "11.43.0",
|
|
74
|
+
"@gooddata/sdk-ui-vis-commons": "11.43.0",
|
|
75
|
+
"@gooddata/util": "11.43.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -118,12 +118,12 @@
|
|
|
118
118
|
"typescript": "5.9.3",
|
|
119
119
|
"vitest": "4.1.8",
|
|
120
120
|
"vitest-dom": "0.1.1",
|
|
121
|
-
"@gooddata/eslint-config": "11.43.0
|
|
122
|
-
"@gooddata/i18n-toolkit": "11.43.0
|
|
123
|
-
"@gooddata/oxlint-config": "11.43.0
|
|
124
|
-
"@gooddata/reference-workspace": "11.43.0
|
|
125
|
-
"@gooddata/sdk-backend-mockingbird": "11.43.0
|
|
126
|
-
"@gooddata/stylelint-config": "11.43.0
|
|
121
|
+
"@gooddata/eslint-config": "11.43.0",
|
|
122
|
+
"@gooddata/i18n-toolkit": "11.43.0",
|
|
123
|
+
"@gooddata/oxlint-config": "11.43.0",
|
|
124
|
+
"@gooddata/reference-workspace": "11.43.0",
|
|
125
|
+
"@gooddata/sdk-backend-mockingbird": "11.43.0",
|
|
126
|
+
"@gooddata/stylelint-config": "11.43.0"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
129
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertingManagementDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/_staging/alerting/AlertingManagementDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAE9E;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,8BAA8B,GAAG,YAAY,CAI5F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAlertingManagementDialogContentBasic.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentBasic.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAuBrE,UAAU,iDAAiD;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,yBAAyB,EAAE,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAgB,2CAA2C,CAAC,EACxD,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,qBAAqB,EACrB,WAAW,EACd,EAAE,iDAAiD,2CAmEnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAlertingManagementDialogContentEnhanced.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogContentEnhanced.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AA4CrE,UAAU,oDAAoD;IAC1D,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACtD;AAED;;GAEG;AACH,wBAAgB,8CAA8C,CAAC,EAC3D,KAAK,EACL,OAAO,EACP,MAAM,EACT,EAAE,oDAAoD,2CA6ItD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAlertingManagementDialogNew.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/DefaultAlertingManagementDialogNew.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAOjF;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,EAC/C,cAAc,EACd,YAAY,EACZ,MAAM,EACN,KAAK,EACL,eAAe,EACf,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,WAAW,EACd,EAAE,8BAA8B,2CAmGhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/Alert.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,yBAAyB,EAAmB,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAQH,kBAAkB,EAKrB,MAAM,sBAAsB,CAAC;AAY9B,UAAU,WAAW;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,EAAE,yBAAyB,CAAC;IACjC,aAAa,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,kBAAkB,CAAC;IAChE,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAkBD,wBAAgB,KAAK,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,iBAAiB,EACpB,EAAE,WAAW,2CA6Jb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDropdown.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/AlertDropdown.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAyBzE,wBAAgB,aAAa,CAAC,EAC1B,UAAU,EACV,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACX,EAAE,mBAAmB,2CA4DrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertsList.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/AlertsList.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAMrE,UAAU,YAAY;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,yBAAyB,EAAE,CAAC;IACpC,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAMD,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,YAAY,2CAkFvG"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type IAutomationMetadataObject } from "@gooddata/sdk-model";
|
|
2
|
-
import { type GoodDataSdkError } from "@gooddata/sdk-ui";
|
|
3
|
-
interface IDeleteAlertConfirmDialogProps {
|
|
4
|
-
alert: IAutomationMetadataObject;
|
|
5
|
-
onCancel: () => void;
|
|
6
|
-
onSuccess?: (alert: IAutomationMetadataObject) => void;
|
|
7
|
-
onError?: (error: GoodDataSdkError) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare function DeleteAlertConfirmDialog({ alert, onCancel, onSuccess, onError }: IDeleteAlertConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=DeleteAlertConfirmDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAlertConfirmDialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/DeleteAlertConfirmDialog.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,gBAAgB,EAAsD,MAAM,kBAAkB,CAAC;AAO7G,UAAU,8BAA8B;IACpC,KAAK,EAAE,yBAAyB,CAAC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC/C;AAED,wBAAgB,wBAAwB,CAAC,EACrC,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACV,EAAE,8BAA8B,2CAyDhC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FormattedMessage, useIntl } from "react-intl";
|
|
3
|
-
import { convertError, useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
4
|
-
import { ConfirmDialog } from "@gooddata/sdk-ui-kit";
|
|
5
|
-
import { useDashboardSelector } from "../../../../../../model/react/DashboardStoreProvider.js";
|
|
6
|
-
import { selectCanManageWorkspace } from "../../../../../../model/store/permissions/permissionsSelectors.js";
|
|
7
|
-
import { selectCurrentUser } from "../../../../../../model/store/user/userSelectors.js";
|
|
8
|
-
export function DeleteAlertConfirmDialog({ alert, onCancel, onSuccess, onError, }) {
|
|
9
|
-
const effectiveBackend = useBackendStrict();
|
|
10
|
-
const effectiveWorkspace = useWorkspaceStrict();
|
|
11
|
-
const intl = useIntl();
|
|
12
|
-
const currentUser = useDashboardSelector(selectCurrentUser);
|
|
13
|
-
const canManageAutomations = useDashboardSelector(selectCanManageWorkspace);
|
|
14
|
-
const handleDeleteAlert = async () => {
|
|
15
|
-
try {
|
|
16
|
-
const alertCreatorId = alert.createdBy?.login;
|
|
17
|
-
const currentUserId = currentUser?.login;
|
|
18
|
-
const isAlertCreatedByCurrentUser = !!alertCreatorId && !!currentUserId && alertCreatorId === currentUserId;
|
|
19
|
-
const automationService = effectiveBackend.workspace(effectiveWorkspace).automations();
|
|
20
|
-
// If alert is created by current user, or user has permissions to manage automations, delete it, otherwise unsubscribe
|
|
21
|
-
const deleteMethod = canManageAutomations || isAlertCreatedByCurrentUser
|
|
22
|
-
? automationService.deleteAutomation.bind(automationService)
|
|
23
|
-
: automationService.unsubscribeAutomation.bind(automationService);
|
|
24
|
-
await deleteMethod(alert.id);
|
|
25
|
-
onSuccess?.(alert);
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
onError?.(convertError(err));
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
return (_jsx(ConfirmDialog, { displayCloseButton: true, isPositive: false, headline: intl.formatMessage({ id: "dialogs.alerting.management.delete.dialog" }), cancelButtonText: intl.formatMessage({ id: "cancel" }), submitButtonText: intl.formatMessage({ id: "delete" }), onSubmit: () => {
|
|
32
|
-
void handleDeleteAlert();
|
|
33
|
-
}, onClose: onCancel, onCancel: onCancel, className: "gd-notifications-channel-delete-dialog s-alert-delete-dialog", containerClassName: "gd-notifications-channel-delete-dialog-overlay", children: _jsx("span", { className: "s-alert-delete-dialog-content", children: _jsx(FormattedMessage, { id: "dialogs.alerting.management.delete.dialog.confirm", values: {
|
|
34
|
-
b: (chunks) => (_jsxs("span", { className: "gd-notifications-channel-delete-dialog-text", children: [chunks, " ",
|
|
35
|
-
_jsx("strong", { children: alert.title })
|
|
36
|
-
] })),
|
|
37
|
-
} }) }) }));
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PauseAlertRunner.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EAC3C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,kBAAkB,CAAC;AAIvE,UAAU,sBAAsB;IAC5B,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACxC,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,CACR,KAAK,EAAE,yBAAyB,GAAG,mCAAmC,EACtE,KAAK,EAAE,OAAO,KACb,IAAI,CAAC;IACV,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,sBAAsB,QAgD5F"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import { useCallback, useEffect } from "react";
|
|
3
|
-
import { convertError } from "@gooddata/sdk-ui";
|
|
4
|
-
import { useSaveAlertToBackend } from "../../../../../widget/insight/configuration/InsightAlertConfig/hooks/useSaveAlertToBackend.js";
|
|
5
|
-
export function PauseAlertRunner({ alert, pause, onSuccess, onError }) {
|
|
6
|
-
const { handlePauseAlert, handleResumeAlert } = useSaveAlertToBackend({
|
|
7
|
-
onPauseSuccess: () => {
|
|
8
|
-
if (alert) {
|
|
9
|
-
onSuccess?.(alert, true);
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
onPauseError: (error) => {
|
|
13
|
-
onError?.(convertError(error), true);
|
|
14
|
-
},
|
|
15
|
-
onResumeSuccess: () => {
|
|
16
|
-
if (alert) {
|
|
17
|
-
onSuccess?.(alert, false);
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
onResumeError: () => {
|
|
21
|
-
if (alert) {
|
|
22
|
-
onSuccess?.(alert, false);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
const handlerPauseAlert = useCallback(() => {
|
|
27
|
-
if (!alert) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (pause) {
|
|
31
|
-
const alertToPause = {
|
|
32
|
-
...alert,
|
|
33
|
-
alert: { ...alert.alert, trigger: { ...alert.alert?.trigger, state: "PAUSED" } },
|
|
34
|
-
};
|
|
35
|
-
handlePauseAlert(alertToPause);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
const alertToResume = {
|
|
39
|
-
...alert,
|
|
40
|
-
alert: { ...alert.alert, trigger: { ...alert.alert?.trigger, state: "ACTIVE" } },
|
|
41
|
-
};
|
|
42
|
-
handleResumeAlert(alertToResume);
|
|
43
|
-
}
|
|
44
|
-
}, [alert, handlePauseAlert, handleResumeAlert, pause]);
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
handlerPauseAlert();
|
|
47
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
-
}, [alert]);
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type IAutomationMetadataObject } from "@gooddata/sdk-model";
|
|
2
|
-
export type AlertInvalidityReason = "missingMetric" | "missingWidget";
|
|
3
|
-
export declare const useAlertValidation: (alert: IAutomationMetadataObject | undefined, isNewAlert?: boolean | undefined) => {
|
|
4
|
-
isValid: boolean;
|
|
5
|
-
invalidityReason: AlertInvalidityReason | undefined;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=useAlertValidation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAlertValidation.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/automations/_staging/alerting/DefaultAlertingManagementDialog/hooks/useAlertValidation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAUrE,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG,eAAe,CAAC;AAEtE,eAAO,MAAM,kBAAkB;;;CAgC9B,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// (C) 2024-2026 GoodData Corporation
|
|
2
|
-
import { useDashboardSelector } from "../../../../../../model/react/DashboardStoreProvider.js";
|
|
3
|
-
import { selectCatalogDateDatasets } from "../../../../../../model/store/catalog/catalogSelectors.js";
|
|
4
|
-
import { selectEnableComparisonInAlerting } from "../../../../../../model/store/config/configSelectors.js";
|
|
5
|
-
import { selectInsightByWidgetRef } from "../../../../../../model/store/insights/insightsSelectors.js";
|
|
6
|
-
import { selectWidgetByRef } from "../../../../../../model/store/tabs/layout/layoutSelectors.js";
|
|
7
|
-
import { getAlertMeasure } from "../../../../alerting/DefaultAlertingDialog/utils/getters.js";
|
|
8
|
-
import { getSupportedInsightMeasuresByInsight } from "../../../../alerting/DefaultAlertingDialog/utils/items.js";
|
|
9
|
-
export const useAlertValidation = (alert, isNewAlert) => {
|
|
10
|
-
const widgetLocalId = alert?.metadata?.widget;
|
|
11
|
-
const widgetRef = widgetLocalId ? { identifier: widgetLocalId } : undefined;
|
|
12
|
-
const canManageComparison = useDashboardSelector(selectEnableComparisonInAlerting);
|
|
13
|
-
const widget = useDashboardSelector(selectWidgetByRef(widgetRef));
|
|
14
|
-
const insight = useDashboardSelector(selectInsightByWidgetRef(widget?.ref));
|
|
15
|
-
const dateDatasets = useDashboardSelector(selectCatalogDateDatasets);
|
|
16
|
-
const supportedMeasures = getSupportedInsightMeasuresByInsight(insight, dateDatasets, canManageComparison, alert);
|
|
17
|
-
const selectedMeasureExists = alert ? getAlertMeasure(supportedMeasures, alert.alert) : undefined;
|
|
18
|
-
const isValid = isNewAlert || Boolean(!!widget && selectedMeasureExists);
|
|
19
|
-
let invalidityReason = undefined;
|
|
20
|
-
if (!widget) {
|
|
21
|
-
invalidityReason = "missingWidget";
|
|
22
|
-
}
|
|
23
|
-
else if (!selectedMeasureExists) {
|
|
24
|
-
invalidityReason = "missingMetric";
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
isValid,
|
|
28
|
-
invalidityReason,
|
|
29
|
-
};
|
|
30
|
-
};
|
package/esm/presentation/automations/_staging/alerting/hooks/useAlertingDialogAccessibility.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAlertingDialogAccessibility.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/_staging/alerting/hooks/useAlertingDialogAccessibility.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,8BAA8B;;CAW1C,CAAC"}
|