@gooddata/sdk-ui-dashboard 10.9.0-alpha.11 → 10.9.0-alpha.13
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/assets/filter.svg +1 -0
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +1 -0
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js.map +1 -1
- package/esm/model/store/index.d.ts +2 -2
- package/esm/model/store/index.d.ts.map +1 -1
- package/esm/model/store/index.js +1 -1
- package/esm/model/store/index.js.map +1 -1
- package/esm/model/store/ui/index.d.ts +7 -0
- package/esm/model/store/ui/index.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.d.ts +8 -1
- package/esm/model/store/ui/uiReducers.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.js +7 -0
- package/esm/model/store/ui/uiReducers.js.map +1 -1
- package/esm/model/store/ui/uiSelectors.d.ts +9 -0
- package/esm/model/store/ui/uiSelectors.d.ts.map +1 -1
- package/esm/model/store/ui/uiSelectors.js +8 -0
- package/esm/model/store/ui/uiSelectors.js.map +1 -1
- package/esm/model/store/ui/uiState.d.ts +8 -0
- package/esm/model/store/ui/uiState.d.ts.map +1 -1
- package/esm/model/store/ui/uiState.js +4 -0
- package/esm/model/store/ui/uiState.js.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js +5 -8
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js +43 -12
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js.map +1 -1
- package/esm/presentation/localization/bundles/en-US.json +10 -0
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js +157 -120
- package/esm/presentation/topBar/menuButton/useDefaultMenuItems.js.map +1 -1
- package/esm/sdk-ui-dashboard.d.ts +27 -0
- package/package.json +15 -15
- package/styles/css/icons.css +7 -0
- package/styles/css/icons.css.map +1 -1
- package/styles/css/main.css +7 -0
- package/styles/css/main.css.map +1 -1
- package/styles/scss/icons.scss +9 -0
|
@@ -1,27 +1,58 @@
|
|
|
1
1
|
// (C) 2024 GoodData Corporation
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { useCallback } from "react";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { DropdownButton } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { DropdownButton, useMediaQuery } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
import { ConfigurationBubble } from "../../../widget/common/configuration/ConfigurationBubble.js";
|
|
7
|
-
import { useDashboardSelector, selectFilterViews, selectIsInEditMode } from "../../../../model/index.js";
|
|
7
|
+
import { useDashboardSelector, selectFilterViews, selectIsInEditMode, useDashboardDispatch, uiActions, selectDisableFilterViews, selectIsFilterViewsDialogOpen, selectFilterViewsDialogMode, } from "../../../../model/index.js";
|
|
8
8
|
import { FilterViewsList } from "./FilterViewsList.js";
|
|
9
9
|
import { useFilterViewsToastMessages } from "./useFilterViewsToastMessages.js";
|
|
10
10
|
import { AddFilterView } from "./AddFilterView.js";
|
|
11
11
|
const BUBBLE_ALIGN_POINTS = [{ align: "br tr", offset: { x: -27, y: -10 } }];
|
|
12
|
+
const DropdownButtonLabel = ({ filterViews }) => {
|
|
13
|
+
return filterViews.length === 0 ? (React.createElement(FormattedMessage, { id: "filters.filterViews.dropdown.buttonEmpty" })) : (React.createElement(FormattedMessage, { id: "filters.filterViews.dropdown.button", values: { count: filterViews?.length ?? 0 } }));
|
|
14
|
+
};
|
|
15
|
+
const useCallbacks = () => {
|
|
16
|
+
const dispatch = useDashboardDispatch();
|
|
17
|
+
const toggleDialog = useCallback(() => dispatch(uiActions.toggleFilterViewsDialog()), [dispatch]);
|
|
18
|
+
const openListDialog = useCallback(() => dispatch(uiActions.toggleFilterViewsDialog({
|
|
19
|
+
open: true,
|
|
20
|
+
mode: "list",
|
|
21
|
+
})), [dispatch]);
|
|
22
|
+
const openAddDialog = useCallback(() => dispatch(uiActions.toggleFilterViewsDialog({
|
|
23
|
+
open: true,
|
|
24
|
+
mode: "add",
|
|
25
|
+
})), [dispatch]);
|
|
26
|
+
const closeDialog = useCallback(() => dispatch(uiActions.toggleFilterViewsDialog({
|
|
27
|
+
open: false,
|
|
28
|
+
})), [dispatch]);
|
|
29
|
+
return {
|
|
30
|
+
toggleDialog,
|
|
31
|
+
openListDialog,
|
|
32
|
+
openAddDialog,
|
|
33
|
+
closeDialog,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
12
36
|
export const FilterViews = () => {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const isEditMode = useDashboardSelector(selectIsInEditMode);
|
|
37
|
+
const isDialogOpen = useDashboardSelector(selectIsFilterViewsDialogOpen);
|
|
38
|
+
const dialogMode = useDashboardSelector(selectFilterViewsDialogMode);
|
|
39
|
+
const isDashboardEditMode = useDashboardSelector(selectIsInEditMode);
|
|
17
40
|
const filterViews = useDashboardSelector(selectFilterViews);
|
|
41
|
+
const isFilterViewsEnabledForDashboard = !useDashboardSelector(selectDisableFilterViews);
|
|
42
|
+
const isMobile = useMediaQuery("mobileDevice");
|
|
43
|
+
const { toggleDialog, openAddDialog, openListDialog, closeDialog } = useCallbacks();
|
|
18
44
|
useFilterViewsToastMessages();
|
|
19
|
-
|
|
20
|
-
|
|
45
|
+
// On mobile the dropdown button is not on filter bar but rendered inside the "..." dashboard menu.
|
|
46
|
+
// The dropdown body must still be rendered so the body can be opened when user uses the menu.
|
|
47
|
+
const showDropdownButton = isFilterViewsEnabledForDashboard && !isMobile;
|
|
48
|
+
const buttonClassNames = cx("gd-filter-views-button", "gd-filter-views__dropdown-anchor", "gd-button-large", {
|
|
49
|
+
"gd-filter-views-button--open": isDialogOpen,
|
|
21
50
|
});
|
|
22
51
|
return (React.createElement("div", { className: "gd-filter-views" },
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
52
|
+
showDropdownButton ? (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement(DropdownButton, { onClick: toggleDialog, className: buttonClassNames, isOpen: isDialogOpen },
|
|
54
|
+
React.createElement(DropdownButtonLabel, { filterViews: filterViews })),
|
|
55
|
+
isDashboardEditMode ? React.createElement("div", { className: "gd-filters-views__panel__divider" }) : null)) : (React.createElement("div", { className: "gd-filter-views__dropdown-anchor" })),
|
|
56
|
+
isDialogOpen ? (React.createElement(ConfigurationBubble, { classNames: "gd-filters-views__panel", onClose: closeDialog, alignTo: ".gd-filter-views__dropdown-anchor", alignPoints: BUBBLE_ALIGN_POINTS }, dialogMode === "add" ? (React.createElement(AddFilterView, { onClose: openListDialog })) : (React.createElement(FilterViewsList, { filterViews: filterViews, onAddNew: openAddDialog, onClose: closeDialog })))) : null));
|
|
26
57
|
};
|
|
27
58
|
//# sourceMappingURL=FilterViews.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterViews.js","sourceRoot":"","sources":["../../../../../src/presentation/filterBar/filterBar/filterViews/FilterViews.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterViews.js","sourceRoot":"","sources":["../../../../../src/presentation/filterBar/filterBar/filterViews/FilterViews.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YA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,CAAC;IAEzE,MAAM,gBAAgB,GAAG,EAAE,CACvB,wBAAwB,EACxB,kCAAkC,EAClC,iBAAiB,EACjB;QACI,8BAA8B,EAAE,YAAY;KAC/C,CACJ,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAC,iBAAiB;QAC3B,kBAAkB,CAAC,CAAC,CAAC,CAClB;YACI,oBAAC,cAAc,IAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY;gBACpF,oBAAC,mBAAmB,IAAC,WAAW,EAAE,WAAW,GAAI,CACpC;YAChB,mBAAmB,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,kCAAkC,GAAG,CAAC,CAAC,CAAC,IAAI,CACnF,CACN,CAAC,CAAC,CAAC,CACA,6BAAK,SAAS,EAAC,kCAAkC,GAAG,CACvD;QACA,YAAY,CAAC,CAAC,CAAC,CACZ,oBAAC,mBAAmB,IAChB,UAAU,EAAC,yBAAyB,EACpC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAC,mCAAmC,EAC3C,WAAW,EAAE,mBAAmB,IAE/B,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,CACpB,oBAAC,aAAa,IAAC,OAAO,EAAE,cAAc,GAAI,CAC7C,CAAC,CAAC,CAAC,CACA,oBAAC,eAAe,IACZ,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,WAAW,GACtB,CACL,CACiB,CACzB,CAAC,CAAC,CAAC,IAAI,CACN,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -142,6 +142,16 @@
|
|
|
142
142
|
"comment": "Delete Dashboard",
|
|
143
143
|
"limit": 0
|
|
144
144
|
},
|
|
145
|
+
"options.menu.addFilterViews": {
|
|
146
|
+
"value": "Create view",
|
|
147
|
+
"comment": "Open menu with dialog with form to create a new filter view.",
|
|
148
|
+
"limit": 0
|
|
149
|
+
},
|
|
150
|
+
"options.menu.listFilterViews": {
|
|
151
|
+
"value": "Show my views",
|
|
152
|
+
"comment": "Open menu with my saved filter views.",
|
|
153
|
+
"limit": 0
|
|
154
|
+
},
|
|
145
155
|
"dialogs.export.cells": {
|
|
146
156
|
"value": "CELLS",
|
|
147
157
|
"comment": "Cells of the table that is going to be exported to file",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDefaultMenuItems.d.ts","sourceRoot":"","sources":["../../../../src/presentation/topBar/menuButton/useDefaultMenuItems.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDefaultMenuItems.d.ts","sourceRoot":"","sources":["../../../../src/presentation/topBar/menuButton/useDefaultMenuItems.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA2D9C;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,eAAe,EAAE,CAiNvD"}
|
|
@@ -2,26 +2,13 @@
|
|
|
2
2
|
import React, { useCallback, useMemo, useRef } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { isProtectedDataError } from "@gooddata/sdk-backend-spi";
|
|
5
|
-
import { useToastMessage } from "@gooddata/sdk-ui-kit";
|
|
6
|
-
import { exportDashboardToPdf, selectCanCreateAnalyticalDashboard, selectCanExportPdf, selectEnableKPIDashboardExportPDF, selectEntitlementExportPdf, selectIsInEditMode, selectIsInViewMode, selectIsNewDashboard, selectIsReadOnly, selectIsSaveAsNewButtonHidden, selectLayoutHasAnalyticalWidgets, selectMenuButtonItemsVisibility, uiActions, useDashboardCommandProcessing, useDashboardDispatch, useDashboardScheduledEmails, useDashboardSelector, selectDashboardId, } from "../../../model/index.js";
|
|
5
|
+
import { useToastMessage, useMediaQuery } from "@gooddata/sdk-ui-kit";
|
|
6
|
+
import { exportDashboardToPdf, selectCanCreateAnalyticalDashboard, selectCanExportPdf, selectEnableKPIDashboardExportPDF, selectEntitlementExportPdf, selectIsInEditMode, selectIsInViewMode, selectIsNewDashboard, selectIsReadOnly, selectIsSaveAsNewButtonHidden, selectLayoutHasAnalyticalWidgets, selectMenuButtonItemsVisibility, uiActions, useDashboardCommandProcessing, useDashboardDispatch, useDashboardScheduledEmails, useDashboardSelector, selectDashboardId, selectEnableFilterViews, selectDisableFilterViews, } from "../../../model/index.js";
|
|
7
7
|
import { downloadFile } from "../../../_staging/fileUtils/downloadFile.js";
|
|
8
8
|
import { messages } from "../../../locales.js";
|
|
9
9
|
import { selectIsSaveAsNewButtonVisible } from "../buttonBar/button/index.js";
|
|
10
|
-
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export function useDefaultMenuItems() {
|
|
14
|
-
const intl = useIntl();
|
|
15
|
-
const isNewDashboard = useDashboardSelector(selectIsNewDashboard);
|
|
16
|
-
const isEmptyLayout = !useDashboardSelector(selectLayoutHasAnalyticalWidgets); // we need at least one non-custom widget there
|
|
10
|
+
const useExportDashboard = () => {
|
|
17
11
|
const { addSuccess, addError, addProgress, removeMessage } = useToastMessage();
|
|
18
|
-
const dashboard = useDashboardSelector(selectDashboardId);
|
|
19
|
-
const { isScheduledEmailingVisible, isScheduledManagementEmailingVisible, defaultOnScheduleEmailing, defaultOnScheduleEmailingManagement, numberOfAvailableWebhooks, } = useDashboardScheduledEmails({
|
|
20
|
-
dashboard,
|
|
21
|
-
});
|
|
22
|
-
const dispatch = useDashboardDispatch();
|
|
23
|
-
const openSaveAsDialog = useCallback(() => dispatch(uiActions.openSaveAsDialog()), [dispatch]);
|
|
24
|
-
const openDeleteDialog = useCallback(() => dispatch(uiActions.openDeleteDialog()), [dispatch]);
|
|
25
12
|
const lastExportMessageId = useRef("");
|
|
26
13
|
const { run: exportDashboard } = useDashboardCommandProcessing({
|
|
27
14
|
commandCreator: exportDashboardToPdf,
|
|
@@ -32,18 +19,18 @@ export function useDefaultMenuItems() {
|
|
|
32
19
|
// make sure the message stays there until removed by either success or error
|
|
33
20
|
{ duration: 0 });
|
|
34
21
|
},
|
|
35
|
-
onSuccess: (
|
|
22
|
+
onSuccess: (event) => {
|
|
36
23
|
if (lastExportMessageId.current) {
|
|
37
24
|
removeMessage(lastExportMessageId.current);
|
|
38
25
|
}
|
|
39
26
|
addSuccess(messages.messagesExportResultSuccess);
|
|
40
|
-
downloadFile(
|
|
27
|
+
downloadFile(event.payload.result);
|
|
41
28
|
},
|
|
42
|
-
onError: (
|
|
29
|
+
onError: (error) => {
|
|
43
30
|
if (lastExportMessageId.current) {
|
|
44
31
|
removeMessage(lastExportMessageId.current);
|
|
45
32
|
}
|
|
46
|
-
if (isProtectedDataError(
|
|
33
|
+
if (isProtectedDataError(error)) {
|
|
47
34
|
addError(messages.messagesExportResultRestrictedError);
|
|
48
35
|
}
|
|
49
36
|
else {
|
|
@@ -51,12 +38,55 @@ export function useDefaultMenuItems() {
|
|
|
51
38
|
}
|
|
52
39
|
},
|
|
53
40
|
});
|
|
41
|
+
return exportDashboard;
|
|
42
|
+
};
|
|
43
|
+
// inject separator to each visible section, flat map the sections into a list of menu items
|
|
44
|
+
const buildMenuItemList = (menuSections) => menuSections
|
|
45
|
+
.filter((section) => section.some((item) => item.visible))
|
|
46
|
+
.map((visibleSection, index, visibleSections) => {
|
|
47
|
+
const isLastVisibleSection = index === visibleSections.length - 1;
|
|
48
|
+
return isLastVisibleSection
|
|
49
|
+
? visibleSection
|
|
50
|
+
: [
|
|
51
|
+
...visibleSection,
|
|
52
|
+
{
|
|
53
|
+
type: "separator",
|
|
54
|
+
itemId: `separator-${index}`,
|
|
55
|
+
visible: true,
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
})
|
|
59
|
+
.flatMap((visibleSection) => visibleSection);
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export function useDefaultMenuItems() {
|
|
64
|
+
const intl = useIntl();
|
|
65
|
+
const isMobile = useMediaQuery("mobileDevice");
|
|
66
|
+
const isNewDashboard = useDashboardSelector(selectIsNewDashboard);
|
|
67
|
+
const isEmptyLayout = !useDashboardSelector(selectLayoutHasAnalyticalWidgets); // we need at least one non-custom widget there
|
|
68
|
+
const dashboard = useDashboardSelector(selectDashboardId);
|
|
69
|
+
const { isScheduledEmailingVisible, isScheduledManagementEmailingVisible, defaultOnScheduleEmailing, defaultOnScheduleEmailingManagement, numberOfAvailableWebhooks, } = useDashboardScheduledEmails({
|
|
70
|
+
dashboard,
|
|
71
|
+
});
|
|
72
|
+
const dispatch = useDashboardDispatch();
|
|
73
|
+
const openSaveAsDialog = useCallback(() => dispatch(uiActions.openSaveAsDialog()), [dispatch]);
|
|
74
|
+
const openDeleteDialog = useCallback(() => dispatch(uiActions.openDeleteDialog()), [dispatch]);
|
|
75
|
+
const openFilterViewsListDialog = useCallback(() => dispatch(uiActions.toggleFilterViewsDialog({
|
|
76
|
+
open: true,
|
|
77
|
+
mode: "list",
|
|
78
|
+
})), [dispatch]);
|
|
79
|
+
const openFilterViewsAddDialog = useCallback(() => dispatch(uiActions.toggleFilterViewsDialog({
|
|
80
|
+
open: true,
|
|
81
|
+
mode: "add",
|
|
82
|
+
})), [dispatch]);
|
|
54
83
|
const defaultOnSaveAs = useCallback(() => {
|
|
55
84
|
if (isNewDashboard) {
|
|
56
85
|
return;
|
|
57
86
|
}
|
|
58
87
|
openSaveAsDialog();
|
|
59
88
|
}, [isNewDashboard, openSaveAsDialog]);
|
|
89
|
+
const exportDashboard = useExportDashboard();
|
|
60
90
|
const defaultOnExportToPdf = useCallback(() => {
|
|
61
91
|
if (isNewDashboard) {
|
|
62
92
|
return;
|
|
@@ -73,122 +103,129 @@ export function useDefaultMenuItems() {
|
|
|
73
103
|
const isKPIDashboardExportPDFEnabled = !!useDashboardSelector(selectEnableKPIDashboardExportPDF);
|
|
74
104
|
const isExportPdfEntitlementPresent = !!useDashboardSelector(selectEntitlementExportPdf);
|
|
75
105
|
const menuButtonItemsVisibility = useDashboardSelector(selectMenuButtonItemsVisibility);
|
|
106
|
+
const isFilterViewsFeatureFlagEnabled = useDashboardSelector(selectEnableFilterViews);
|
|
107
|
+
const isFilterViewsEnabledForDashboard = !useDashboardSelector(selectDisableFilterViews);
|
|
108
|
+
const isFilterViewsVisible = isMobile && isFilterViewsFeatureFlagEnabled && isFilterViewsEnabledForDashboard;
|
|
109
|
+
const isDeleteVisible = isInEditMode && (menuButtonItemsVisibility.deleteButton ?? true);
|
|
110
|
+
// Do not show save as new button in menu item when it is already shown as a standalone top bar button.
|
|
111
|
+
const isSaveAsVisible = !isStandaloneSaveAsNewButtonVisible &&
|
|
112
|
+
canCreateDashboard &&
|
|
113
|
+
!isSaveAsNewHidden &&
|
|
114
|
+
(menuButtonItemsVisibility.saveAsNewButton ?? true);
|
|
115
|
+
const isSaveAsDisabled = isEmptyLayout || isNewDashboard || isReadOnly;
|
|
116
|
+
const isPdfExportVisible = isInViewMode &&
|
|
117
|
+
canExport &&
|
|
118
|
+
isKPIDashboardExportPDFEnabled &&
|
|
119
|
+
isExportPdfEntitlementPresent &&
|
|
120
|
+
(menuButtonItemsVisibility.pdfExportButton ?? true);
|
|
76
121
|
return useMemo(() => {
|
|
77
122
|
if (isNewDashboard) {
|
|
78
123
|
return [];
|
|
79
124
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
icon: "gd-icon-trash",
|
|
166
|
-
},
|
|
167
|
-
];
|
|
125
|
+
return buildMenuItemList([
|
|
126
|
+
// save as new section
|
|
127
|
+
[
|
|
128
|
+
{
|
|
129
|
+
type: "button",
|
|
130
|
+
itemId: "save_as_menu_item", // careful, also a s- class selector, do not change
|
|
131
|
+
disabled: isSaveAsDisabled,
|
|
132
|
+
visible: isSaveAsVisible,
|
|
133
|
+
itemName: intl.formatMessage({ id: "options.menu.save.as" }),
|
|
134
|
+
tooltip:
|
|
135
|
+
// the tooltip is only relevant to non-read only states
|
|
136
|
+
!isReadOnly && isSaveAsDisabled
|
|
137
|
+
? intl.formatMessage({ id: "options.menu.save.as.tooltip" })
|
|
138
|
+
: undefined,
|
|
139
|
+
onClick: defaultOnSaveAs,
|
|
140
|
+
icon: "gd-icon-save-as-new",
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
// alerts & schedules section
|
|
144
|
+
[
|
|
145
|
+
{
|
|
146
|
+
type: "button",
|
|
147
|
+
itemId: "schedule-email-item", // careful, this is also used as a selector in tests, do not change
|
|
148
|
+
itemName: intl.formatMessage({ id: "options.menu.schedule.email" }),
|
|
149
|
+
onClick: defaultOnScheduleEmailing,
|
|
150
|
+
visible: isScheduledEmailingVisible,
|
|
151
|
+
tooltip: numberOfAvailableWebhooks === 0
|
|
152
|
+
? intl.formatMessage({ id: "options.menu.schedule.email.tooltip" }, {
|
|
153
|
+
a: (chunk) => (React.createElement("a", { href: "/settings", rel: "noopener noreferrer", target: "_blank" }, chunk)),
|
|
154
|
+
})
|
|
155
|
+
: undefined,
|
|
156
|
+
icon: "gd-icon-clock",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: "button",
|
|
160
|
+
itemId: "schedule-email-edit-item", // careful, this is also used as a selector in tests, do not change
|
|
161
|
+
itemName: intl.formatMessage({ id: "options.menu.schedule.email.edit" }),
|
|
162
|
+
onClick: defaultOnScheduleEmailingManagement,
|
|
163
|
+
visible: isScheduledManagementEmailingVisible,
|
|
164
|
+
icon: "gd-icon-list",
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
// filter views section
|
|
168
|
+
[
|
|
169
|
+
{
|
|
170
|
+
type: "button",
|
|
171
|
+
itemId: "add-filter-views",
|
|
172
|
+
itemName: intl.formatMessage({ id: "options.menu.addFilterViews" }),
|
|
173
|
+
onClick: openFilterViewsAddDialog,
|
|
174
|
+
visible: isFilterViewsVisible,
|
|
175
|
+
icon: "gd-icon-filter",
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: "button",
|
|
179
|
+
itemId: "list-filter-views",
|
|
180
|
+
itemName: intl.formatMessage({ id: "options.menu.listFilterViews" }),
|
|
181
|
+
onClick: openFilterViewsListDialog,
|
|
182
|
+
visible: isFilterViewsVisible,
|
|
183
|
+
icon: "gd-icon-list",
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
// export section
|
|
187
|
+
[
|
|
188
|
+
{
|
|
189
|
+
type: "button",
|
|
190
|
+
itemId: "pdf-export-item", // careful, this is also used as a selector in tests, do not change
|
|
191
|
+
itemName: intl.formatMessage({ id: "options.menu.export.PDF" }),
|
|
192
|
+
onClick: defaultOnExportToPdf,
|
|
193
|
+
visible: isPdfExportVisible,
|
|
194
|
+
icon: "gd-icon-download",
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
// delete section
|
|
198
|
+
[
|
|
199
|
+
{
|
|
200
|
+
type: "button",
|
|
201
|
+
itemId: "delete_dashboard", // careful, also a s- class selector, do not change
|
|
202
|
+
itemName: intl.formatMessage({ id: "options.menu.delete" }),
|
|
203
|
+
onClick: openDeleteDialog,
|
|
204
|
+
visible: isDeleteVisible,
|
|
205
|
+
className: "delete-button",
|
|
206
|
+
icon: "gd-icon-trash",
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
]);
|
|
168
210
|
}, [
|
|
169
|
-
canCreateDashboard,
|
|
170
|
-
canExport,
|
|
171
211
|
defaultOnExportToPdf,
|
|
172
212
|
defaultOnSaveAs,
|
|
173
213
|
defaultOnScheduleEmailing,
|
|
174
214
|
defaultOnScheduleEmailingManagement,
|
|
175
215
|
intl,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
isInEditMode,
|
|
179
|
-
isInViewMode,
|
|
180
|
-
isKPIDashboardExportPDFEnabled,
|
|
216
|
+
isDeleteVisible,
|
|
217
|
+
isFilterViewsVisible,
|
|
181
218
|
isNewDashboard,
|
|
219
|
+
isPdfExportVisible,
|
|
182
220
|
isReadOnly,
|
|
183
|
-
|
|
221
|
+
isSaveAsDisabled,
|
|
222
|
+
isSaveAsVisible,
|
|
184
223
|
isScheduledEmailingVisible,
|
|
185
224
|
isScheduledManagementEmailingVisible,
|
|
186
|
-
isStandaloneSaveAsNewButtonVisible,
|
|
187
|
-
menuButtonItemsVisibility.deleteButton,
|
|
188
|
-
menuButtonItemsVisibility.pdfExportButton,
|
|
189
|
-
menuButtonItemsVisibility.saveAsNewButton,
|
|
190
225
|
numberOfAvailableWebhooks,
|
|
191
226
|
openDeleteDialog,
|
|
227
|
+
openFilterViewsAddDialog,
|
|
228
|
+
openFilterViewsListDialog,
|
|
192
229
|
]);
|
|
193
230
|
}
|
|
194
231
|
//# sourceMappingURL=useDefaultMenuItems.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDefaultMenuItems.js","sourceRoot":"","sources":["../../../../src/presentation/topBar/menuButton/useDefaultMenuItems.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useDefaultMenuItems.js","sourceRoot":"","sources":["../../../../src/presentation/topBar/menuButton/useDefaultMenuItems.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EACH,oBAAoB,EACpB,kCAAkC,EAClC,kBAAkB,EAClB,iCAAiC,EACjC,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,6BAA6B,EAC7B,gCAAgC,EAChC,+BAA+B,EAC/B,SAAS,EACT,6BAA6B,EAC7B,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE3E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,IAAI;QACJ,eAAe;QACf,oBAAoB;QACpB,cAAc;QACd,kBAAkB;QAClB,UAAU;QACV,gBAAgB;QAChB,eAAe;QACf,0BAA0B;QAC1B,oCAAoC;QACpC,yBAAyB;QACzB,gBAAgB;QAChB,wBAAwB;QACxB,yBAAyB;KAC5B,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -129,6 +129,7 @@ import { EntityId } from '@reduxjs/toolkit';
|
|
|
129
129
|
import { EntityState } from '@reduxjs/toolkit';
|
|
130
130
|
import { ExplicitDrill } from '@gooddata/sdk-ui';
|
|
131
131
|
import { FilterContextItem } from '@gooddata/sdk-model';
|
|
132
|
+
import { FilterViewDialogMode as FilterViewDialogMode_2 } from './uiState.js';
|
|
132
133
|
import { GoodDataSdkError } from '@gooddata/sdk-ui';
|
|
133
134
|
import { IAbsoluteDateFilter } from '@gooddata/sdk-model';
|
|
134
135
|
import { IAccessControlAware } from '@gooddata/sdk-model';
|
|
@@ -7117,6 +7118,11 @@ export declare type FiltersInfo = {
|
|
|
7117
7118
|
resolvedFilterValues?: IResolvedFilterValues;
|
|
7118
7119
|
};
|
|
7119
7120
|
|
|
7121
|
+
/**
|
|
7122
|
+
* @beta
|
|
7123
|
+
*/
|
|
7124
|
+
export declare type FilterViewDialogMode = "list" | "add";
|
|
7125
|
+
|
|
7120
7126
|
/**
|
|
7121
7127
|
* @alpha
|
|
7122
7128
|
*/
|
|
@@ -15922,6 +15928,11 @@ export declare const selectFilterContextIdentity: DashboardSelector<IDashboardOb
|
|
|
15922
15928
|
*/
|
|
15923
15929
|
export declare const selectFilterViews: DashboardSelector<IDashboardFilterView[]>;
|
|
15924
15930
|
|
|
15931
|
+
/**
|
|
15932
|
+
* @internal
|
|
15933
|
+
*/
|
|
15934
|
+
export declare const selectFilterViewsDialogMode: DashboardSelector<FilterViewDialogMode>;
|
|
15935
|
+
|
|
15925
15936
|
/**
|
|
15926
15937
|
* @internal
|
|
15927
15938
|
*/
|
|
@@ -16223,6 +16234,11 @@ export declare const selectIsFilterAttributeSelectionOpen: DashboardSelector<boo
|
|
|
16223
16234
|
*/
|
|
16224
16235
|
export declare const selectIsFilterFromCrossFilteringByLocalIdentifier: (localIdentifier: string) => DashboardSelector<boolean>;
|
|
16225
16236
|
|
|
16237
|
+
/**
|
|
16238
|
+
* @internal
|
|
16239
|
+
*/
|
|
16240
|
+
export declare const selectIsFilterViewsDialogOpen: DashboardSelector<boolean>;
|
|
16241
|
+
|
|
16226
16242
|
/**
|
|
16227
16243
|
* Returns whether the current Dashboard is on edit mode.
|
|
16228
16244
|
*
|
|
@@ -17572,6 +17588,13 @@ payload: Record<string, IDashboardWidgetOverlay_2>;
|
|
|
17572
17588
|
type: string;
|
|
17573
17589
|
}) => void | UiState_2 | WritableDraft<UiState_2>;
|
|
17574
17590
|
hideAllWidgetsOverlay: (state: WritableDraft<UiState_2>, action: AnyAction) => void | UiState_2 | WritableDraft<UiState_2>;
|
|
17591
|
+
toggleFilterViewsDialog: (state: WritableDraft<UiState_2>, action: {
|
|
17592
|
+
payload: {
|
|
17593
|
+
open?: boolean | undefined;
|
|
17594
|
+
mode?: FilterViewDialogMode_2 | undefined;
|
|
17595
|
+
} | undefined;
|
|
17596
|
+
type: string;
|
|
17597
|
+
}) => void | UiState_2 | WritableDraft<UiState_2>;
|
|
17575
17598
|
}, "uiSlice">;
|
|
17576
17599
|
|
|
17577
17600
|
/**
|
|
@@ -17596,6 +17619,10 @@ export declare interface UiState {
|
|
|
17596
17619
|
deleteDialog: {
|
|
17597
17620
|
open: boolean;
|
|
17598
17621
|
};
|
|
17622
|
+
filterViews: {
|
|
17623
|
+
open: boolean;
|
|
17624
|
+
mode: FilterViewDialogMode;
|
|
17625
|
+
};
|
|
17599
17626
|
kpiDeleteDialog: {
|
|
17600
17627
|
/**
|
|
17601
17628
|
* Undefined means the dialog should be closed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-dashboard",
|
|
3
|
-
"version": "10.9.0-alpha.
|
|
3
|
+
"version": "10.9.0-alpha.13",
|
|
4
4
|
"description": "GoodData SDK - Dashboard Component",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
"ts-invariant": "^0.7.5",
|
|
56
56
|
"tslib": "^2.5.0",
|
|
57
57
|
"uuid": "^8.3.2",
|
|
58
|
-
"@gooddata/sdk-backend-base": "10.9.0-alpha.
|
|
59
|
-
"@gooddata/sdk-backend-spi": "10.9.0-alpha.
|
|
60
|
-
"@gooddata/sdk-model": "10.9.0-alpha.
|
|
61
|
-
"@gooddata/sdk-ui": "10.9.0-alpha.
|
|
62
|
-
"@gooddata/sdk-ui
|
|
63
|
-
"@gooddata/sdk-ui-
|
|
64
|
-
"@gooddata/sdk-ui-
|
|
65
|
-
"@gooddata/sdk-ui-
|
|
66
|
-
"@gooddata/sdk-ui-theme-provider": "10.9.0-alpha.
|
|
67
|
-
"@gooddata/sdk-ui-vis-commons": "10.9.0-alpha.
|
|
68
|
-
"@gooddata/util": "10.9.0-alpha.
|
|
58
|
+
"@gooddata/sdk-backend-base": "10.9.0-alpha.13",
|
|
59
|
+
"@gooddata/sdk-backend-spi": "10.9.0-alpha.13",
|
|
60
|
+
"@gooddata/sdk-model": "10.9.0-alpha.13",
|
|
61
|
+
"@gooddata/sdk-ui-ext": "10.9.0-alpha.13",
|
|
62
|
+
"@gooddata/sdk-ui": "10.9.0-alpha.13",
|
|
63
|
+
"@gooddata/sdk-ui-filters": "10.9.0-alpha.13",
|
|
64
|
+
"@gooddata/sdk-ui-kit": "10.9.0-alpha.13",
|
|
65
|
+
"@gooddata/sdk-ui-geo": "10.9.0-alpha.13",
|
|
66
|
+
"@gooddata/sdk-ui-theme-provider": "10.9.0-alpha.13",
|
|
67
|
+
"@gooddata/sdk-ui-vis-commons": "10.9.0-alpha.13",
|
|
68
|
+
"@gooddata/util": "10.9.0-alpha.13"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^16.10.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -118,9 +118,9 @@
|
|
|
118
118
|
"typescript": "5.3.3",
|
|
119
119
|
"vitest": "1.0.4",
|
|
120
120
|
"vitest-dom": "0.1.1",
|
|
121
|
-
"@gooddata/
|
|
122
|
-
"@gooddata/
|
|
123
|
-
"@gooddata/sdk-backend-mockingbird": "10.9.0-alpha.
|
|
121
|
+
"@gooddata/reference-workspace": "10.9.0-alpha.13",
|
|
122
|
+
"@gooddata/i18n-toolkit": "10.9.0-alpha.13",
|
|
123
|
+
"@gooddata/sdk-backend-mockingbird": "10.9.0-alpha.13"
|
|
124
124
|
},
|
|
125
125
|
"scripts": {
|
|
126
126
|
"clean": "rm -rf ci dist esm coverage *.log styles/css tsconfig.tsbuildinfo",
|