@antscorp/antsomi-ui 1.3.5-beta.620 → 1.3.5-beta.621
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.
|
@@ -42,6 +42,7 @@ export const HeaderV2Styled = styled.div `
|
|
|
42
42
|
.title-container {
|
|
43
43
|
flex: 1;
|
|
44
44
|
min-width: 0;
|
|
45
|
+
height: 37px;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -64,6 +65,7 @@ export const HeaderV2Styled = styled.div `
|
|
|
64
65
|
.page-title {
|
|
65
66
|
font-size: 20px;
|
|
66
67
|
line-height: 23px;
|
|
68
|
+
height: 23px;
|
|
67
69
|
font-weight: bold;
|
|
68
70
|
color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorTextBase};
|
|
69
71
|
}
|
|
@@ -11,14 +11,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
import { useCallback, useMemo, useState } from 'react';
|
|
12
12
|
// Constants
|
|
13
13
|
import { CONFIG_OPTIONS } from './constants';
|
|
14
|
-
import {
|
|
14
|
+
import { HOME_REPORT_ROUTES, HOME_ROUTE } from '../../constants';
|
|
15
15
|
import { API_RESPONSE_CODE, CDP_API, CDP_ROUTE } from '@antscorp/antsomi-ui/es/constants';
|
|
16
|
+
import { MENU_CODE } from '@antscorp/antsomi-ui/es/components/template/Layout/constants';
|
|
17
|
+
import { MENU_PERMISSION } from '@antscorp/antsomi-ui/es/components/molecules/ShareAccess/constants';
|
|
16
18
|
// Utils
|
|
17
19
|
import { getGeneratePath, getMenuItem } from '../../utils';
|
|
18
20
|
// Hooks;
|
|
19
21
|
import { useLeftMenuContext } from '../../contexts';
|
|
20
22
|
import { useLayoutStore } from '@antscorp/antsomi-ui/es/components/template';
|
|
21
23
|
import { useCustomRouter } from '@antscorp/antsomi-ui/es/hooks';
|
|
24
|
+
import { usePermission } from '../../hooks';
|
|
22
25
|
// Queries
|
|
23
26
|
import { useRemoveDashboard } from '@antscorp/antsomi-ui/es/queries/LeftMenu';
|
|
24
27
|
import { ENV } from '@antscorp/antsomi-ui/es/config';
|
|
@@ -34,12 +37,13 @@ export const useHomeMenu = (props) => {
|
|
|
34
37
|
const dashboardParams = useLeftMenuContext(store => store.dashboardParams);
|
|
35
38
|
const dashboardList = useLeftMenuContext(store => (store === null || store === void 0 ? void 0 : store.dashboardList) || []);
|
|
36
39
|
const onClickCreateDashboard = useLayoutStore(store => store.state.leftMenu.onClickCreateDashboard);
|
|
40
|
+
const { flattenMenuPermission } = usePermission();
|
|
37
41
|
const [removedDashboardId, setRemovedDashboardId] = useState('');
|
|
38
42
|
const urlParams = useMemo(() => new URLSearchParams(search), [search]);
|
|
39
43
|
const showCreateButton = useMemo(() => {
|
|
40
|
-
const
|
|
41
|
-
return !!
|
|
42
|
-
}, [
|
|
44
|
+
const dashboardMenu = flattenMenuPermission.find(menu => menu.menu_code === MENU_CODE.DASHBOARD);
|
|
45
|
+
return !!dashboardMenu && dashboardMenu.selected_edit !== MENU_PERMISSION.NONE;
|
|
46
|
+
}, [flattenMenuPermission]);
|
|
43
47
|
const { mutateAsync: removeDashboard, isLoading: isDashboardRemoving } = useRemoveDashboard();
|
|
44
48
|
const onOptionCallback = useCallback((args) => {
|
|
45
49
|
const { optionKey, menuItemKey } = args;
|