@gooddata/sdk-ui-dashboard 11.53.0-alpha.5 → 11.53.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -2
- package/esm/model/commandHandlers/dashboard/exportDashboardToPdfHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/exportDashboardToPdfHandler.js +3 -1
- package/esm/model/commandHandlers/dashboard/exportDashboardToPdfPresentationHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/exportDashboardToPdfPresentationHandler.js +3 -1
- package/esm/model/commandHandlers/dashboard/exportDashboardToPptPresentationHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/exportDashboardToPptPresentationHandler.js +3 -1
- package/esm/model/commandHandlers/dashboard/exportToTabularHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/exportToTabularHandler.js +5 -3
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +9 -2
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadExportTimezone.d.ts +12 -0
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadExportTimezone.d.ts.map +1 -0
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadExportTimezone.js +25 -0
- package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/timezone/changeDashboardTimezoneOverrideHandler.js +4 -3
- package/esm/model/commandHandlers/widgets/exportImageInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/exportImageInsightWidgetHandler.js +3 -1
- package/esm/model/commandHandlers/widgets/exportInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/exportInsightWidgetHandler.js +4 -2
- package/esm/model/commandHandlers/widgets/exportRawInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/exportRawInsightWidgetHandler.js +7 -1
- package/esm/model/commandHandlers/widgets/exportSlidesInsightWidgetHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/exportSlidesInsightWidgetHandler.js +3 -1
- package/esm/model/store/config/configSelectors.d.ts +6 -0
- package/esm/model/store/config/configSelectors.d.ts.map +1 -1
- package/esm/model/store/config/configSelectors.js +8 -0
- package/esm/model/store/meta/metaSelectors.d.ts +16 -0
- package/esm/model/store/meta/metaSelectors.d.ts.map +1 -1
- package/esm/model/store/meta/metaSelectors.js +28 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/utils/convertors.d.ts +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/utils/convertors.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/DefaultAlertingDialog/utils/convertors.js +6 -1
- package/esm/presentation/automations/alerting/state/useAlertFormState.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/useAlertFormState.js +6 -2
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.js +29 -3
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts +39 -0
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +33 -10
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/ScheduleTimezoneSelect/ScheduleTimezoneSelect.d.ts +15 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/ScheduleTimezoneSelect/ScheduleTimezoneSelect.d.ts.map +1 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/components/ScheduleTimezoneSelect/ScheduleTimezoneSelect.js +58 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useExportTimezones.d.ts +52 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useExportTimezones.d.ts.map +1 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useExportTimezones.js +46 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleTimezone.d.ts +47 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleTimezone.d.ts.map +1 -0
- package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduleTimezone.js +90 -0
- package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.js +21 -0
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportActionsContext.d.ts +2 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportActionsContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.d.ts +5 -2
- package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/exportDefinitions.d.ts +19 -2
- package/esm/presentation/automations/scheduledEmail/state/exportDefinitions.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/exportDefinitions.js +35 -2
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailExportSettings.d.ts +9 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailExportSettings.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailExportSettings.js +10 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFormState.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFormState.js +14 -2
- package/esm/presentation/automations/scheduledEmail/types.d.ts +64 -0
- package/esm/presentation/automations/scheduledEmail/types.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/ApplyLatestFiltersConfirmDialog.d.ts +12 -1
- package/esm/presentation/automations/shared/automationFilters/components/ApplyLatestFiltersConfirmDialog.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/ApplyLatestFiltersConfirmDialog.js +17 -2
- package/esm/presentation/dashboardSettingsDialog/DefaultDashboardSettingsDialog.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/DefaultDashboardSettingsDialog.js +3 -1
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.js +5 -6
- package/esm/presentation/filterBar/filterBar/useExecutionTimestampMessage.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/useExecutionTimestampMessage.js +6 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +48 -4
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +51 -7
- package/esm/presentation/timezoneDialog/TimezoneDialog.d.ts +1 -1
- package/esm/presentation/timezoneDialog/TimezoneDialog.d.ts.map +1 -1
- package/esm/presentation/timezoneDialog/TimezoneDialog.js +7 -6
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +6 -2
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts +4 -3
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.d.ts.map +1 -1
- package/esm/presentation/topBar/timezoneIndicator/TimezoneIndicator.js +10 -9
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertConfig/hooks/useEditAlert.js +6 -1
- package/esm/sdk-ui-dashboard.d.ts +134 -3
- package/package.json +21 -21
- package/styles/css/main.css +41 -0
- package/styles/css/main.css.map +1 -1
- package/styles/css/scheduleTimezone.css +30 -0
- package/styles/css/scheduleTimezone.css.map +1 -0
- package/styles/scss/main.scss +1 -0
- package/styles/scss/scheduleTimezone.scss +37 -0
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.test.d.ts +0 -2
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.test.d.ts.map +0 -1
- package/esm/presentation/automations/alerting/DefaultAlertingManagementDialog/components/PauseAlertRunner.test.js +0 -39
- package/esm/presentation/automations/connectors/AlertingConnector.test.d.ts +0 -2
- package/esm/presentation/automations/connectors/AlertingConnector.test.d.ts.map +0 -1
- package/esm/presentation/automations/connectors/AlertingConnector.test.js +0 -201
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.test.d.ts +0 -2
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.test.d.ts.map +0 -1
- package/esm/presentation/automations/connectors/ScheduledEmailConnector.test.js +0 -225
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.test.d.ts +0 -2
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.test.d.ts.map +0 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAlertingDialogContext.test.js +0 -95
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.test.d.ts +0 -2
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.test.d.ts.map +0 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.test.js +0 -185
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.d.ts +0 -2
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.d.ts.map +0 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailDialogContext.test.js +0 -175
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.test.d.ts +0 -2
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.test.d.ts.map +0 -1
- package/esm/presentation/automations/connectors/hooks/useBuildScheduledEmailManagementDialogContext.test.js +0 -48
- package/esm/presentation/automations/contexts/AutomationsContext.test.d.ts +0 -2
- package/esm/presentation/automations/contexts/AutomationsContext.test.d.ts.map +0 -1
- package/esm/presentation/automations/contexts/AutomationsContext.test.js +0 -9
- package/esm/presentation/automations/shared/automationFilters/components/AutomationDateFilter.test.d.ts +0 -2
- package/esm/presentation/automations/shared/automationFilters/components/AutomationDateFilter.test.d.ts.map +0 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationDateFilter.test.js +0 -159
- package/esm/presentation/export/DefaultDashboardExportVariables.test.d.ts +0 -2
- package/esm/presentation/export/DefaultDashboardExportVariables.test.d.ts.map +0 -1
- package/esm/presentation/export/DefaultDashboardExportVariables.test.js +0 -58
- package/esm/presentation/widget/insight/LayeredTableView.test.d.ts +0 -2
- package/esm/presentation/widget/insight/LayeredTableView.test.d.ts.map +0 -1
- package/esm/presentation/widget/insight/LayeredTableView.test.js +0 -149
- package/esm/presentation/widget/insight/configuration/InsightAlertsNew.test.d.ts +0 -2
- package/esm/presentation/widget/insight/configuration/InsightAlertsNew.test.d.ts.map +0 -1
- package/esm/presentation/widget/insight/configuration/InsightAlertsNew.test.js +0 -124
- package/esm/presentation/widget/insight/geoDefaultDisplayFormRefs.test.d.ts +0 -2
- package/esm/presentation/widget/insight/geoDefaultDisplayFormRefs.test.d.ts.map +0 -1
- package/esm/presentation/widget/insight/geoDefaultDisplayFormRefs.test.js +0 -139
- package/esm/presentation/widget/insight/insightToTable.test.d.ts +0 -2
- package/esm/presentation/widget/insight/insightToTable.test.d.ts.map +0 -1
- package/esm/presentation/widget/insight/insightToTable.test.js +0 -325
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2026 GoodData Corporation
|
|
3
|
-
import { render } from "@testing-library/react";
|
|
4
|
-
import { describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { selectConfig } from "../../model/store/config/configSelectors.js";
|
|
6
|
-
import { selectDashboardDescriptor } from "../../model/store/meta/metaSelectors.js";
|
|
7
|
-
import { selectIsInExportMode } from "../../model/store/renderMode/renderModeSelectors.js";
|
|
8
|
-
import { selectActiveTabExportParameters } from "../../model/store/tabs/parameters/parametersSelectors.js";
|
|
9
|
-
vi.mock("../../model/react/DashboardStoreProvider.js", () => ({
|
|
10
|
-
useDashboardSelector: vi.fn(),
|
|
11
|
-
}));
|
|
12
|
-
vi.mock("./hooks/useDashboardRelatedFilters.js", () => ({
|
|
13
|
-
useDashboardRelatedFilters: () => ({
|
|
14
|
-
dateFilters: [],
|
|
15
|
-
attributeFilters: [],
|
|
16
|
-
measureValueFilters: [],
|
|
17
|
-
isLoading: false,
|
|
18
|
-
isError: false,
|
|
19
|
-
isSuccess: true,
|
|
20
|
-
}),
|
|
21
|
-
}));
|
|
22
|
-
import { useDashboardSelector } from "../../model/react/DashboardStoreProvider.js";
|
|
23
|
-
import { DefaultDashboardExportVariables } from "./DefaultDashboardExportVariables.js";
|
|
24
|
-
// Scoping lives in the selector (tested separately); here we drive its output.
|
|
25
|
-
function mockSelectors(parameters) {
|
|
26
|
-
const values = new Map([
|
|
27
|
-
[selectIsInExportMode, true],
|
|
28
|
-
[selectActiveTabExportParameters, parameters],
|
|
29
|
-
[selectConfig, {}],
|
|
30
|
-
[selectDashboardDescriptor, {}],
|
|
31
|
-
]);
|
|
32
|
-
vi.mocked(useDashboardSelector).mockImplementation((selector) => values.get(selector));
|
|
33
|
-
}
|
|
34
|
-
function parameterEntries(container) {
|
|
35
|
-
return Array.from(container.querySelectorAll('[data-export-meta-filter-type="parameter"]')).map((node) => ({
|
|
36
|
-
name: node.querySelector('[data-export-meta-type="dashboard-filter-name"]')?.textContent ?? "",
|
|
37
|
-
value: node.querySelector('[data-export-meta-type="dashboard-filter-value"]')?.textContent ?? "",
|
|
38
|
-
// export-builder blocks on this per entry; missing/loading would hang the export.
|
|
39
|
-
status: node.getAttribute("data-export-meta-filter-status"),
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
describe("DefaultDashboardExportVariables", () => {
|
|
43
|
-
it("renders active parameter overrides as ready entries in the filters block", () => {
|
|
44
|
-
mockSelectors([{ id: "topn", title: "Top N", value: "5" }]);
|
|
45
|
-
const { container } = render(_jsx(DefaultDashboardExportVariables, { renderMode: "export" }));
|
|
46
|
-
expect(parameterEntries(container)).toEqual([{ name: "Top N", value: "5", status: "loaded" }]);
|
|
47
|
-
});
|
|
48
|
-
it("renders no parameter entries when there are no active overrides", () => {
|
|
49
|
-
mockSelectors([]);
|
|
50
|
-
const { container } = render(_jsx(DefaultDashboardExportVariables, { renderMode: "export" }));
|
|
51
|
-
expect(parameterEntries(container)).toHaveLength(0);
|
|
52
|
-
});
|
|
53
|
-
it("renders nothing outside export mode", () => {
|
|
54
|
-
mockSelectors([{ id: "topn", title: "Top N", value: "5" }]);
|
|
55
|
-
const { container } = render(_jsx(DefaultDashboardExportVariables, { renderMode: "view" }));
|
|
56
|
-
expect(container.firstChild).toBeNull();
|
|
57
|
-
});
|
|
58
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayeredTableView.test.d.ts","sourceRoot":"","sources":["../../../../src/presentation/widget/insight/LayeredTableView.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2026 GoodData Corporation
|
|
3
|
-
import { render, screen, waitFor } from "@testing-library/react";
|
|
4
|
-
import { IntlProvider } from "react-intl";
|
|
5
|
-
import { describe, expect, it, vi } from "vitest";
|
|
6
|
-
import { idRef, newAttribute, newMeasure } from "@gooddata/sdk-model";
|
|
7
|
-
import { BucketNames } from "@gooddata/sdk-ui";
|
|
8
|
-
import { LayeredTableView } from "./LayeredTableView.js";
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Mock InsightRenderer — we only care about tab structure, not actual chart
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
vi.mock("@gooddata/sdk-ui-ext", () => ({
|
|
13
|
-
InsightRenderer: (props) => (_jsx("div", { "data-testid": "insight-renderer", children: props.insight.insight.title })),
|
|
14
|
-
}));
|
|
15
|
-
// ---------------------------------------------------------------------------
|
|
16
|
-
// Mock UiTabs — renders a minimal tab structure we can test against
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
vi.mock("@gooddata/sdk-ui-kit", () => ({
|
|
19
|
-
UiTabs: (props) => (_jsx("div", { role: props.accessibilityConfig?.role ?? "tablist", "aria-label": props.accessibilityConfig?.ariaLabel, "data-testid": "ui-tabs", children: props.tabs.map((tab) => (_jsx("button", { id: tab.tabId, role: props.accessibilityConfig?.tabRole ?? "tab", "aria-selected": tab.id === props.selectedTabId, "aria-controls": tab.panelId, "aria-label": tab.ariaLabel ?? tab.label, onClick: () => props.onTabSelect(tab), children: tab.label }, tab.id))) })),
|
|
20
|
-
}));
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
|
-
// Helpers
|
|
23
|
-
// ---------------------------------------------------------------------------
|
|
24
|
-
const messages = {
|
|
25
|
-
"geochart.alternateView.tablist.label": "Layer tables",
|
|
26
|
-
};
|
|
27
|
-
function makeTableInsight(title) {
|
|
28
|
-
return {
|
|
29
|
-
insight: {
|
|
30
|
-
title,
|
|
31
|
-
visualizationUrl: "local:table",
|
|
32
|
-
buckets: [
|
|
33
|
-
{ localIdentifier: BucketNames.MEASURES, items: [newMeasure(idRef("m1"))] },
|
|
34
|
-
{
|
|
35
|
-
localIdentifier: BucketNames.ATTRIBUTE,
|
|
36
|
-
items: [newAttribute(idRef("a1", "displayForm"))],
|
|
37
|
-
},
|
|
38
|
-
{ localIdentifier: BucketNames.COLUMNS, items: [] },
|
|
39
|
-
],
|
|
40
|
-
filters: [],
|
|
41
|
-
sorts: [],
|
|
42
|
-
properties: {},
|
|
43
|
-
identifier: title,
|
|
44
|
-
uri: `/${title}`,
|
|
45
|
-
ref: idRef(title),
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function createLayerTables(count) {
|
|
50
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
51
|
-
layerId: i === 0 ? "root" : `layer-${i}`,
|
|
52
|
-
layerName: `Layer ${i + 1}`,
|
|
53
|
-
layerType: i % 2 === 0 ? "pushpin" : "area",
|
|
54
|
-
tableInsight: makeTableInsight(`Layer ${i + 1}`),
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
const baseProps = {
|
|
58
|
-
backend: {},
|
|
59
|
-
workspace: "test-ws",
|
|
60
|
-
widget: {},
|
|
61
|
-
drillableItems: undefined,
|
|
62
|
-
colorPalette: undefined,
|
|
63
|
-
config: {},
|
|
64
|
-
locale: "en-US",
|
|
65
|
-
ErrorComponent: () => _jsx("div", { children: "Error" }),
|
|
66
|
-
LoadingComponent: () => _jsx("div", { children: "Loading" }),
|
|
67
|
-
settings: undefined,
|
|
68
|
-
};
|
|
69
|
-
function renderComponent(layerTables) {
|
|
70
|
-
return render(_jsx(IntlProvider, { locale: "en-US", messages: messages, children: _jsx(LayeredTableView, { ...baseProps, layerTables: layerTables }) }));
|
|
71
|
-
}
|
|
72
|
-
// ---------------------------------------------------------------------------
|
|
73
|
-
// Tests
|
|
74
|
-
// ---------------------------------------------------------------------------
|
|
75
|
-
describe("LayeredTableView", () => {
|
|
76
|
-
it("renders UiTabs with correct number of tabs", () => {
|
|
77
|
-
renderComponent(createLayerTables(3));
|
|
78
|
-
expect(screen.getByTestId("ui-tabs")).toBeInTheDocument();
|
|
79
|
-
expect(screen.getAllByRole("tab")).toHaveLength(3);
|
|
80
|
-
});
|
|
81
|
-
it("passes accessible label to UiTabs", () => {
|
|
82
|
-
renderComponent(createLayerTables(2));
|
|
83
|
-
expect(screen.getByTestId("ui-tabs")).toHaveAttribute("aria-label", "Layer tables");
|
|
84
|
-
});
|
|
85
|
-
it("renders tabpanel for active layer", () => {
|
|
86
|
-
renderComponent(createLayerTables(3));
|
|
87
|
-
const panel = screen.getByRole("tabpanel");
|
|
88
|
-
expect(panel).toBeInTheDocument();
|
|
89
|
-
expect(screen.getByTestId("insight-renderer")).toHaveTextContent("Layer 1");
|
|
90
|
-
});
|
|
91
|
-
it("renders one panel per tab and keeps only active panel visible", () => {
|
|
92
|
-
renderComponent(createLayerTables(3));
|
|
93
|
-
const panels = screen.getAllByRole("tabpanel", { hidden: true });
|
|
94
|
-
expect(panels).toHaveLength(3);
|
|
95
|
-
expect(panels[0]).not.toHaveAttribute("hidden");
|
|
96
|
-
expect(panels[1]).toHaveAttribute("hidden");
|
|
97
|
-
expect(panels[2]).toHaveAttribute("hidden");
|
|
98
|
-
});
|
|
99
|
-
it("first tab is selected by default", () => {
|
|
100
|
-
renderComponent(createLayerTables(3));
|
|
101
|
-
const tabs = screen.getAllByRole("tab");
|
|
102
|
-
expect(tabs[0]).toHaveAttribute("aria-selected", "true");
|
|
103
|
-
expect(tabs[1]).toHaveAttribute("aria-selected", "false");
|
|
104
|
-
});
|
|
105
|
-
it("clicking a tab switches the active panel", async () => {
|
|
106
|
-
const { userEvent } = await import("@testing-library/user-event");
|
|
107
|
-
const user = userEvent.setup();
|
|
108
|
-
renderComponent(createLayerTables(3));
|
|
109
|
-
await user.click(screen.getAllByRole("tab")[1]);
|
|
110
|
-
expect(screen.getByTestId("insight-renderer")).toHaveTextContent("Layer 2");
|
|
111
|
-
});
|
|
112
|
-
it("tab labels show layer names", () => {
|
|
113
|
-
renderComponent(createLayerTables(2));
|
|
114
|
-
const tabs = screen.getAllByRole("tab");
|
|
115
|
-
expect(tabs[0]).toHaveTextContent("Layer 1");
|
|
116
|
-
expect(tabs[1]).toHaveTextContent("Layer 2");
|
|
117
|
-
});
|
|
118
|
-
it("tabs have aria-controls pointing to panel id", () => {
|
|
119
|
-
renderComponent(createLayerTables(2));
|
|
120
|
-
const panels = screen.getAllByRole("tabpanel", { hidden: true });
|
|
121
|
-
const panelMap = new Map(panels.map((panel) => [panel.id, panel]));
|
|
122
|
-
const tabs = screen.getAllByRole("tab");
|
|
123
|
-
tabs.forEach((tab) => {
|
|
124
|
-
const panelId = tab.getAttribute("aria-controls");
|
|
125
|
-
expect(panelId).toBeTruthy();
|
|
126
|
-
expect(tab).toHaveAttribute("id");
|
|
127
|
-
expect(panelMap.has(panelId)).toBe(true);
|
|
128
|
-
const panel = panelMap.get(panelId);
|
|
129
|
-
expect(panel).toHaveAttribute("aria-labelledby", tab.getAttribute("id"));
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
it("applies layered table view layout classes", () => {
|
|
133
|
-
renderComponent(createLayerTables(2));
|
|
134
|
-
const container = screen.getByTestId("ui-tabs").parentElement;
|
|
135
|
-
expect(container).toHaveClass("gd-layered-table-view");
|
|
136
|
-
expect(container.querySelector(".gd-layered-table-view__panels")).not.toBeNull();
|
|
137
|
-
});
|
|
138
|
-
it("moves focus to active panel after tab activation", async () => {
|
|
139
|
-
const { userEvent } = await import("@testing-library/user-event");
|
|
140
|
-
const user = userEvent.setup();
|
|
141
|
-
renderComponent(createLayerTables(3));
|
|
142
|
-
const tabs = screen.getAllByRole("tab");
|
|
143
|
-
await user.click(tabs[1]);
|
|
144
|
-
const panels = screen.getAllByRole("tabpanel", { hidden: true });
|
|
145
|
-
const activePanel = panels[1];
|
|
146
|
-
expect(activePanel).not.toHaveAttribute("hidden");
|
|
147
|
-
await waitFor(() => expect(activePanel).toHaveFocus());
|
|
148
|
-
});
|
|
149
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InsightAlertsNew.test.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/configuration/InsightAlertsNew.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,124 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"geoDefaultDisplayFormRefs.test.d.ts","sourceRoot":"","sources":["../../../../src/presentation/widget/insight/geoDefaultDisplayFormRefs.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
// (C) 2025-2026 GoodData Corporation
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { idRef, newAttribute, serializeObjRef, } from "@gooddata/sdk-model";
|
|
4
|
-
import { BucketNames, VisualizationTypes } from "@gooddata/sdk-ui";
|
|
5
|
-
import { getGeoDefaultDisplayFormRefs } from "./geoDefaultDisplayFormRefs.js";
|
|
6
|
-
function createDisplayForm(id, attributeId, { isDefault, isPrimary } = {}) {
|
|
7
|
-
return {
|
|
8
|
-
type: "displayForm",
|
|
9
|
-
title: id,
|
|
10
|
-
description: "",
|
|
11
|
-
uri: `/${id}`,
|
|
12
|
-
id,
|
|
13
|
-
ref: idRef(id, "displayForm"),
|
|
14
|
-
production: true,
|
|
15
|
-
deprecated: false,
|
|
16
|
-
unlisted: false,
|
|
17
|
-
attribute: idRef(attributeId, "attribute"),
|
|
18
|
-
...(isDefault ? { isDefault: true } : {}),
|
|
19
|
-
...(isPrimary ? { isPrimary: true } : {}),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function createCatalogAttribute(attributeId, displayForms) {
|
|
23
|
-
const attributeDisplayForms = displayForms;
|
|
24
|
-
return {
|
|
25
|
-
type: "attribute",
|
|
26
|
-
attribute: {
|
|
27
|
-
type: "attribute",
|
|
28
|
-
title: attributeId,
|
|
29
|
-
description: "",
|
|
30
|
-
uri: `/${attributeId}`,
|
|
31
|
-
id: attributeId,
|
|
32
|
-
ref: idRef(attributeId, "attribute"),
|
|
33
|
-
production: true,
|
|
34
|
-
deprecated: false,
|
|
35
|
-
unlisted: false,
|
|
36
|
-
displayForms: attributeDisplayForms,
|
|
37
|
-
},
|
|
38
|
-
defaultDisplayForm: attributeDisplayForms[0],
|
|
39
|
-
displayForms: attributeDisplayForms,
|
|
40
|
-
geoPinDisplayForms: [],
|
|
41
|
-
groups: [],
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function createInsight(visualizationUrl, buckets) {
|
|
45
|
-
return {
|
|
46
|
-
insight: {
|
|
47
|
-
title: "Test",
|
|
48
|
-
visualizationUrl,
|
|
49
|
-
buckets,
|
|
50
|
-
filters: [],
|
|
51
|
-
sorts: [],
|
|
52
|
-
properties: {},
|
|
53
|
-
identifier: "test",
|
|
54
|
-
uri: "/test",
|
|
55
|
-
ref: idRef("test"),
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
describe("getGeoDefaultDisplayFormRefs", () => {
|
|
60
|
-
it("maps choropleth area display form to default label", () => {
|
|
61
|
-
const defaultLabel = createDisplayForm("label.default", "attr", { isDefault: true });
|
|
62
|
-
const areaLabel = createDisplayForm("label.area", "attr");
|
|
63
|
-
const catalogAttributes = [createCatalogAttribute("attr", [defaultLabel, areaLabel])];
|
|
64
|
-
const insight = createInsight(`local:${VisualizationTypes.CHOROPLETH}`, [
|
|
65
|
-
{
|
|
66
|
-
localIdentifier: BucketNames.AREA,
|
|
67
|
-
items: [newAttribute(idRef("label.area", "displayForm"))],
|
|
68
|
-
},
|
|
69
|
-
]);
|
|
70
|
-
const settings = { enableGeoArea: true };
|
|
71
|
-
const result = getGeoDefaultDisplayFormRefs(insight, settings, catalogAttributes);
|
|
72
|
-
const key = serializeObjRef(idRef("label.area", "displayForm"));
|
|
73
|
-
expect(result?.get(key)).toEqual(defaultLabel.ref);
|
|
74
|
-
});
|
|
75
|
-
it("maps pushpin location display form to default label using preloaded attributes", () => {
|
|
76
|
-
const defaultLabel = createDisplayForm("label.default", "attr", { isDefault: true });
|
|
77
|
-
const locationLabel = createDisplayForm("label.location", "attr");
|
|
78
|
-
const preloaded = [
|
|
79
|
-
{
|
|
80
|
-
attribute: {
|
|
81
|
-
type: "attribute",
|
|
82
|
-
title: "attr",
|
|
83
|
-
description: "",
|
|
84
|
-
uri: "/attr",
|
|
85
|
-
id: "attr",
|
|
86
|
-
ref: idRef("attr", "attribute"),
|
|
87
|
-
production: true,
|
|
88
|
-
deprecated: false,
|
|
89
|
-
unlisted: false,
|
|
90
|
-
displayForms: [defaultLabel, locationLabel],
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
const insight = createInsight(`local:${VisualizationTypes.PUSHPIN}`, [
|
|
95
|
-
{
|
|
96
|
-
localIdentifier: BucketNames.LOCATION,
|
|
97
|
-
items: [newAttribute(idRef("label.location", "displayForm"))],
|
|
98
|
-
},
|
|
99
|
-
]);
|
|
100
|
-
const settings = { enableNewGeoPushpin: true };
|
|
101
|
-
const result = getGeoDefaultDisplayFormRefs(insight, settings, [], preloaded);
|
|
102
|
-
const key = serializeObjRef(idRef("label.location", "displayForm"));
|
|
103
|
-
expect(result?.get(key)).toEqual(defaultLabel.ref);
|
|
104
|
-
});
|
|
105
|
-
it("maps pushpin location display form using catalog geoPinDisplayForms", () => {
|
|
106
|
-
const defaultLabel = createDisplayForm("label.default", "attr", { isDefault: true });
|
|
107
|
-
const locationLabel = createDisplayForm("label.location", "attr");
|
|
108
|
-
const catalogAttributes = [
|
|
109
|
-
{
|
|
110
|
-
...createCatalogAttribute("attr", [defaultLabel]),
|
|
111
|
-
geoPinDisplayForms: [locationLabel],
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
const insight = createInsight(`local:${VisualizationTypes.PUSHPIN}`, [
|
|
115
|
-
{
|
|
116
|
-
localIdentifier: BucketNames.LOCATION,
|
|
117
|
-
items: [newAttribute(idRef("label.location", "displayForm"))],
|
|
118
|
-
},
|
|
119
|
-
]);
|
|
120
|
-
const settings = { enableNewGeoPushpin: true };
|
|
121
|
-
const result = getGeoDefaultDisplayFormRefs(insight, settings, catalogAttributes);
|
|
122
|
-
const key = serializeObjRef(idRef("label.location", "displayForm"));
|
|
123
|
-
expect(result?.get(key)).toEqual(defaultLabel.ref);
|
|
124
|
-
});
|
|
125
|
-
it("returns undefined when geo flags are off or insight is not geo", () => {
|
|
126
|
-
const defaultLabel = createDisplayForm("label.default", "attr", { isDefault: true });
|
|
127
|
-
const areaLabel = createDisplayForm("label.area", "attr");
|
|
128
|
-
const catalogAttributes = [createCatalogAttribute("attr", [defaultLabel, areaLabel])];
|
|
129
|
-
const insight = createInsight("local:bar", [
|
|
130
|
-
{
|
|
131
|
-
localIdentifier: BucketNames.ATTRIBUTE,
|
|
132
|
-
items: [newAttribute(idRef("label.area", "displayForm"))],
|
|
133
|
-
},
|
|
134
|
-
]);
|
|
135
|
-
const settings = { enableGeoArea: true };
|
|
136
|
-
expect(getGeoDefaultDisplayFormRefs(insight, settings, catalogAttributes)).toBeUndefined();
|
|
137
|
-
expect(getGeoDefaultDisplayFormRefs(insight, {}, catalogAttributes)).toBeUndefined();
|
|
138
|
-
});
|
|
139
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"insightToTable.test.d.ts","sourceRoot":"","sources":["../../../../src/presentation/widget/insight/insightToTable.test.ts"],"names":[],"mappings":""}
|