@gooddata/sdk-ui-dashboard 11.60.0-alpha.2 → 11.60.0-alpha.4
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/internal.d.ts +3 -0
- package/esm/internal.d.ts.map +1 -1
- package/esm/internal.js +3 -0
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/initializeAutomationsHandler.js +11 -3
- package/esm/model/commandHandlers/scheduledEmail/loadAutomations.d.ts +8 -1
- package/esm/model/commandHandlers/scheduledEmail/loadAutomations.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/loadAutomations.js +3 -2
- package/esm/model/commandHandlers/scheduledEmail/refreshAutomationsHandlers.d.ts.map +1 -1
- package/esm/model/commandHandlers/scheduledEmail/refreshAutomationsHandlers.js +9 -2
- package/esm/model/store/dashboardStore.d.ts +2 -2
- package/esm/model/store/unavailableObjects/index.d.ts +1 -1
- package/esm/model/store/unavailableObjects/unavailableObjectsEntityAdapter.d.ts +1 -2
- package/esm/model/store/unavailableObjects/unavailableObjectsEntityAdapter.d.ts.map +1 -1
- package/esm/model/store/widgetDrills/drillRestrictionSelectors.d.ts +3 -3
- package/esm/model/store/widgetDrills/drillRestrictionSelectors.d.ts.map +1 -1
- package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts +36 -2
- package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts.map +1 -1
- package/esm/model/store/widgetDrills/widgetDrillSelectors.js +46 -6
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.js +4 -8
- package/esm/presentation/automations/shared/automationFilters/utils.d.ts +1 -1
- package/esm/presentation/automations/shared/automationFilters/utils.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/utils.js +6 -1
- package/esm/presentation/dashboard/DashboardSidebar/CreationPanel.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardSidebar/CreationPanel.js +9 -6
- package/esm/presentation/dashboard/DashboardSidebar/DashboardSidebarChrome.d.ts +31 -0
- package/esm/presentation/dashboard/DashboardSidebar/DashboardSidebarChrome.d.ts.map +1 -0
- package/esm/presentation/dashboard/DashboardSidebar/DashboardSidebarChrome.js +26 -0
- package/esm/presentation/dashboard/DashboardSidebar/SidebarCollapseToggle.d.ts +3 -2
- package/esm/presentation/dashboard/DashboardSidebar/SidebarCollapseToggle.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardSidebar/SidebarCollapseToggle.js +4 -7
- package/esm/presentation/dashboard/DashboardSidebar/SidebarConfigurationPanel.d.ts.map +1 -1
- package/esm/presentation/dashboard/DashboardSidebar/SidebarConfigurationPanel.js +5 -13
- package/esm/presentation/dashboard/DashboardSidebar/SidebarExpandTrigger.d.ts +7 -0
- package/esm/presentation/dashboard/DashboardSidebar/SidebarExpandTrigger.d.ts.map +1 -0
- package/esm/presentation/dashboard/DashboardSidebar/SidebarExpandTrigger.js +15 -0
- package/esm/presentation/dashboard/DashboardSidebar/SidebarHeaderToggle.d.ts +12 -0
- package/esm/presentation/dashboard/DashboardSidebar/SidebarHeaderToggle.d.ts.map +1 -0
- package/esm/presentation/dashboard/DashboardSidebar/SidebarHeaderToggle.js +21 -0
- package/esm/presentation/dashboard/DashboardSidebar/useResizableSidebarState.d.ts +21 -0
- package/esm/presentation/dashboard/DashboardSidebar/useResizableSidebarState.d.ts.map +1 -0
- package/esm/presentation/dashboard/DashboardSidebar/useResizableSidebarState.js +75 -0
- package/esm/presentation/dashboard/components/DashboardInner.d.ts.map +1 -1
- package/esm/presentation/dashboard/components/DashboardInner.js +4 -4
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.d.ts +1 -1
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.d.ts.map +1 -1
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.js +36 -29
- package/esm/presentation/drill/DrillSelect/WithDrillSelect.d.ts.map +1 -1
- package/esm/presentation/drill/DrillSelect/WithDrillSelect.js +34 -7
- package/esm/presentation/drill/DrillSelect/types.d.ts +15 -2
- package/esm/presentation/drill/DrillSelect/types.d.ts.map +1 -1
- package/esm/presentation/drill/DrillSelect/types.js +3 -0
- package/esm/presentation/drill/hooks/useDrillSelectDropdownMenuItems.d.ts +0 -1
- package/esm/presentation/drill/hooks/useDrillSelectDropdownMenuItems.d.ts.map +1 -1
- package/esm/presentation/drill/hooks/useDrillSelectDropdownMenuItems.js +28 -22
- package/esm/presentation/export/useExportData.d.ts +5 -0
- package/esm/presentation/export/useExportData.d.ts.map +1 -1
- package/esm/presentation/export/useExportData.js +8 -0
- package/esm/presentation/filterBar/attributeFilter/AttributeFilterParentFilteringContext.d.ts +9 -0
- package/esm/presentation/filterBar/attributeFilter/AttributeFilterParentFilteringContext.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/AttributeFilterParentFilteringContext.js +3 -0
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/AttributeFilterConfiguration.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/AttributeFilterConfiguration.js +3 -7
- package/esm/presentation/flexibleLayout/dragAndDrop/DragLayer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/dragAndDrop/DragLayer.js +2 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +6 -2
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +8 -4
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +7 -4
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +4 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +4 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +4 -1
- package/esm/presentation/topBar/topBar/DefaultTopBar.d.ts.map +1 -1
- package/esm/presentation/topBar/topBar/DefaultTopBar.js +2 -1
- package/esm/presentation/widget/common/RestrictedPlaceholder.d.ts.map +1 -1
- package/esm/presentation/widget/common/RestrictedPlaceholder.js +2 -1
- package/esm/presentation/widget/common/useResolveRestrictedRender.d.ts +8 -0
- package/esm/presentation/widget/common/useResolveRestrictedRender.d.ts.map +1 -0
- package/esm/presentation/widget/common/useResolveRestrictedRender.js +19 -0
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/useDrillDialogInsightDrills.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/useDrillDialogInsightDrills.js +1 -1
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcherRestricted.d.ts.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcherRestricted.js +5 -1
- package/esm/presentation/widget/widget/InsightWidget/DashboardWidgetInsightGuard.d.ts.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/DashboardWidgetInsightGuard.js +2 -0
- package/esm/sdk-ui-dashboard.d.ts +1 -1
- package/package.json +21 -21
- package/styles/css/main.css +78 -131
- package/styles/css/main.css.map +1 -1
- package/styles/css/sidebar.css +52 -121
- package/styles/css/sidebar.css.map +1 -1
- package/styles/scss/sidebar.scss +89 -152
- package/esm/presentation/dashboard/DashboardSidebar/SidebarResizeChrome.d.ts +0 -23
- package/esm/presentation/dashboard/DashboardSidebar/SidebarResizeChrome.d.ts.map +0 -1
- package/esm/presentation/dashboard/DashboardSidebar/SidebarResizeChrome.js +0 -95
- package/esm/presentation/dashboard/DashboardSidebar/SidebarResizeContext.d.ts +0 -42
- package/esm/presentation/dashboard/DashboardSidebar/SidebarResizeContext.d.ts.map +0 -1
- package/esm/presentation/dashboard/DashboardSidebar/SidebarResizeContext.js +0 -136
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type IUiResizableSidebarState } from "@gooddata/sdk-ui-kit";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface IDashboardSidebarChromeProps {
|
|
7
|
+
sidebar: IUiResizableSidebarState;
|
|
8
|
+
/**
|
|
9
|
+
* Renders the drag handle; the sidebar is still resizable by keyboard only through it.
|
|
10
|
+
*/
|
|
11
|
+
hasResizeHandle: boolean;
|
|
12
|
+
onContainerClick?: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Panel content, rendered at the expanded width so it is clipped, not reflowed, while collapsing.
|
|
15
|
+
*/
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Rendered inside the sticky container after the panel, e.g. the delete drop zone.
|
|
19
|
+
*/
|
|
20
|
+
afterPanel?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The dashboard edit-mode sidebar frame: the resizable wrapper, the sticky container with its collapse
|
|
24
|
+
* modifiers, the panel that clips the content, the drag handle and the edge trigger of a completely
|
|
25
|
+
* hidden sidebar. A collapsed sidebar either keeps an icon rail, where the panel toggle stays in place,
|
|
26
|
+
* or hides completely and is restored from the top bar or the edge trigger.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function DashboardSidebarChrome({ sidebar, hasResizeHandle, onContainerClick, children, afterPanel, }: IDashboardSidebarChromeProps): ReactElement;
|
|
31
|
+
//# sourceMappingURL=DashboardSidebarChrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardSidebarChrome.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/DashboardSidebarChrome.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK1D,OAAO,EACH,KAAK,wBAAwB,EAGhC,MAAM,sBAAsB,CAAC;AAI9B;;GAEG;AACH,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,wBAAwB,CAAC;IAClC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,EACnC,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,UAAU,GACb,EAAE,4BAA4B,GAAG,YAAY,CAkD7C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { UiResizableSidebar, UiResizableSidebarHandle, } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { SidebarExpandTrigger } from "./SidebarExpandTrigger.js";
|
|
6
|
+
/**
|
|
7
|
+
* The dashboard edit-mode sidebar frame: the resizable wrapper, the sticky container with its collapse
|
|
8
|
+
* modifiers, the panel that clips the content, the drag handle and the edge trigger of a completely
|
|
9
|
+
* hidden sidebar. A collapsed sidebar either keeps an icon rail, where the panel toggle stays in place,
|
|
10
|
+
* or hides completely and is restored from the top bar or the edge trigger.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export function DashboardSidebarChrome({ sidebar, hasResizeHandle, onContainerClick, children, afterPanel, }) {
|
|
15
|
+
const intl = useIntl();
|
|
16
|
+
const { isCollapsed, canCollapse, hasRail, expandedWidth } = sidebar;
|
|
17
|
+
const panel = (_jsx("div", { className: cx("gd-sidebar-panel", { "gd-sidebar-panel--collapsible": canCollapse }), children: _jsx("div", { className: "flex-panel-full-height", style: canCollapse ? { width: expandedWidth } : undefined, children: children }) }));
|
|
18
|
+
if (!hasResizeHandle && !canCollapse) {
|
|
19
|
+
return (_jsxs("div", { className: "col gd-flex-item gd-sidebar-container", onClick: onContainerClick, children: [panel, afterPanel] }));
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs(_Fragment, { children: [isCollapsed && !hasRail ? _jsx(SidebarExpandTrigger, {}) : null, _jsxs(UiResizableSidebar, { state: sidebar, dataTestId: "s-dashboard-sidebar", children: [_jsxs("div", { className: cx("col gd-flex-item gd-sidebar-container gd-sidebar-container--resizable", {
|
|
22
|
+
"gd-sidebar-container--collapsed": isCollapsed,
|
|
23
|
+
"gd-sidebar-container--rail": canCollapse && hasRail,
|
|
24
|
+
"gd-sidebar-container--hidden": canCollapse && !hasRail,
|
|
25
|
+
}), onClick: onContainerClick, children: [panel, afterPanel] }), hasResizeHandle ? (_jsx(UiResizableSidebarHandle, { accessibilityConfig: { ariaLabel: intl.formatMessage({ id: "sidebar.resize" }) }, dataTestId: "s-dashboard-sidebar-resize-handle" })) : null] })] }));
|
|
26
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The kit sidebar collapse toggle with the dashboard's translated labels and tooltip.
|
|
3
3
|
*
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
export declare function SidebarCollapseToggle({ isCollapsed, onToggle, }: {
|
|
6
|
+
export declare function SidebarCollapseToggle({ isCollapsed, onToggle, dataTestId, }: {
|
|
7
7
|
isCollapsed: boolean;
|
|
8
8
|
onToggle: () => void;
|
|
9
|
+
dataTestId?: string;
|
|
9
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
//# sourceMappingURL=SidebarCollapseToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarCollapseToggle.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/SidebarCollapseToggle.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,WAAW,EACX,QAAQ,
|
|
1
|
+
{"version":3,"file":"SidebarCollapseToggle.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/SidebarCollapseToggle.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,WAAW,EACX,QAAQ,EACR,UAAkD,GACrD,EAAE;IACC,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,2CA2BA"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import {
|
|
4
|
+
import { UiResizableSidebarCollapseToggle, UiTooltip } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* The kit sidebar collapse toggle with the dashboard's translated labels and tooltip.
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export function SidebarCollapseToggle({ isCollapsed, onToggle, }) {
|
|
10
|
+
export function SidebarCollapseToggle({ isCollapsed, onToggle, dataTestId = "s-dashboard-sidebar-collapse-toggle", }) {
|
|
11
11
|
const intl = useIntl();
|
|
12
12
|
const label = isCollapsed
|
|
13
13
|
? intl.formatMessage({ id: "sidebar.expand" })
|
|
14
14
|
: intl.formatMessage({ id: "sidebar.collapse" });
|
|
15
|
-
return (_jsx("div", { className: "gd-sidebar-collapse-toggle", children: _jsx(UiTooltip, { content: label, arrowPlacement: "left", triggerBy: ["hover", "focus"], optimalPlacement: true, accessibilityHidden: true, closeOnAnchorClick: true, anchor: _jsx(
|
|
16
|
-
ariaLabel: label,
|
|
17
|
-
ariaExpanded: !isCollapsed,
|
|
18
|
-
}, onClick: onToggle }) }) }));
|
|
15
|
+
return (_jsx("div", { className: "gd-sidebar-collapse-toggle", children: _jsx(UiTooltip, { content: label, arrowPlacement: "left", triggerBy: ["hover", "focus"], optimalPlacement: true, accessibilityHidden: true, closeOnAnchorClick: true, anchor: _jsx(UiResizableSidebarCollapseToggle, { isCollapsed: isCollapsed, onToggle: onToggle, collapseLabel: intl.formatMessage({ id: "sidebar.collapse" }), expandLabel: intl.formatMessage({ id: "sidebar.expand" }), dataTestId: dataTestId }) }) }));
|
|
19
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarConfigurationPanel.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/SidebarConfigurationPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidebarConfigurationPanel.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/SidebarConfigurationPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAS1C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,YAAY,GAAG,IAAI,CAyC3G"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import cx from "classnames";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
4
3
|
import { useWidgetSelection } from "../../../model/react/useWidgetSelection.js";
|
|
5
4
|
import { selectSettings } from "../../../model/store/config/configSelectors.js";
|
|
6
5
|
import { CreationPanel } from "./CreationPanel.js";
|
|
6
|
+
import { DashboardSidebarChrome } from "./DashboardSidebarChrome.js";
|
|
7
7
|
import { FloatingToolbar } from "./FloatingToolbar.js";
|
|
8
|
-
import {
|
|
9
|
-
import { SidebarResizeChrome } from "./SidebarResizeChrome.js";
|
|
10
|
-
import { useResizableSidebar } from "./SidebarResizeContext.js";
|
|
8
|
+
import { useResizableSidebar } from "./useResizableSidebarState.js";
|
|
11
9
|
/**
|
|
12
10
|
* @internal
|
|
13
11
|
*/
|
|
@@ -18,15 +16,9 @@ export function SidebarConfigurationPanel(props) {
|
|
|
18
16
|
const settings = useDashboardSelector(selectSettings);
|
|
19
17
|
const enableEnhancedInsightPicker = settings?.enableEnhancedInsightPicker ?? false;
|
|
20
18
|
const enableDashboardSidebarResize = settings?.enableDashboardSidebarResize ?? false;
|
|
21
|
-
const
|
|
19
|
+
const sidebar = useResizableSidebar();
|
|
22
20
|
if (enableEnhancedInsightPicker) {
|
|
23
21
|
return _jsx(FloatingToolbar, {});
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
if (enableDashboardSidebarResize) {
|
|
27
|
-
return _jsx(SidebarResizeChrome, { onContainerClick: deselectWidgets, children: content });
|
|
28
|
-
}
|
|
29
|
-
return (_jsx("div", { className: cx("col gd-flex-item gd-sidebar-container", {
|
|
30
|
-
"gd-sidebar-container--collapsed": isCollapsed,
|
|
31
|
-
}), onClick: deselectWidgets, children: content }));
|
|
23
|
+
return (_jsx(DashboardSidebarChrome, { sidebar: sidebar, hasResizeHandle: enableDashboardSidebarResize, onContainerClick: deselectWidgets, afterPanel: _jsx(DeleteDropZoneComponent, {}), children: _jsx(CreationPanel, { className: configurationPanelClassName, WrapCreatePanelItemWithDragComponent: WrapCreatePanelItemWithDragComponent, WrapInsightListItemWithDragComponent: WrapInsightListItemWithDragComponent, AttributeFilterComponentSet: AttributeFilterComponentSet, InsightWidgetComponentSet: InsightWidgetComponentSet, RichTextWidgetComponentSet: RichTextWidgetComponentSet, VisualizationSwitcherWidgetComponentSet: VisualizationSwitcherWidgetComponentSet, DashboardLayoutWidgetComponentSet: DashboardLayoutWidgetComponentSet }) }));
|
|
32
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarExpandTrigger.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/SidebarExpandTrigger.tsx"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,oBAAoB,4CAWnC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { UiResizableSidebarExpandTrigger } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { useResizableSidebar } from "./useResizableSidebarState.js";
|
|
6
|
+
/**
|
|
7
|
+
* Expands the hidden dashboard sidebar from the left edge of the content.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function SidebarExpandTrigger() {
|
|
12
|
+
const intl = useIntl();
|
|
13
|
+
const { setCollapsed } = useResizableSidebar();
|
|
14
|
+
return (_jsx(UiResizableSidebarExpandTrigger, { label: intl.formatMessage({ id: "sidebar.expand" }), dataTestId: "s-dashboard-sidebar-expand-trigger", onExpand: () => setCollapsed(false) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Restores a completely hidden dashboard sidebar from the top bar. Renders nothing while the sidebar is
|
|
3
|
+
* visible, including when it is collapsed to an icon rail where the panel toggle stays in place.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The default top bar renders it. A custom top bar of a dashboard whose sidebar hides completely must
|
|
7
|
+
* render it too, otherwise the only way back is the edge trigger.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function SidebarHeaderToggle(): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=SidebarHeaderToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarHeaderToggle.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/SidebarHeaderToggle.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,mDAclC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { SidebarCollapseToggle } from "./SidebarCollapseToggle.js";
|
|
4
|
+
import { useResizableSidebar } from "./useResizableSidebarState.js";
|
|
5
|
+
/**
|
|
6
|
+
* Restores a completely hidden dashboard sidebar from the top bar. Renders nothing while the sidebar is
|
|
7
|
+
* visible, including when it is collapsed to an icon rail where the panel toggle stays in place.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The default top bar renders it. A custom top bar of a dashboard whose sidebar hides completely must
|
|
11
|
+
* render it too, otherwise the only way back is the edge trigger.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export function SidebarHeaderToggle() {
|
|
16
|
+
const { canCollapse, isCollapsed, hasRail, setCollapsed } = useResizableSidebar();
|
|
17
|
+
if (!canCollapse || !isCollapsed || hasRail) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(SidebarCollapseToggle, { isCollapsed: true, onToggle: () => setCollapsed(false), dataTestId: "s-dashboard-sidebar-restore-toggle" }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type IUiResizableSidebarState } from "@gooddata/sdk-ui-kit";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the sidebar state shared by the dashboard provider, or a fixed sidebar at the minimum width when
|
|
4
|
+
* rendered outside it.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function useResizableSidebar(): IUiResizableSidebarState;
|
|
9
|
+
/**
|
|
10
|
+
* Computes the dashboard sidebar width state: the drag-to-resize bounds and the collapsed/expanded state
|
|
11
|
+
* of the edit-mode creation panel. The sidebar collapses to an icon rail. When the sidebar is neither
|
|
12
|
+
* resizable nor collapsible (not edit mode, both features off, or replaced by the enhanced insight picker)
|
|
13
|
+
* it is fixed at the minimum width.
|
|
14
|
+
*
|
|
15
|
+
* Reads the config store, so it must be called below the dashboard loading gate where the config is
|
|
16
|
+
* initialized.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function useResizableSidebarState(): IUiResizableSidebarState;
|
|
21
|
+
//# sourceMappingURL=useResizableSidebarState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizableSidebarState.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/DashboardSidebar/useResizableSidebarState.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,wBAAwB,EAGhC,MAAM,sBAAsB,CAAC;AA6B9B;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,wBAAwB,CAE9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,IAAI,wBAAwB,CAgCnE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useUiResizableSidebar, useUiResizableSidebarState, } from "@gooddata/sdk-ui-kit";
|
|
4
|
+
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
5
|
+
import { selectIsAiMode, selectSettings } from "../../../model/store/config/configSelectors.js";
|
|
6
|
+
import { selectIsInEditMode } from "../../../model/store/renderMode/renderModeSelectors.js";
|
|
7
|
+
const SIDEBAR_MIN_WIDTH = 230;
|
|
8
|
+
const SIDEBAR_MAX_WIDTH = 500;
|
|
9
|
+
// The edit-mode sidebar collapses to an icon rail; without it the sidebar would hide completely and the
|
|
10
|
+
// restore control would move to the top bar (see SidebarHeaderToggle and SidebarExpandTrigger).
|
|
11
|
+
const SIDEBAR_HAS_RAIL = true;
|
|
12
|
+
const EDITOR_MIN_WIDTH = 960;
|
|
13
|
+
const WIDTH_STORAGE_KEY = "gd-dashboard-sidebar-width";
|
|
14
|
+
const COLLAPSED_STORAGE_KEY = "gd-dashboard-sidebar-collapsed";
|
|
15
|
+
// Fixed sidebar for consumers rendered outside the dashboard provider, e.g. a standalone panel.
|
|
16
|
+
const STATIC_SIDEBAR = {
|
|
17
|
+
width: SIDEBAR_MIN_WIDTH,
|
|
18
|
+
expandedWidth: SIDEBAR_MIN_WIDTH,
|
|
19
|
+
min: SIDEBAR_MIN_WIDTH,
|
|
20
|
+
max: SIDEBAR_MIN_WIDTH,
|
|
21
|
+
canResize: false,
|
|
22
|
+
setWidth: () => { },
|
|
23
|
+
canCollapse: false,
|
|
24
|
+
hasRail: SIDEBAR_HAS_RAIL,
|
|
25
|
+
isCollapsed: false,
|
|
26
|
+
setCollapsed: () => { },
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Returns the sidebar state shared by the dashboard provider, or a fixed sidebar at the minimum width when
|
|
30
|
+
* rendered outside it.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export function useResizableSidebar() {
|
|
35
|
+
return useUiResizableSidebar(STATIC_SIDEBAR);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Computes the dashboard sidebar width state: the drag-to-resize bounds and the collapsed/expanded state
|
|
39
|
+
* of the edit-mode creation panel. The sidebar collapses to an icon rail. When the sidebar is neither
|
|
40
|
+
* resizable nor collapsible (not edit mode, both features off, or replaced by the enhanced insight picker)
|
|
41
|
+
* it is fixed at the minimum width.
|
|
42
|
+
*
|
|
43
|
+
* Reads the config store, so it must be called below the dashboard loading gate where the config is
|
|
44
|
+
* initialized.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export function useResizableSidebarState() {
|
|
49
|
+
const settings = useDashboardSelector(selectSettings);
|
|
50
|
+
const isEditMode = useDashboardSelector(selectIsInEditMode);
|
|
51
|
+
const isAiMode = useDashboardSelector(selectIsAiMode);
|
|
52
|
+
const isSidebarResizeEnabled = settings?.enableDashboardSidebarResize ?? false;
|
|
53
|
+
const enableEnhancedInsightPicker = settings?.enableEnhancedInsightPicker ?? false;
|
|
54
|
+
const isGenAiRightPanelEnabled = settings?.enableGenAiRightPanel ?? false;
|
|
55
|
+
const isCollapsibleLeftSidebarEnabled = settings?.enableCollapsibleLeftSidebar ?? false;
|
|
56
|
+
const hasCreationPanel = isEditMode && !enableEnhancedInsightPicker;
|
|
57
|
+
const state = useUiResizableSidebarState({
|
|
58
|
+
widthStorageKey: WIDTH_STORAGE_KEY,
|
|
59
|
+
collapsedStorageKey: COLLAPSED_STORAGE_KEY,
|
|
60
|
+
minWidth: SIDEBAR_MIN_WIDTH,
|
|
61
|
+
maxWidth: SIDEBAR_MAX_WIDTH,
|
|
62
|
+
hasRail: SIDEBAR_HAS_RAIL,
|
|
63
|
+
minContentWidth: EDITOR_MIN_WIDTH,
|
|
64
|
+
isResizable: hasCreationPanel && isSidebarResizeEnabled,
|
|
65
|
+
isCollapsible: hasCreationPanel && (isGenAiRightPanelEnabled || isCollapsibleLeftSidebarEnabled),
|
|
66
|
+
});
|
|
67
|
+
const { setCollapsed } = state;
|
|
68
|
+
// The AI assistant takes over the canvas, so the sidebar folds away while it is active.
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (isAiMode) {
|
|
71
|
+
setCollapsed(true);
|
|
72
|
+
}
|
|
73
|
+
}, [isAiMode, setCollapsed]);
|
|
74
|
+
return state;
|
|
75
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardInner.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/components/DashboardInner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DashboardInner.d.ts","sourceRoot":"","sources":["../../../../src/presentation/dashboard/components/DashboardInner.tsx"],"names":[],"mappings":"AA0CA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAQnD,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,2CAyHpD"}
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2022-2026 GoodData Corporation
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { OverlayController, OverlayControllerProvider, ToastsCenter, ToastsCenterContextProvider, } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { OverlayController, OverlayControllerProvider, ToastsCenter, ToastsCenterContextProvider, UiResizableSidebarProvider, } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
7
7
|
import { useDashboardAutomations } from "../../../model/react/useDashboardAutomations/useDashboardAutomations.js";
|
|
8
8
|
import { selectAccessibleDashboardsLoaded } from "../../../model/store/accessibleDashboards/accessibleDashboardsSelectors.js";
|
|
@@ -23,7 +23,7 @@ import { DashboardContent } from "../DashboardContent.js";
|
|
|
23
23
|
import { DashboardHeader } from "../DashboardHeader/DashboardHeader.js";
|
|
24
24
|
import { DashboardSidebar } from "../DashboardSidebar/DashboardSidebar.js";
|
|
25
25
|
import { RenderModeAwareDashboardSidebar } from "../DashboardSidebar/RenderModeAwareDashboardSidebar.js";
|
|
26
|
-
import {
|
|
26
|
+
import { useResizableSidebarState } from "../DashboardSidebar/useResizableSidebarState.js";
|
|
27
27
|
import { DashboardScreenSizeProvider } from "./DashboardScreenSizeContext.js";
|
|
28
28
|
import { DashboardSkeleton } from "./DashboardSkeleton.js";
|
|
29
29
|
const overlayController = OverlayController.getInstance(DASHBOARD_HEADER_OVERLAYS_Z_INDEX);
|
|
@@ -60,7 +60,7 @@ export function DashboardInner(props) {
|
|
|
60
60
|
"gd-dash-content--density-compact": density === "compact",
|
|
61
61
|
});
|
|
62
62
|
const resizableSidebar = useResizableSidebarState();
|
|
63
|
-
// When the sidebar can be resized or is collapsed
|
|
63
|
+
// When the sidebar can be resized or is collapsed (hidden), expose its live width so the
|
|
64
64
|
// sibling content area can subtract it (see `--gd-dashboard-sidebar-width` in sdk-dashboard.scss).
|
|
65
65
|
// Otherwise leave it unset so the content falls back to the static per-breakpoint sidebar width.
|
|
66
66
|
const dashboardsRootStyle = resizableSidebar.canResize || resizableSidebar.isCollapsed
|
|
@@ -68,7 +68,7 @@ export function DashboardInner(props) {
|
|
|
68
68
|
"--gd-dashboard-sidebar-width": `${resizableSidebar.width}px`,
|
|
69
69
|
}
|
|
70
70
|
: undefined;
|
|
71
|
-
return (_jsx(IntlWrapper, { locale: locale, children: _jsxs(ToastsCenterContextProvider, { skipAutomaticMessageRendering: true, children: [_jsx(OverlayControllerProvider, { overlayController: toastsOverlayController, children: _jsx(ToastsCenter, {}) }), _jsx(
|
|
71
|
+
return (_jsx(IntlWrapper, { locale: locale, children: _jsxs(ToastsCenterContextProvider, { skipAutomaticMessageRendering: true, children: [_jsx(OverlayControllerProvider, { overlayController: toastsOverlayController, children: _jsx(ToastsCenter, {}) }), _jsx(UiResizableSidebarProvider, { value: resizableSidebar, children: _jsxs("div", { className: cx("component-root", {
|
|
72
72
|
"sdk-edit-mode-on": isEditMode,
|
|
73
73
|
"sdk-view-mode-on": !isEditMode,
|
|
74
74
|
"catalog-is-loaded": isCatalogLoaded,
|
|
@@ -11,7 +11,7 @@ export interface IDrillSelectDropdownProps extends IDrillSelectContext {
|
|
|
11
11
|
onCloseReturnFocus: () => void;
|
|
12
12
|
onSelect: (item: DashboardDrillDefinition, context: unknown) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function DrillSelectDropdown({ isOpen, dropDownAnchorClass, onClose, onCloseReturnFocus, onSelect, drillDefinitions, drillEvent, }: IDrillSelectDropdownProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export declare function DrillSelectDropdown({ isOpen, dropDownAnchorClass, onClose, onCloseReturnFocus, onSelect, drillDefinitions, restrictedDrillDowns, drillEvent, }: IDrillSelectDropdownProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
15
|
export declare const createDrillSelectItems: ({ drillDefinitions, drillEvent, insights, dashboardList, dashboardTitle, intl, widget, attributeDisplayForms, enableSecondGranularities, isDrillRestricted, }: {
|
|
16
16
|
isDrillRestricted: (drill: DashboardDrillDefinition) => boolean;
|
|
17
17
|
drillDefinitions: DashboardDrillDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrillSelectDropdown.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/DrillSelect/DrillSelectDropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,YAAY,CAAC;AAGrD,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"DrillSelectDropdown.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/DrillSelect/DrillSelectDropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,YAAY,CAAC;AAGrD,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,OAAO,EAef,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AAIxE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUzE,OAAO,EAAE,KAAK,wBAAwB,EAAyB,MAAM,mBAAmB,CAAC;AAazF,OAAO,EAEH,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAExB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IAClE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxE;AAED,wBAAgB,mBAAmB,CAAC,EAChC,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,GACb,EAAE,yBAAyB,kDA+K3B;AAgGD,eAAO,MAAM,sBAAsB,kKAWhC;IACC,iBAAiB,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC;IAChE,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;IAC7C,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9B,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,mCAAmC,CAAC,CAAC;IAC3E,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,KAAG,gBAAgB,EAqJnB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import stringify from "json-stable-stringify";
|
|
|
5
5
|
import { compact, groupBy, uniqBy } from "lodash-es";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
7
|
import { invariant } from "ts-invariant";
|
|
8
|
-
import { areObjRefsEqual, insightTitle, isAttributeDescriptor, isCrossFiltering, isDrillFromAttribute, isDrillToAttributeUrl, isDrillToCustomUrl, isDrillToDashboard, isDrillToInsight, isDrillToLegacyDashboard, isIdentifierRef, isKeyDriveAnalysis, } from "@gooddata/sdk-model";
|
|
8
|
+
import { areObjRefsEqual, insightTitle, isAttributeDescriptor, isCrossFiltering, isDrillFromAttribute, isDrillToAttributeUrl, isDrillToCustomUrl, isDrillToDashboard, isDrillToInsight, isDrillToLegacyDashboard, isIdentifierRef, isKeyDriveAnalysis, objRefToString, } from "@gooddata/sdk-model";
|
|
9
9
|
import { UnexpectedSdkError } from "@gooddata/sdk-ui";
|
|
10
10
|
import { Overlay, UiFocusManager, UiMenu } from "@gooddata/sdk-ui-kit";
|
|
11
11
|
import { getDrillOriginLocalIdentifier } from "../../../_staging/drills/drillingUtils.js";
|
|
@@ -25,8 +25,8 @@ import { getDrillDownTitle, getDrillOriginAttributeElementTitle, getTotalDrillTo
|
|
|
25
25
|
import { getDrillToCustomUrlMissingAttributes } from "../utils/drillToCustomUrlUtils.js";
|
|
26
26
|
import { getKdaKeyDriverCombinations, getKeyDriverCombinationItemTitle } from "../utils/kdaUtils.js";
|
|
27
27
|
import { DrillSelectDropdownMenuItem } from "./DrillSelectDropdownMenuItem.js";
|
|
28
|
-
import { DrillType } from "./types.js";
|
|
29
|
-
export function DrillSelectDropdown({ isOpen, dropDownAnchorClass, onClose, onCloseReturnFocus, onSelect, drillDefinitions, drillEvent, }) {
|
|
28
|
+
import { DrillType, } from "./types.js";
|
|
29
|
+
export function DrillSelectDropdown({ isOpen, dropDownAnchorClass, onClose, onCloseReturnFocus, onSelect, drillDefinitions, restrictedDrillDowns, drillEvent, }) {
|
|
30
30
|
const intl = useIntl();
|
|
31
31
|
const isDrillRestricted = useDashboardSelector(selectIsDrillRestricted);
|
|
32
32
|
const dashboardList = useDashboardSelector(selectAccessibleDashboards);
|
|
@@ -72,19 +72,23 @@ export function DrillSelectDropdown({ isOpen, dropDownAnchorClass, onClose, onCl
|
|
|
72
72
|
nextElement.focus();
|
|
73
73
|
}
|
|
74
74
|
}, [previouslyFocusedRef, onClose, removeHighchartsFocusBorders, findNextFocusableVisualisation]);
|
|
75
|
-
const drillSelectItems = useMemo(() =>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
const drillSelectItems = useMemo(() => [
|
|
76
|
+
...createDrillSelectItems({
|
|
77
|
+
drillDefinitions: deduplicateDrillIntoUrlItems(drillDefinitions),
|
|
78
|
+
drillEvent,
|
|
79
|
+
isDrillRestricted,
|
|
80
|
+
insights,
|
|
81
|
+
dashboardList,
|
|
82
|
+
dashboardTitle,
|
|
83
|
+
attributeDisplayForms,
|
|
84
|
+
intl,
|
|
85
|
+
widget: widget,
|
|
86
|
+
enableSecondGranularities,
|
|
87
|
+
}),
|
|
88
|
+
...createRestrictedDrillDownItems(restrictedDrillDowns, intl),
|
|
89
|
+
], [
|
|
87
90
|
drillDefinitions,
|
|
91
|
+
restrictedDrillDowns,
|
|
88
92
|
isDrillRestricted,
|
|
89
93
|
drillEvent,
|
|
90
94
|
insights,
|
|
@@ -96,19 +100,18 @@ export function DrillSelectDropdown({ isOpen, dropDownAnchorClass, onClose, onCl
|
|
|
96
100
|
enableSecondGranularities,
|
|
97
101
|
]);
|
|
98
102
|
const grouped = groupBy(drillSelectItems, (item) => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
switch (item.type) {
|
|
104
|
+
case DrillType.DRILL_DOWN:
|
|
105
|
+
return "drillDown";
|
|
106
|
+
case DrillType.DRILL_TO_URL:
|
|
107
|
+
return "drillToUrl";
|
|
108
|
+
case DrillType.CROSS_FILTERING:
|
|
109
|
+
return "crossFiltering";
|
|
110
|
+
case DrillType.KEY_DRIVER_ANALYSIS:
|
|
111
|
+
return "keyDriverAnalysis";
|
|
112
|
+
default:
|
|
113
|
+
return "drill";
|
|
104
114
|
}
|
|
105
|
-
if (isCrossFiltering(item.drillDefinition)) {
|
|
106
|
-
return "crossFiltering";
|
|
107
|
-
}
|
|
108
|
-
if (isKeyDriveAnalysis(item.drillDefinition)) {
|
|
109
|
-
return "keyDriverAnalysis";
|
|
110
|
-
}
|
|
111
|
-
return "drill";
|
|
112
115
|
});
|
|
113
116
|
const menuItems = useDrillSelectDropdownMenuItems({
|
|
114
117
|
drillDownItems: grouped["drillDown"] ?? [],
|
|
@@ -216,6 +219,12 @@ function calculateAlignPoints(anchorClass, drillEvent) {
|
|
|
216
219
|
},
|
|
217
220
|
];
|
|
218
221
|
}
|
|
222
|
+
const createRestrictedDrillDownItems = (restrictedDrillDowns, intl) => restrictedDrillDowns.map(({ hierarchyRef, originLocalIdentifier }) => ({
|
|
223
|
+
type: DrillType.DRILL_DOWN,
|
|
224
|
+
name: intl.formatMessage({ id: "drill_modal_picker.restricted" }),
|
|
225
|
+
id: `restricted-drill-down-${originLocalIdentifier}-${objRefToString(hierarchyRef)}`,
|
|
226
|
+
isRestricted: true,
|
|
227
|
+
}));
|
|
219
228
|
export const createDrillSelectItems = ({ drillDefinitions, drillEvent, insights, dashboardList, dashboardTitle, intl, widget, attributeDisplayForms, enableSecondGranularities = false, isDrillRestricted, }) => {
|
|
220
229
|
const totalDrillToUrls = getTotalDrillToUrlCount(drillDefinitions);
|
|
221
230
|
return drillDefinitions.flatMap((drillDefinition) => {
|
|
@@ -228,10 +237,8 @@ export const createDrillSelectItems = ({ drillDefinitions, drillEvent, insights,
|
|
|
228
237
|
? DrillType.DRILL_TO_DASHBOARD
|
|
229
238
|
: DrillType.DRILL_TO_URL,
|
|
230
239
|
name: intl.formatMessage({ id: "drill_modal_picker.restricted" }),
|
|
231
|
-
drillDefinition,
|
|
232
240
|
id: stringify(drillDefinition) || "undefined",
|
|
233
241
|
isRestricted: true,
|
|
234
|
-
isDisabled: true,
|
|
235
242
|
};
|
|
236
243
|
}
|
|
237
244
|
if (isDrillDownDefinition(drillDefinition)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithDrillSelect.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/DrillSelect/WithDrillSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAA0C,MAAM,OAAO,CAAC;AAKlF,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"WithDrillSelect.d.ts","sourceRoot":"","sources":["../../../../src/presentation/drill/DrillSelect/WithDrillSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAA0C,MAAM,OAAO,CAAC;AAKlF,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,MAAM,EAQd,MAAM,qBAAqB,CAAC;AAgC7B,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EACrB,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,QAAQ,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,4BAA4B,CAAC,EAAE,4BAA4B,CAAC;IAC5D,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;IACxD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,aAAa,CAAA;KAAE,KAAK,YAAY,CAAC;CACjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,OAAO,GACV,EAAE,qBAAqB,GAAG,YAAY,CAmNtC"}
|
|
@@ -3,15 +3,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { v4 as uuid } from "uuid";
|
|
6
|
-
import { isCrossFiltering, isDrillToAttributeUrl, isDrillToCustomUrl, isDrillToDashboard, isDrillToInsight, isKeyDriveAnalysis, } from "@gooddata/sdk-model";
|
|
6
|
+
import { isAttributeDescriptor, isCrossFiltering, isDrillToAttributeUrl, isDrillToCustomUrl, isDrillToDashboard, isDrillToInsight, isKeyDriveAnalysis, } from "@gooddata/sdk-model";
|
|
7
7
|
import { useAutoupdateRef } from "@gooddata/sdk-ui";
|
|
8
8
|
import { OverlayController, OverlayControllerProvider } from "@gooddata/sdk-ui-kit";
|
|
9
|
+
import { getDrillSourceLocalIdentifierFromEvent } from "../../../_staging/drills/drillingUtils.js";
|
|
9
10
|
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
10
11
|
import { selectBackendCapabilities } from "../../../model/store/backendCapabilities/backendCapabilitiesSelectors.js";
|
|
11
|
-
import {
|
|
12
|
+
import { selectAllCatalogAttributesMap } from "../../../model/store/catalog/catalogSelectors.js";
|
|
13
|
+
import { selectDisableDefaultDrills, selectEnableDashboardPartialRendering, selectLocale, } from "../../../model/store/config/configSelectors.js";
|
|
12
14
|
import { selectExecutableDashboardFiltersWithoutCrossFiltering } from "../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
13
|
-
import { selectWidgetDrills } from "../../../model/store/tabs/layout/layoutSelectors.js";
|
|
15
|
+
import { selectIgnoredDrillDownHierarchiesByWidgetRef, selectWidgetDrills, } from "../../../model/store/tabs/layout/layoutSelectors.js";
|
|
14
16
|
import { selectIsDrillRestricted } from "../../../model/store/widgetDrills/drillRestrictionSelectors.js";
|
|
17
|
+
import { getRestrictedDrillDowns } from "../../../model/store/widgetDrills/widgetDrillSelectors.js";
|
|
15
18
|
import { isDrillDownDefinition, } from "../../../types.js";
|
|
16
19
|
import { DASHBOARD_DRILL_MENU_Z_INDEX } from "../../constants/zIndex.js";
|
|
17
20
|
import { IntlWrapper } from "../../localization/IntlWrapper.js";
|
|
@@ -29,21 +32,44 @@ export function WithDrillSelect({ widgetRef, children, insight, returnFocusToIns
|
|
|
29
32
|
const disableDefaultDrills = useDashboardSelector(selectDisableDefaultDrills); // TODO: maybe remove?
|
|
30
33
|
const filters = useDashboardSelector(selectExecutableDashboardFiltersWithoutCrossFiltering);
|
|
31
34
|
const isDrillRestricted = useDashboardSelector(selectIsDrillRestricted);
|
|
35
|
+
const catalogAttributes = useDashboardSelector(selectAllCatalogAttributesMap);
|
|
36
|
+
const ignoredHierarchies = useDashboardSelector(selectIgnoredDrillDownHierarchiesByWidgetRef(widgetRef));
|
|
37
|
+
const enablePartialRendering = useDashboardSelector(selectEnableDashboardPartialRendering);
|
|
32
38
|
const configuredDrills = useDashboardSelector(selectWidgetDrills(widgetRef));
|
|
33
39
|
const { supportsAttributeHierarchies } = useDashboardSelector(selectBackendCapabilities);
|
|
40
|
+
// useDrills keeps the success handler of the first render; the catalog loads after it
|
|
41
|
+
const restrictedDrillDownDepsRef = useAutoupdateRef({
|
|
42
|
+
catalogAttributes,
|
|
43
|
+
ignoredHierarchies,
|
|
44
|
+
enablePartialRendering,
|
|
45
|
+
supportsAttributeHierarchies,
|
|
46
|
+
insight,
|
|
47
|
+
});
|
|
34
48
|
const drills = useDrills({
|
|
35
49
|
onDrill: onDrillStart,
|
|
36
50
|
onDrillSuccess: (s) => {
|
|
37
|
-
if (disableDefaultDrills || s.payload.drillEvent.drillDefinitions.length === 0) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
51
|
const drillDefinitions = s.payload.drillEvent.drillDefinitions;
|
|
41
52
|
const drillEvent = s.payload.drillEvent;
|
|
42
53
|
const context = s.payload.drillContext;
|
|
54
|
+
const drillSources = getDrillSourceLocalIdentifierFromEvent(drillEvent);
|
|
55
|
+
const clickedAttributes = (drillEvent.drillContext.intersection ?? [])
|
|
56
|
+
.map(({ header }) => header)
|
|
57
|
+
.filter(isAttributeDescriptor)
|
|
58
|
+
.filter(({ attributeHeader }) => drillSources.includes(attributeHeader.localIdentifier));
|
|
59
|
+
const deps = restrictedDrillDownDepsRef.current;
|
|
60
|
+
const restrictedDrillDowns = getRestrictedDrillDowns(clickedAttributes, deps.catalogAttributes, deps.ignoredHierarchies ?? [], {
|
|
61
|
+
supportsAttributeHierarchies: deps.supportsAttributeHierarchies,
|
|
62
|
+
enablePartialRendering: deps.enablePartialRendering,
|
|
63
|
+
disableDrillDown: deps.insight.insight.properties["controls"]?.disableDrillDown,
|
|
64
|
+
});
|
|
65
|
+
if (disableDefaultDrills ||
|
|
66
|
+
(drillDefinitions.length === 0 && restrictedDrillDowns.length === 0)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
43
69
|
const validDrillDefinitions = supportsAttributeHierarchies
|
|
44
70
|
? drillDefinitions
|
|
45
71
|
: filterDrillFromAttributeByPriority(drillDefinitions, configuredDrills);
|
|
46
|
-
const type = validDrillDefinitions.some(isDrillRestricted)
|
|
72
|
+
const type = restrictedDrillDowns.length > 0 || validDrillDefinitions.some(isDrillRestricted)
|
|
47
73
|
? "multiple"
|
|
48
74
|
: getDrillDefinitionType(validDrillDefinitions);
|
|
49
75
|
if (type === "single") {
|
|
@@ -52,6 +78,7 @@ export function WithDrillSelect({ widgetRef, children, insight, returnFocusToIns
|
|
|
52
78
|
else if (type === "multiple") {
|
|
53
79
|
setDropdownProps({
|
|
54
80
|
drillDefinitions: validDrillDefinitions,
|
|
81
|
+
restrictedDrillDowns,
|
|
55
82
|
drillEvent: drillEvent,
|
|
56
83
|
drillContext: context,
|
|
57
84
|
correlationId: s.correlationId,
|