@gooddata/sdk-ui-dashboard 10.12.0-alpha.7 → 10.12.0-alpha.8
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/model/commandHandlers/dashboard/common/insightReferences.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/insightReferences.js +32 -8
- package/esm/model/commandHandlers/dashboard/common/insightReferences.js.map +1 -1
- package/esm/model/commandHandlers/render/renderingWorker.d.ts.map +1 -1
- package/esm/model/commandHandlers/render/renderingWorker.js +5 -0
- package/esm/model/commandHandlers/render/renderingWorker.js.map +1 -1
- package/esm/model/store/dashboardStore.d.ts.map +1 -1
- package/esm/model/store/dashboardStore.js +2 -0
- package/esm/model/store/dashboardStore.js.map +1 -1
- package/esm/model/store/executed/executedReducers.d.ts +9 -0
- package/esm/model/store/executed/executedReducers.d.ts.map +1 -0
- package/esm/model/store/executed/executedReducers.js +11 -0
- package/esm/model/store/executed/executedReducers.js.map +1 -0
- package/esm/model/store/executed/executedSelectors.d.ts +11 -0
- package/esm/model/store/executed/executedSelectors.d.ts.map +1 -0
- package/esm/model/store/executed/executedSelectors.js +12 -0
- package/esm/model/store/executed/executedSelectors.js.map +1 -0
- package/esm/model/store/executed/executedState.d.ts +8 -0
- package/esm/model/store/executed/executedState.d.ts.map +1 -0
- package/esm/model/store/executed/executedState.js +3 -0
- package/esm/model/store/executed/executedState.js.map +1 -0
- package/esm/model/store/executed/index.d.ts +6 -0
- package/esm/model/store/executed/index.d.ts.map +1 -0
- package/esm/model/store/executed/index.js +12 -0
- package/esm/model/store/executed/index.js.map +1 -0
- package/esm/model/store/index.d.ts +2 -0
- package/esm/model/store/index.d.ts.map +1 -1
- package/esm/model/store/index.js +1 -0
- package/esm/model/store/index.js.map +1 -1
- package/esm/model/store/types.d.ts +2 -0
- package/esm/model/store/types.d.ts.map +1 -1
- package/esm/presentation/presentationComponents/DashboardItems/DashboardItemBase.d.ts +1 -1
- package/esm/presentation/presentationComponents/DashboardItems/DashboardItemBase.d.ts.map +1 -1
- package/esm/presentation/presentationComponents/DashboardItems/DashboardItemBase.js +2 -2
- package/esm/presentation/presentationComponents/DashboardItems/DashboardItemBase.js.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/AllVisualizationsDashInsights.d.ts +16 -0
- package/esm/presentation/widget/visualizationSwitcher/AllVisualizationsDashInsights.d.ts.map +1 -0
- package/esm/presentation/widget/visualizationSwitcher/AllVisualizationsDashInsights.js +26 -0
- package/esm/presentation/widget/visualizationSwitcher/AllVisualizationsDashInsights.js.map +1 -0
- package/esm/presentation/widget/visualizationSwitcher/EditModeDashboardVisualizationSwitcher.js +4 -4
- package/esm/presentation/widget/visualizationSwitcher/EditModeDashboardVisualizationSwitcher.js.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.d.ts +8 -0
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.d.ts.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.js +99 -3
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.js.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/useExecutionProgress.d.ts +4 -0
- package/esm/presentation/widget/visualizationSwitcher/useExecutionProgress.d.ts.map +1 -0
- package/esm/presentation/widget/visualizationSwitcher/useExecutionProgress.js +60 -0
- package/esm/presentation/widget/visualizationSwitcher/useExecutionProgress.js.map +1 -0
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js +7 -39
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js.map +1 -1
- package/esm/presentation/widget/widget/InsightWidget/useAlertingAndScheduling.d.ts +17 -0
- package/esm/presentation/widget/widget/InsightWidget/useAlertingAndScheduling.d.ts.map +1 -0
- package/esm/presentation/widget/widget/InsightWidget/useAlertingAndScheduling.js +52 -0
- package/esm/presentation/widget/widget/InsightWidget/useAlertingAndScheduling.js.map +1 -0
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.d.ts +12 -0
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.d.ts.map +1 -0
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.js +53 -0
- package/esm/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.js.map +1 -0
- package/esm/sdk-ui-dashboard.d.ts +13 -0
- package/package.json +15 -15
- package/styles/css/insightConfiguration.css +1 -0
- package/styles/css/insightConfiguration.css.map +1 -1
- package/styles/css/main.css +76 -5
- package/styles/css/main.css.map +1 -1
- package/styles/css/visualizationSwitcherHeader.css +59 -0
- package/styles/css/visualizationSwitcherHeader.css.map +1 -0
- package/styles/css/visualizationSwitcherWidget.css +22 -5
- package/styles/css/visualizationSwitcherWidget.css.map +1 -1
- package/styles/scss/insightConfiguration.scss +2 -1
- package/styles/scss/main.scss +1 -0
- package/styles/scss/visualizationSwitcherHeader.scss +61 -0
- package/styles/scss/visualizationSwitcherWidget.scss +24 -5
package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IDashboardVisualizationSwitcherProps } from "./types.js";
|
|
3
|
+
import { IInsight, IInsightWidget } from "@gooddata/sdk-model";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
6
7
|
export declare const ViewModeDashboardVisualizationSwitcher: React.FC<IDashboardVisualizationSwitcherProps>;
|
|
8
|
+
export declare const ViewModeDashboardVisualizationSwitcherEmpty: React.FC;
|
|
9
|
+
export interface IViewModeDashboardVisualizationSwitcherContentProps extends IDashboardVisualizationSwitcherProps {
|
|
10
|
+
insight: IInsight;
|
|
11
|
+
activeVisualization: IInsightWidget;
|
|
12
|
+
onActiveVisualizationChange: (activeVisualizationId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ViewModeDashboardVisualizationSwitcherContent: React.FC<IViewModeDashboardVisualizationSwitcherContentProps>;
|
|
7
15
|
//# sourceMappingURL=ViewModeDashboardVisualizationSwitcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeDashboardVisualizationSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewModeDashboardVisualizationSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAMpD,OAAO,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAalE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAyC,MAAM,qBAAqB,CAAC;AAUtG;;GAEG;AACH,eAAO,MAAM,sCAAsC,EAAE,KAAK,CAAC,EAAE,CAAC,oCAAoC,CAqCjG,CAAC;AAEF,eAAO,MAAM,2CAA2C,EAAE,KAAK,CAAC,EAa/D,CAAC;AAEF,MAAM,WAAW,mDACb,SAAQ,oCAAoC;IAC5C,OAAO,EAAE,QAAQ,CAAC;IAClB,mBAAmB,EAAE,cAAc,CAAC;IACpC,2BAA2B,EAAE,CAAC,qBAAqB,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE;AAED,eAAO,MAAM,6CAA6C,EAAE,KAAK,CAAC,EAAE,CAChE,mDAAmD,CAmKtD,CAAC"}
|
package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.js
CHANGED
|
@@ -1,9 +1,105 @@
|
|
|
1
1
|
// (C) 2024 GoodData Corporation
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { useCallback, useMemo } from "react";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { Icon, Typography } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { useTheme } from "@gooddata/sdk-ui-theme-provider";
|
|
6
|
+
import cx from "classnames";
|
|
7
|
+
import { useDashboardSelector, selectInsightsMap, selectSettings, useDashboardScheduledEmails, } from "../../../model/index.js";
|
|
8
|
+
import { useDashboardComponentsContext } from "../../../presentation/dashboardContexts/index.js";
|
|
9
|
+
import { DashboardItem, DashboardItemVisualization, getVisTypeCssClass, } from "../../../presentation/presentationComponents/index.js";
|
|
10
|
+
import { insightVisualizationType, widgetTitle } from "@gooddata/sdk-model";
|
|
11
|
+
import { InsightWidgetDescriptionTrigger } from "../description/InsightWidgetDescriptionTrigger.js";
|
|
12
|
+
import { useInsightExport } from "../common/index.js";
|
|
13
|
+
import { useAlertingAndScheduling } from "../widget/InsightWidget/useAlertingAndScheduling.js";
|
|
14
|
+
import { useInsightMenu } from "../widget/InsightWidget/useInsightMenu.js";
|
|
15
|
+
import { VisualizationSwitcherNavigationHeader } from "../widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.js";
|
|
16
|
+
import { useExecutionProgress } from "./useExecutionProgress.js";
|
|
17
|
+
import { AllVisualizationsDashInsights } from "./AllVisualizationsDashInsights.js";
|
|
3
18
|
/**
|
|
4
19
|
* @internal
|
|
5
20
|
*/
|
|
6
|
-
export const ViewModeDashboardVisualizationSwitcher = (
|
|
7
|
-
|
|
21
|
+
export const ViewModeDashboardVisualizationSwitcher = (props) => {
|
|
22
|
+
const { widget, activeVisualizationId: initialActiveVisualizationId, onError, onExportReady, onLoadingChanged, screen, } = props;
|
|
23
|
+
const [activeVisualizationId, setActiveVisualizationId] = React.useState(initialActiveVisualizationId);
|
|
24
|
+
const activeVisualization = widget.visualizations.find((visualization) => visualization.identifier === activeVisualizationId) ??
|
|
25
|
+
widget.visualizations[0];
|
|
26
|
+
const insights = useDashboardSelector(selectInsightsMap);
|
|
27
|
+
const insight = activeVisualization ? insights.get(activeVisualization.insight) : undefined;
|
|
28
|
+
if (!activeVisualization || !insight) {
|
|
29
|
+
return React.createElement(ViewModeDashboardVisualizationSwitcherEmpty, null);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return (React.createElement(ViewModeDashboardVisualizationSwitcherContent, { widget: widget, insight: insight, activeVisualization: activeVisualization, screen: screen, onError: onError, onExportReady: onExportReady, onLoadingChanged: onLoadingChanged, onActiveVisualizationChange: setActiveVisualizationId }));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const ViewModeDashboardVisualizationSwitcherEmpty = () => {
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
const intl = useIntl();
|
|
38
|
+
const emptyContentIconColor = theme?.palette?.complementary?.c7 ?? "#6D7680";
|
|
39
|
+
return (React.createElement("div", { className: "gd-visualization-switcher-widget-empty-content" },
|
|
40
|
+
React.createElement(Icon.VisualizationSwitcher, { width: 32, height: 38, color: emptyContentIconColor }),
|
|
41
|
+
React.createElement(Typography, { tagName: "p" }, intl.formatMessage({ id: "visualizationSwitcher.emptyContent" }))));
|
|
42
|
+
};
|
|
43
|
+
export const ViewModeDashboardVisualizationSwitcherContent = ({ widget, insight, activeVisualization, onActiveVisualizationChange, screen, onError, onExportReady, onLoadingChanged, }) => {
|
|
44
|
+
const intl = useIntl();
|
|
45
|
+
const visType = insightVisualizationType(insight);
|
|
46
|
+
const settings = useDashboardSelector(selectSettings);
|
|
47
|
+
const { showOthers } = useExecutionProgress();
|
|
48
|
+
const { ref: widgetRef } = activeVisualization;
|
|
49
|
+
const { exportCSVEnabled, exportXLSXEnabled, onExportCSV, onExportXLSX } = useInsightExport({
|
|
50
|
+
widgetRef,
|
|
51
|
+
title: widgetTitle(activeVisualization) || intl.formatMessage({ id: "export.defaultTitle" }),
|
|
52
|
+
insight,
|
|
53
|
+
});
|
|
54
|
+
const { onScheduleEmailingOpen, onScheduleEmailingManagementOpen, isScheduledEmailingVisible, isScheduledManagementEmailingVisible, numberOfAvailableDestinations, } = useDashboardScheduledEmails();
|
|
55
|
+
const onScheduleExport = useCallback(() => {
|
|
56
|
+
onScheduleEmailingOpen(activeVisualization);
|
|
57
|
+
}, [onScheduleEmailingOpen, activeVisualization]);
|
|
58
|
+
const onScheduleManagementExport = useCallback(() => {
|
|
59
|
+
onScheduleEmailingManagementOpen(activeVisualization);
|
|
60
|
+
}, [onScheduleEmailingManagementOpen, activeVisualization]);
|
|
61
|
+
const { isAlertingVisible, alertingDisabled, alertingDisabledReason, scheduleExportDisabled, scheduleExportManagementDisabled, scheduleExportDisabledReason, } = useAlertingAndScheduling({
|
|
62
|
+
widget: activeVisualization,
|
|
63
|
+
insight,
|
|
64
|
+
numberOfAvailableDestinations,
|
|
65
|
+
});
|
|
66
|
+
const { closeMenu, isMenuOpen, menuItems, openMenu } = useInsightMenu({
|
|
67
|
+
insight,
|
|
68
|
+
widget: activeVisualization,
|
|
69
|
+
exportCSVEnabled,
|
|
70
|
+
exportXLSXEnabled,
|
|
71
|
+
onExportCSV,
|
|
72
|
+
onExportXLSX,
|
|
73
|
+
onScheduleExport,
|
|
74
|
+
onScheduleManagementExport,
|
|
75
|
+
isScheduleExportVisible: isScheduledEmailingVisible,
|
|
76
|
+
isScheduleExportManagementVisible: isScheduledManagementEmailingVisible,
|
|
77
|
+
isAlertingVisible,
|
|
78
|
+
alertingDisabled,
|
|
79
|
+
alertingDisabledReason,
|
|
80
|
+
scheduleExportDisabled,
|
|
81
|
+
scheduleExportManagementDisabled,
|
|
82
|
+
scheduleExportDisabledReason,
|
|
83
|
+
});
|
|
84
|
+
const toggleMenu = useCallback(() => {
|
|
85
|
+
if (isMenuOpen) {
|
|
86
|
+
closeMenu();
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
openMenu();
|
|
90
|
+
}
|
|
91
|
+
}, [isMenuOpen, closeMenu, openMenu]);
|
|
92
|
+
const { InsightMenuButtonComponentProvider, InsightMenuComponentProvider } = useDashboardComponentsContext();
|
|
93
|
+
const InsightMenuButtonComponent = useMemo(() => InsightMenuButtonComponentProvider(insight, activeVisualization), [InsightMenuButtonComponentProvider, insight, activeVisualization]);
|
|
94
|
+
const InsightMenuComponent = useMemo(() => InsightMenuComponentProvider(insight, activeVisualization), [InsightMenuComponentProvider, insight, activeVisualization]);
|
|
95
|
+
return (React.createElement(DashboardItem, { className: cx("type-visualization", "gd-dashboard-view-widget", getVisTypeCssClass(activeVisualization.type, visType)), screen: screen },
|
|
96
|
+
React.createElement(DashboardItemVisualization, { renderHeadline: (clientHeight, clientWidth) => (React.createElement(VisualizationSwitcherNavigationHeader, { widget: widget, clientHeight: clientHeight, clientWidth: clientWidth, activeVisualization: activeVisualization, onActiveVisualizationChange: (activeVisualizationId) => onActiveVisualizationChange(activeVisualizationId) })), renderBeforeVisualization: () => (React.createElement("div", { className: "gd-absolute-row" },
|
|
97
|
+
settings?.enableDescriptions ? (React.createElement(InsightWidgetDescriptionTrigger, { insight: insight, widget: activeVisualization, screen: screen })) : null,
|
|
98
|
+
React.createElement(InsightMenuButtonComponent, { insight: insight, widget: activeVisualization, isOpen: isMenuOpen, onClick: toggleMenu, items: menuItems }))), renderAfterContent: () => {
|
|
99
|
+
if (!isMenuOpen) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return (React.createElement(InsightMenuComponent, { insight: insight, widget: activeVisualization, isOpen: isMenuOpen, onClose: closeMenu, items: menuItems }));
|
|
103
|
+
} }, ({ clientHeight, clientWidth }) => (React.createElement(AllVisualizationsDashInsights, { visualizations: widget.visualizations, activeVisualization: activeVisualization, showOthers: showOthers, onExportReady: onExportReady, onError: onError, onLoadingChanged: onLoadingChanged, clientHeight: clientHeight, clientWidth: clientWidth })))));
|
|
8
104
|
};
|
|
9
105
|
//# sourceMappingURL=ViewModeDashboardVisualizationSwitcher.js.map
|
package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeDashboardVisualizationSwitcher.js","sourceRoot":"","sources":["../../../../src/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.tsx"],"names":[],"mappings":"AAAA,gCAAgC;
|
|
1
|
+
{"version":3,"file":"ViewModeDashboardVisualizationSwitcher.js","sourceRoot":"","sources":["../../../../src/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,2BAA2B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EACH,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,GACrB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAA4B,wBAAwB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEtG,OAAO,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,qCAAqC,EAAE,MAAM,gFAAgF,CAAC;AACvI,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,GAAG,EAAE;gBACrB,IAAI,CAAC,UAAU,EAAE,CAAC;oBACd,OAAO,IAAI,CAAC;gBAChB,CAAC;gBAED,OAAO,CACH,oBAAC,oBAAoB,IACjB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,GAClB,CACL,CAAC;YACN,CAAC,IAEA,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAChC,oBAAC,6BAA6B,IAC1B,cAAc,EAAE,MAAM,CAAC,cAAc,EACrC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,GAC1B,CACL,CACwB,CACjB,CACnB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExecutionProgress.d.ts","sourceRoot":"","sources":["../../../../src/presentation/widget/visualizationSwitcher/useExecutionProgress.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,oBAAoB;gBACjB,OAAO;CAoEtB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// (C) 2024 GoodData Corporation
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useDashboardSelector, selectIsDashboardExecuted, useDashboardEventsContext, isDashboardFilterContextChanged, isDashboardCommandStarted, } from "../../../model/index.js";
|
|
4
|
+
export const useExecutionProgress = () => {
|
|
5
|
+
const isDashboardExecuted = useDashboardSelector(selectIsDashboardExecuted);
|
|
6
|
+
const [isReexecuting, setIsReexecuting] = useState(true); // execution running as default because it covers the initial render and mode switching
|
|
7
|
+
const [_executionsProgress, setExecutionsProgress] = useState({});
|
|
8
|
+
const { registerHandler, unregisterHandler } = useDashboardEventsContext();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const onActionTriggeringReexecution = {
|
|
11
|
+
eval: (evt) => {
|
|
12
|
+
return isDashboardFilterContextChanged(evt);
|
|
13
|
+
},
|
|
14
|
+
handler: () => {
|
|
15
|
+
setIsReexecuting(true);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const onRenderRequest = {
|
|
19
|
+
eval: (evt) => {
|
|
20
|
+
return (isDashboardCommandStarted(evt) &&
|
|
21
|
+
evt.payload.command.type === "GDC.DASH/CMD.RENDER.ASYNC.REQUEST");
|
|
22
|
+
},
|
|
23
|
+
handler: (evt) => {
|
|
24
|
+
setExecutionsProgress((prev) => ({
|
|
25
|
+
...prev,
|
|
26
|
+
[evt.payload.command.payload.id]: true,
|
|
27
|
+
}));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const onRenderResponse = {
|
|
31
|
+
eval: (evt) => {
|
|
32
|
+
return (isDashboardCommandStarted(evt) &&
|
|
33
|
+
evt.payload.command.type === "GDC.DASH/CMD.RENDER.ASYNC.RESOLVE");
|
|
34
|
+
},
|
|
35
|
+
handler: (evt) => {
|
|
36
|
+
setExecutionsProgress((prev) => {
|
|
37
|
+
const newProgress = {
|
|
38
|
+
...prev,
|
|
39
|
+
[evt.payload.command.payload.id]: false,
|
|
40
|
+
};
|
|
41
|
+
if (Object.values(newProgress).every((value) => !value)) {
|
|
42
|
+
setIsReexecuting(false);
|
|
43
|
+
}
|
|
44
|
+
return newProgress;
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
registerHandler(onActionTriggeringReexecution);
|
|
49
|
+
registerHandler(onRenderRequest);
|
|
50
|
+
registerHandler(onRenderResponse);
|
|
51
|
+
return () => {
|
|
52
|
+
unregisterHandler(onActionTriggeringReexecution);
|
|
53
|
+
unregisterHandler(onRenderRequest);
|
|
54
|
+
unregisterHandler(onRenderResponse);
|
|
55
|
+
};
|
|
56
|
+
}, [registerHandler, unregisterHandler]);
|
|
57
|
+
const showOthers = isDashboardExecuted && !isReexecuting;
|
|
58
|
+
return { showOthers };
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=useExecutionProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExecutionProgress.js","sourceRoot":"","sources":["../../../../src/presentation/widget/visualizationSwitcher/useExecutionProgress.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACH,oBAAoB,EACpB,yBAAyB,EAEzB,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,GAI5B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAElC,EAAE;IACA,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;IAC5E,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,uFAAuF;IAEjJ,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAElE,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,GAAG,yBAAyB,EAAE,CAAC;IAE3E,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,6BAA6B,GAA0B;YACzD,IAAI,EAAE,CAAC,GAAQ,EAAE,EAAE;gBACf,OAAO,+BAA+B,CAAC,GAAG,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,EAAE,GAAG,EAAE;gBACV,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;SACJ,CAAC;QACF,MAAM,eAAe,GAA0B;YAC3C,IAAI,EAAE,CAAC,GAAQ,EAAE,EAAE;gBACf,OAAO,CACH,yBAAyB,CAAC,GAAG,CAAC;oBAC9B,GAAG,CAAC,OAAO,CAAC,OAAO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gBAAgB,CAAC,CAAC;QACxC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEzC,MAAM,UAAU,GAAG,mBAAmB,IAAI,CAAC,aAAa,CAAC;IACzD,OAAO,EAAE,UAAU,EAAE,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultDashboardInsightWidget.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultDashboardInsightWidget.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAwBpD,OAAO,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAC;AAGjE,eAAO,MAAM,6BAA6B,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,mCAAmC,EAAE,SAAS,CAAC,CAIxG,CAAC"}
|
|
@@ -3,8 +3,7 @@ import React, { useMemo, useCallback } from "react";
|
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { widgetTitle, insightVisualizationType } from "@gooddata/sdk-model";
|
|
6
|
-
import {
|
|
7
|
-
import { useDashboardSelector, selectSettings, isCustomWidget, useDashboardScheduledEmails, } from "../../../../model/index.js";
|
|
6
|
+
import { useDashboardSelector, selectSettings, useDashboardScheduledEmails, } from "../../../../model/index.js";
|
|
8
7
|
import { DashboardItem, DashboardItemHeadline, DashboardItemVisualization, getVisTypeCssClass, } from "../../../presentationComponents/index.js";
|
|
9
8
|
import { DashboardInsight } from "../../insight/index.js";
|
|
10
9
|
import { useInsightExport } from "../../common/index.js";
|
|
@@ -12,6 +11,7 @@ import { useDashboardComponentsContext } from "../../../dashboardContexts/index.
|
|
|
12
11
|
import { InsightWidgetDescriptionTrigger } from "../../description/InsightWidgetDescriptionTrigger.js";
|
|
13
12
|
import { useInsightMenu } from "./useInsightMenu.js";
|
|
14
13
|
import { DashboardWidgetInsightGuard } from "./DashboardWidgetInsightGuard.js";
|
|
14
|
+
import { useAlertingAndScheduling } from "./useAlertingAndScheduling.js";
|
|
15
15
|
export const DefaultDashboardInsightWidget = (props) => {
|
|
16
16
|
return React.createElement(DashboardWidgetInsightGuard, { ...props, Component: DefaultDashboardInsightWidgetCore });
|
|
17
17
|
};
|
|
@@ -35,43 +35,11 @@ const DefaultDashboardInsightWidgetCore = ({ widget, insight, screen, onError, o
|
|
|
35
35
|
const onScheduleManagementExport = useCallback(() => {
|
|
36
36
|
onScheduleEmailingManagementOpen(widget);
|
|
37
37
|
}, [onScheduleEmailingManagementOpen, widget]);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const isAlertingEnabled = settings.enableAlerting === true;
|
|
44
|
-
const isInsightTypeSupportedForAlerting = isInsightSupportedForAlerts(insight);
|
|
45
|
-
const isInsightEnabledForAlerting = isInsightAlertingConfigurationEnabled(insight);
|
|
46
|
-
const isAlertingVisible = isAlertingEnabled && isStandardWidget && isInsightTypeSupportedForAlerting;
|
|
47
|
-
const alertingDisabled = hasNoDestinations || !isInsightEnabledForAlerting || widgetHasNoLocalIdentifier;
|
|
48
|
-
let alertingDisabledReason = undefined;
|
|
49
|
-
if (widgetHasNoLocalIdentifier) {
|
|
50
|
-
alertingDisabledReason = "oldWidget";
|
|
51
|
-
}
|
|
52
|
-
else if (hasNoDestinations) {
|
|
53
|
-
alertingDisabledReason = "noDestinations";
|
|
54
|
-
}
|
|
55
|
-
else if (!isInsightEnabledForAlerting) {
|
|
56
|
-
alertingDisabledReason = "disabledOnInsight";
|
|
57
|
-
}
|
|
58
|
-
const isInsightTypeSupportedForScheduling = isInsightSupportedForScheduledExports(insight);
|
|
59
|
-
const isInsightEnabledForScheduling = isInsightScheduledExportsConfigurationEnabled(insight);
|
|
60
|
-
const scheduleExportDisabled = !isInsightTypeSupportedForScheduling ||
|
|
61
|
-
!isStandardWidget ||
|
|
62
|
-
!isInsightEnabledForScheduling ||
|
|
63
|
-
widgetHasNoLocalIdentifier;
|
|
64
|
-
const scheduleExportManagementDisabled = !isStandardWidget;
|
|
65
|
-
let scheduleExportDisabledReason = undefined;
|
|
66
|
-
if (widgetHasNoLocalIdentifier) {
|
|
67
|
-
scheduleExportDisabledReason = "oldWidget";
|
|
68
|
-
}
|
|
69
|
-
else if (!isStandardWidget) {
|
|
70
|
-
scheduleExportDisabledReason = "incompatibleWidget";
|
|
71
|
-
}
|
|
72
|
-
else if (!isInsightEnabledForScheduling || !isInsightTypeSupportedForScheduling) {
|
|
73
|
-
scheduleExportDisabledReason = "disabledOnInsight";
|
|
74
|
-
}
|
|
38
|
+
const { isAlertingVisible, alertingDisabled, alertingDisabledReason, scheduleExportDisabled, scheduleExportManagementDisabled, scheduleExportDisabledReason, } = useAlertingAndScheduling({
|
|
39
|
+
widget,
|
|
40
|
+
insight,
|
|
41
|
+
numberOfAvailableDestinations,
|
|
42
|
+
});
|
|
75
43
|
///
|
|
76
44
|
const { closeMenu, isMenuOpen, menuItems, openMenu } = useInsightMenu({
|
|
77
45
|
insight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultDashboardInsightWidget.js","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAY,WAAW,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultDashboardInsightWidget.js","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAY,WAAW,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGtF,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,2BAA2B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,GACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,sDAAsD,CAAC;AAEvG,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,CAAC,MAAM,6BAA6B,GAAmE,CACzG,KAAK,EACP,EAAE;IACA,OAAO,oBAAC,2BAA2B,OAAK,KAAK,EAAE,SAAS,EAAE,iCAAiC,GAAI,CAAC;AACpG,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,iCAAiC,GAEnC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,EAAE,EAAE;I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E,EAEL,yBAAyB,EAAE,GAAG,EAAE,CAAC,CAC7B,6BAAK,SAAS,EAAC,iBAAiB;gBAC3B,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAC5B,oBAAC,+BAA+B,IAC5B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAChB,CACL,CAAC,CAAC,CAAC,IAAI;gBACR,oBAAC,0BAA0B,IACvB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,SAAS,GAClB,CACA,CACT,EACD,kBAAkB,EAAE,GAAG,EAAE;gBACrB,IAAI,CAAC,UAAU,EAAE,CAAC;oBACd,OAAO,IAAI,CAAC;gBAChB,CAAC;gBAED,OAAO,CACH,oBAAC,oBAAoB,IACjB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,GAClB,CACL,CAAC;YACN,CAAC,IAEA,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAChC,oBAAC,gBAAgB,IACb,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,GACpC,CACL,CACwB,CACjB,CACnB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IInsight, IInsightWidget } from "@gooddata/sdk-model";
|
|
2
|
+
import { AlertingDisabledReason, SchedulingDisabledReason } from "../../insightMenu/index.js";
|
|
3
|
+
type UseAlertingAndSchedulingConfig = {
|
|
4
|
+
insight: IInsight;
|
|
5
|
+
widget: IInsightWidget;
|
|
6
|
+
numberOfAvailableDestinations: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const useAlertingAndScheduling: ({ widget, insight, numberOfAvailableDestinations, }: UseAlertingAndSchedulingConfig) => {
|
|
9
|
+
isAlertingVisible: boolean;
|
|
10
|
+
alertingDisabled: boolean;
|
|
11
|
+
alertingDisabledReason?: AlertingDisabledReason | undefined;
|
|
12
|
+
scheduleExportDisabled: boolean;
|
|
13
|
+
scheduleExportManagementDisabled: boolean;
|
|
14
|
+
scheduleExportDisabledReason?: SchedulingDisabledReason | undefined;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=useAlertingAndScheduling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlertingAndScheduling.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/InsightWidget/useAlertingAndScheduling.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAQ9F,KAAK,8BAA8B,GAAG;IAClC,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,6BAA6B,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,wBAAwB,wDAIlC,8BAA8B;uBACV,OAAO;sBACR,OAAO;;4BAED,OAAO;sCACG,OAAO;;CAmD5C,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// (C) 2024 GoodData Corporation
|
|
2
|
+
import { useDashboardSelector, selectSettings, isCustomWidget } from "../../../../model/index.js";
|
|
3
|
+
import { isInsightAlertingConfigurationEnabled, isInsightScheduledExportsConfigurationEnabled, isInsightSupportedForAlerts, isInsightSupportedForScheduledExports, } from "@gooddata/sdk-ui-ext";
|
|
4
|
+
export const useAlertingAndScheduling = ({ widget, insight, numberOfAvailableDestinations, }) => {
|
|
5
|
+
const settings = useDashboardSelector(selectSettings);
|
|
6
|
+
const isStandardWidget = !isCustomWidget(widget);
|
|
7
|
+
const hasNoDestinations = numberOfAvailableDestinations === 0;
|
|
8
|
+
//NOTE: Check if widget has localIdentifier, if not that is probably widget from old dashboard
|
|
9
|
+
// and we should not allow to schedule export/alert because we need localIdentifier to identify the widget
|
|
10
|
+
const widgetHasNoLocalIdentifier = !widget.localIdentifier;
|
|
11
|
+
const isAlertingEnabled = settings.enableAlerting === true;
|
|
12
|
+
const isInsightTypeSupportedForAlerting = isInsightSupportedForAlerts(insight);
|
|
13
|
+
const isInsightEnabledForAlerting = isInsightAlertingConfigurationEnabled(insight);
|
|
14
|
+
const isAlertingVisible = isAlertingEnabled && isStandardWidget && isInsightTypeSupportedForAlerting;
|
|
15
|
+
const alertingDisabled = hasNoDestinations || !isInsightEnabledForAlerting || widgetHasNoLocalIdentifier;
|
|
16
|
+
let alertingDisabledReason = undefined;
|
|
17
|
+
if (widgetHasNoLocalIdentifier) {
|
|
18
|
+
alertingDisabledReason = "oldWidget";
|
|
19
|
+
}
|
|
20
|
+
else if (hasNoDestinations) {
|
|
21
|
+
alertingDisabledReason = "noDestinations";
|
|
22
|
+
}
|
|
23
|
+
else if (!isInsightEnabledForAlerting) {
|
|
24
|
+
alertingDisabledReason = "disabledOnInsight";
|
|
25
|
+
}
|
|
26
|
+
const isInsightTypeSupportedForScheduling = isInsightSupportedForScheduledExports(insight);
|
|
27
|
+
const isInsightEnabledForScheduling = isInsightScheduledExportsConfigurationEnabled(insight);
|
|
28
|
+
const scheduleExportDisabled = !isInsightTypeSupportedForScheduling ||
|
|
29
|
+
!isStandardWidget ||
|
|
30
|
+
!isInsightEnabledForScheduling ||
|
|
31
|
+
widgetHasNoLocalIdentifier;
|
|
32
|
+
const scheduleExportManagementDisabled = !isStandardWidget;
|
|
33
|
+
let scheduleExportDisabledReason = undefined;
|
|
34
|
+
if (widgetHasNoLocalIdentifier) {
|
|
35
|
+
scheduleExportDisabledReason = "oldWidget";
|
|
36
|
+
}
|
|
37
|
+
else if (!isStandardWidget) {
|
|
38
|
+
scheduleExportDisabledReason = "incompatibleWidget";
|
|
39
|
+
}
|
|
40
|
+
else if (!isInsightEnabledForScheduling || !isInsightTypeSupportedForScheduling) {
|
|
41
|
+
scheduleExportDisabledReason = "disabledOnInsight";
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
isAlertingVisible,
|
|
45
|
+
alertingDisabled,
|
|
46
|
+
alertingDisabledReason,
|
|
47
|
+
scheduleExportDisabled,
|
|
48
|
+
scheduleExportManagementDisabled,
|
|
49
|
+
scheduleExportDisabledReason,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=useAlertingAndScheduling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlertingAndScheduling.js","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/InsightWidget/useAlertingAndScheduling.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAGhC,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAElG,OAAO,EACH,qCAAqC,EACrC,6CAA6C,EAC7C,2BAA2B,EAC3B,qCAAqC,GACxC,MAAM,sBAAsB,CAAC;AAQ9B,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACrC,MAAM,EACN,OAAO,EACP,6BAA6B,GACA,EAO/B,EAAE;IACA,MAAM,QAAQ,GAAG,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAEtD,MAAM,gBAAgB,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,iBAAiB,GAAG,6BAA6B,KAAK,CAAC,CAAC;IAE9D,8FAA8F;IAC9F,0GAA0G;IAC1G,MAAM,0BAA0B,GAAG,CAAC,MAAM,CAAC,eAAe,CA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B,gBAAgB;QAChB,sBAAsB;QACtB,sBAAsB;QACtB,gCAAgC;QAChC,4BAA4B;KAC/B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IInsightWidget, IVisualizationSwitcherWidget } from "@gooddata/sdk-model";
|
|
3
|
+
interface IVisualizationSwitcherNavigationHeaderProps {
|
|
4
|
+
clientWidth: number | undefined;
|
|
5
|
+
clientHeight: number | undefined;
|
|
6
|
+
activeVisualization: IInsightWidget;
|
|
7
|
+
widget: IVisualizationSwitcherWidget;
|
|
8
|
+
onActiveVisualizationChange: (visualizationId: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const VisualizationSwitcherNavigationHeader: React.FC<IVisualizationSwitcherNavigationHeaderProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=VisualizationSwitcherNavigationHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisualizationSwitcherNavigationHeader.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAA6B,MAAM,qBAAqB,CAAC;AAQ9G,UAAU,2CAA2C;IACjD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,mBAAmB,EAAE,cAAc,CAAC;IACpC,MAAM,EAAE,4BAA4B,CAAC;IACrC,2BAA2B,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;CAClE;AAaD,eAAO,MAAM,qCAAqC,EAAE,KAAK,CAAC,EAAE,CAAC,2CAA2C,CAkEvG,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// (C) 2020-2024 GoodData Corporation
|
|
2
|
+
import React, { useCallback } from "react";
|
|
3
|
+
import { objRefToString, widgetRef } from "@gooddata/sdk-model";
|
|
4
|
+
import { DashboardItemHeadlineContainer } from "../../../presentationComponents/index.js";
|
|
5
|
+
import { ItemsWrapper, Overlay, ShortenedText } from "@gooddata/sdk-ui-kit";
|
|
6
|
+
import cx from "classnames";
|
|
7
|
+
import { stringUtils } from "@gooddata/util";
|
|
8
|
+
const alignPoints = [
|
|
9
|
+
{
|
|
10
|
+
align: "bc tc",
|
|
11
|
+
offset: { x: 0, y: 9 },
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
align: "tc bc",
|
|
15
|
+
offset: { x: 0, y: -9 },
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
export const VisualizationSwitcherNavigationHeader = ({ widget, clientWidth, clientHeight, activeVisualization, onActiveVisualizationChange, }) => {
|
|
19
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
20
|
+
const widgetRefAsString = objRefToString(widgetRef(widget));
|
|
21
|
+
const alignTo = `gd-visualization-switcher-widget-header-${stringUtils.simplifyText(widgetRefAsString)}`;
|
|
22
|
+
const toggleDropdown = () => {
|
|
23
|
+
setIsOpen(!isOpen);
|
|
24
|
+
};
|
|
25
|
+
const onSelect = useCallback((item) => {
|
|
26
|
+
onActiveVisualizationChange(item.identifier);
|
|
27
|
+
setIsOpen(false);
|
|
28
|
+
}, [onActiveVisualizationChange]);
|
|
29
|
+
return (React.createElement(DashboardItemHeadlineContainer, { clientHeight: clientHeight },
|
|
30
|
+
React.createElement(VisualizationSwitcherNavigationHeaderButton, { className: alignTo, title: activeVisualization.title, isOpen: isOpen, toggleDropdown: toggleDropdown }),
|
|
31
|
+
isOpen ? (React.createElement(Overlay, { key: "VisualizationSwitcherNavigationHeader", alignTo: `.${alignTo}`, alignPoints: alignPoints, className: "s-visualization-switcher-widget-header", closeOnMouseDrag: true, closeOnOutsideClick: true, closeOnParentScroll: true, onClose: toggleDropdown },
|
|
32
|
+
React.createElement(ItemsWrapper, { className: "gd-visualization-switcher-widget-header-list" },
|
|
33
|
+
React.createElement("div", { className: "gd-visualization-switcher-widget-header-list-container" }, widget.visualizations.map((visualization) => {
|
|
34
|
+
return (React.createElement(VisualizationSwitcherNavigationHeaderItem, { key: visualization.identifier, onSelect: onSelect, item: visualization, isSelected: visualization.identifier === activeVisualization.identifier, maxWidth: clientWidth ?? 200 }));
|
|
35
|
+
}))))) : null));
|
|
36
|
+
};
|
|
37
|
+
const VisualizationSwitcherNavigationHeaderButton = ({ isOpen, toggleDropdown, title, className }) => {
|
|
38
|
+
const classNames = cx("gd-visualization-switcher-widget-header", className, {
|
|
39
|
+
"is-open": isOpen,
|
|
40
|
+
});
|
|
41
|
+
return (React.createElement("div", { className: classNames, onClick: toggleDropdown }, title));
|
|
42
|
+
};
|
|
43
|
+
const VisualizationSwitcherNavigationHeaderItem = ({ item, isSelected, onSelect, maxWidth, }) => {
|
|
44
|
+
const classNames = cx("gd-visualization-switcher-widget-header-item", "gd-list-item", {
|
|
45
|
+
"is-selected": isSelected,
|
|
46
|
+
});
|
|
47
|
+
return (React.createElement("div", { className: classNames, onClick: () => {
|
|
48
|
+
onSelect(item);
|
|
49
|
+
} },
|
|
50
|
+
React.createElement("div", { className: "gd-visualization-switcher-widget-header-item-content", style: { maxWidth } },
|
|
51
|
+
React.createElement(ShortenedText, { className: "title" }, item.title))));
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=VisualizationSwitcherNavigationHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisualizationSwitcherNavigationHeader.js","sourceRoot":"","sources":["../../../../../src/presentation/widget/widget/VisualizationSwitcherWidget/VisualizationSwitcherNavigationHeader.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAgD,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAA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EACV,QAAQ,EACR,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,UAAU,GAAG,EAAE,CAAC,8CAA8C,EAAE,cAAc,EAAE;QAClF,aAAa,EAAE,UAAU;KAC5B,CAAC,CAAC;IACH,OAAO,CACH,6BACI,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,GAAG,EAAE;YACV,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;QAED,6BAAK,SAAS,EAAC,sDAAsD,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE;YACrF,oBAAC,aAAa,IAAC,SAAS,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAiB,CAC3D,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -5429,6 +5429,7 @@ export declare interface DashboardState {
|
|
|
5429
5429
|
/** @beta */
|
|
5430
5430
|
loading: LoadingState;
|
|
5431
5431
|
saving: SavingState;
|
|
5432
|
+
executed: ExecutedState;
|
|
5432
5433
|
backendCapabilities: BackendCapabilitiesState;
|
|
5433
5434
|
config: ConfigState;
|
|
5434
5435
|
/** @beta */
|
|
@@ -6931,6 +6932,13 @@ export declare interface EntitlementsState {
|
|
|
6931
6932
|
entitlements?: ResolvedEntitlements;
|
|
6932
6933
|
}
|
|
6933
6934
|
|
|
6935
|
+
/**
|
|
6936
|
+
* @beta
|
|
6937
|
+
*/
|
|
6938
|
+
export declare interface ExecutedState {
|
|
6939
|
+
executed: boolean;
|
|
6940
|
+
}
|
|
6941
|
+
|
|
6934
6942
|
/**
|
|
6935
6943
|
* @internal
|
|
6936
6944
|
*/
|
|
@@ -16724,6 +16732,11 @@ export declare const selectIsCrossFiltering: DashboardSelector<boolean>;
|
|
|
16724
16732
|
*/
|
|
16725
16733
|
export declare const selectIsDashboardDirty: DashboardSelector<boolean>;
|
|
16726
16734
|
|
|
16735
|
+
/**
|
|
16736
|
+
* @internal
|
|
16737
|
+
*/
|
|
16738
|
+
export declare const selectIsDashboardExecuted: DashboardSelector<boolean>;
|
|
16739
|
+
|
|
16727
16740
|
/**
|
|
16728
16741
|
* @internal
|
|
16729
16742
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-dashboard",
|
|
3
|
-
"version": "10.12.0-alpha.
|
|
3
|
+
"version": "10.12.0-alpha.8",
|
|
4
4
|
"description": "GoodData SDK - Dashboard Component",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"ts-invariant": "^0.7.5",
|
|
58
58
|
"tslib": "^2.5.0",
|
|
59
59
|
"uuid": "^8.3.2",
|
|
60
|
-
"@gooddata/sdk-backend-base": "10.12.0-alpha.
|
|
61
|
-
"@gooddata/sdk-backend-spi": "10.12.0-alpha.
|
|
62
|
-
"@gooddata/sdk-
|
|
63
|
-
"@gooddata/sdk-
|
|
64
|
-
"@gooddata/sdk-ui-ext": "10.12.0-alpha.
|
|
65
|
-
"@gooddata/sdk-ui-filters": "10.12.0-alpha.
|
|
66
|
-
"@gooddata/sdk-ui-geo": "10.12.0-alpha.
|
|
67
|
-
"@gooddata/sdk-ui-
|
|
68
|
-
"@gooddata/sdk-ui-
|
|
69
|
-
"@gooddata/sdk-ui-
|
|
70
|
-
"@gooddata/util": "10.12.0-alpha.
|
|
60
|
+
"@gooddata/sdk-backend-base": "10.12.0-alpha.8",
|
|
61
|
+
"@gooddata/sdk-backend-spi": "10.12.0-alpha.8",
|
|
62
|
+
"@gooddata/sdk-ui": "10.12.0-alpha.8",
|
|
63
|
+
"@gooddata/sdk-model": "10.12.0-alpha.8",
|
|
64
|
+
"@gooddata/sdk-ui-ext": "10.12.0-alpha.8",
|
|
65
|
+
"@gooddata/sdk-ui-filters": "10.12.0-alpha.8",
|
|
66
|
+
"@gooddata/sdk-ui-geo": "10.12.0-alpha.8",
|
|
67
|
+
"@gooddata/sdk-ui-theme-provider": "10.12.0-alpha.8",
|
|
68
|
+
"@gooddata/sdk-ui-kit": "10.12.0-alpha.8",
|
|
69
|
+
"@gooddata/sdk-ui-vis-commons": "10.12.0-alpha.8",
|
|
70
|
+
"@gooddata/util": "10.12.0-alpha.8"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^16.10.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -120,9 +120,9 @@
|
|
|
120
120
|
"typescript": "5.3.3",
|
|
121
121
|
"vitest": "1.0.4",
|
|
122
122
|
"vitest-dom": "0.1.1",
|
|
123
|
-
"@gooddata/i18n-toolkit": "10.12.0-alpha.
|
|
124
|
-
"@gooddata/reference-workspace": "10.12.0-alpha.
|
|
125
|
-
"@gooddata/sdk-backend-mockingbird": "10.12.0-alpha.
|
|
123
|
+
"@gooddata/i18n-toolkit": "10.12.0-alpha.8",
|
|
124
|
+
"@gooddata/reference-workspace": "10.12.0-alpha.8",
|
|
125
|
+
"@gooddata/sdk-backend-mockingbird": "10.12.0-alpha.8"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"clean": "rm -rf ci dist esm coverage *.log styles/css tsconfig.tsbuildinfo",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../node_modules/@gooddata/sdk-ui-kit/styles/scss/mixins.scss","../../node_modules/@gooddata/sdk-ui-kit/styles/scss/Bubble/_variables.scss","../scss/insightConfiguration.scss","../../node_modules/@gooddata/sdk-ui-kit/styles/scss/variables.scss"],"names":[],"mappings":"AA0HA;AA4DA;ACjLA;AAAA;AAAA;ACOA;AAAA;EACI;EACA;EACA;EACA;;;AAKI;EACI;EACA;EACA;EACA;EACA;EACA;EACA,OAxBS;;AA2Bb;EACI;EACA;EACA;;AAEA;EAGI;EACA;EACA,OCfA;EDgBA;;AAGJ;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAIR;EACI;;AAGJ;EACI;EACA;;AAEA;EACI;EACA;EACA;EACA,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../node_modules/@gooddata/sdk-ui-kit/styles/scss/mixins.scss","../../node_modules/@gooddata/sdk-ui-kit/styles/scss/Bubble/_variables.scss","../scss/insightConfiguration.scss","../../node_modules/@gooddata/sdk-ui-kit/styles/scss/variables.scss"],"names":[],"mappings":"AA0HA;AA4DA;ACjLA;AAAA;AAAA;ACOA;AAAA;EACI;EACA;EACA;EACA;;;AAKI;EACI;EACA;EACA;EACA;EACA;EACA;EACA,OAxBS;;AA2Bb;EACI;EACA;EACA;;AAEA;EAGI;EACA;EACA,OCfA;EDgBA;;AAGJ;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAIR;EACI;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA,OApEe;;AAwEvB;AAAA;EAII;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;;AAIR;EACI;EACA;;AAIR;EACI;EACA;EACA;;AAEA;EACI;;AAIR;EACI,kBA5GkB;EA6GlB;EACA;;AAEJ;EACI;;AAGA;EACI;EACA;EACA;EACA;EACA,OChGI;;ADkGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA,OArIiB;EAsIjB;;AAEJ;EACI;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;;AAIJ;EACI;EACA;;AAGR;EACI,kBA5Ja;EA6Jb,OC7GY;;AD+GZ;EACI;;AAIZ;EACI;;;AAIR;EACI;;;AAGJ;EACI;;;AAGJ;EACI,oBC/EoB;;;ADkFxB;EACI,mBCnFoB;;;ADsFxB;EACI;;;AAOI;EACI;;AAKJ;EACI;;AAKJ;EACI","file":"insightConfiguration.css"}
|