@antscorp/antsomi-ui 1.3.5-beta.494 → 1.3.5-beta.495
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/es/components/organism/LeftMenu/utils/index.js +1 -1
- package/es/components/template/Layout/Layout.js +10 -8
- package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/index.js +1 -0
- package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/styled.js +15 -0
- package/es/components/template/Layout/components/RecommendationWorkspace/index.js +4 -21
- package/es/components/template/Layout/stores/index.d.ts +1 -1
- package/es/locales/vi/translation.json +2 -2
- package/package.json +2 -1
|
@@ -167,7 +167,7 @@ export const getMappingAppChildren = (args) => {
|
|
|
167
167
|
})();
|
|
168
168
|
cloneMenuItem.children =
|
|
169
169
|
(destinationChannelGen2Entries === null || destinationChannelGen2Entries === void 0 ? void 0 : destinationChannelGen2Entries.map(item => (Object.assign({}, getInitialFeatureMenuItem({
|
|
170
|
-
menu_item_code: item.channelCode
|
|
170
|
+
menu_item_code: `${menuItem.menu_item_code}_${item.channelCode}`,
|
|
171
171
|
menu_item_name: item.translateLabel,
|
|
172
172
|
logo_url: item.logoUrl,
|
|
173
173
|
menu_item_parent: menuItem.menu_item,
|
|
@@ -16,6 +16,7 @@ import AntsProcessingNotification from '@antscorp/processing-notification';
|
|
|
16
16
|
import { cloneDeep, merge, omit } from 'lodash';
|
|
17
17
|
import isEqual from 'react-fast-compare';
|
|
18
18
|
import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
|
|
19
|
+
import { Helmet } from 'react-helmet';
|
|
19
20
|
// Styled
|
|
20
21
|
import { ChildrenWrapper, ContentWrapper, LayoutWrapper, NotificationWrapper } from './styled';
|
|
21
22
|
// Components
|
|
@@ -46,10 +47,10 @@ export const Layout = memo(props => {
|
|
|
46
47
|
const header = useLayoutStore(store => store.state.header);
|
|
47
48
|
const contentWrapper = useLayoutStore(store => store.state.contentWrapper);
|
|
48
49
|
const workspace = useLayoutStore(store => store.state.workspace);
|
|
49
|
-
const setHeaderState = useLayoutStore(store => store.setHeaderState);
|
|
50
50
|
const [showAccountSelection, setShowAccountSelection] = useState(false);
|
|
51
51
|
const [noSpaceTopContent, setNoSpaceTopContent] = useState(false);
|
|
52
52
|
const [activeMenuCode, setActiveMenuCode] = useState('');
|
|
53
|
+
const [activePageTitle, setActivePageTitle] = useState('');
|
|
53
54
|
// Refs
|
|
54
55
|
const notificationWrapperRef = useRef(null);
|
|
55
56
|
// Hooks
|
|
@@ -118,7 +119,7 @@ export const Layout = memo(props => {
|
|
|
118
119
|
INSIGHT_U_OGS: 'uogs',
|
|
119
120
|
} }) }), accountSharingConfig: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSharingConfig), { u_ogs: 'uogs', appCode: appCode || 'APP_CUSTOMER_360' }), accountSelection: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection), { show: !!((_b = headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection) === null || _b === void 0 ? void 0 : _b.show) && showAccountSelection }) }));
|
|
120
121
|
}, [headerProps, iamDomain, permissionDomain, showAccountSelection]);
|
|
121
|
-
const mergeHeaderProps = useDeepCompareMemo(() => merge(cloneDeep(initialHeaderProps), Object.assign(Object.assign({}, header), { pageTitle: (header === null || header === void 0 ? void 0 : header.pageTitle) ||
|
|
122
|
+
const mergeHeaderProps = useDeepCompareMemo(() => merge(cloneDeep(initialHeaderProps), Object.assign(Object.assign({}, header), { pageTitle: (header === null || header === void 0 ? void 0 : header.pageTitle) || activePageTitle })), [initialHeaderProps, header]);
|
|
122
123
|
const _b = useDeepCompareMemo(() => merge(cloneDeep(contentWrapperProps), cloneDeep(contentWrapper)), [contentWrapperProps, contentWrapper]), { noPadding, showNotification = true } = _b, mergeContentWrapperProps = __rest(_b, ["noPadding", "showNotification"]);
|
|
123
124
|
const mergeWorkSpaceProps = useDeepCompareMemo(() => merge(cloneDeep(restOfWorkspaceProps), omit(workspace, 'workspaceContentProps')), [restOfWorkspaceProps, workspace]);
|
|
124
125
|
const _c = useDeepCompareMemo(() => merge(cloneDeep(leftMenuProps), cloneDeep(leftMenu)), [leftMenuProps, leftMenu, appConfig]), { className: leftMenuClassName, show: showLeftMenu = true } = _c, mergeLeftMenuProps = __rest(_c, ["className", "show"]);
|
|
@@ -128,11 +129,9 @@ export const Layout = memo(props => {
|
|
|
128
129
|
var _a;
|
|
129
130
|
const activeMenuItem = activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath[(activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath.length) - 1];
|
|
130
131
|
const { menu_item_code, page_title, menu_item_name } = activeMenuItem || {};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
: menu_item_name,
|
|
135
|
-
});
|
|
132
|
+
setActivePageTitle(page_title
|
|
133
|
+
? i18nInstance.t((_a = translations.leftMenu.pageTitle) === null || _a === void 0 ? void 0 : _a[`${page_title}`]).toString()
|
|
134
|
+
: menu_item_name);
|
|
136
135
|
setActiveMenuCode(menu_item_code);
|
|
137
136
|
onActiveMenuChange === null || onActiveMenuChange === void 0 ? void 0 : onActiveMenuChange(menu_item_code);
|
|
138
137
|
const hasRole = hasSelectAccountPermission({
|
|
@@ -142,8 +141,11 @@ export const Layout = memo(props => {
|
|
|
142
141
|
appItem: activeItemPath[0],
|
|
143
142
|
});
|
|
144
143
|
setShowAccountSelection(hasRole);
|
|
145
|
-
}, [onActiveMenuChange
|
|
144
|
+
}, [onActiveMenuChange]);
|
|
146
145
|
return (React.createElement(LayoutWrapper, { showLeftMenu: !!showLeftMenu },
|
|
146
|
+
React.createElement(Helmet, null,
|
|
147
|
+
React.createElement("meta", { charSet: "utf-8" }),
|
|
148
|
+
React.createElement("title", null, (header === null || header === void 0 ? void 0 : header.browser) || (header === null || header === void 0 ? void 0 : header.pageTitle) || activePageTitle)),
|
|
147
149
|
React.createElement(HeaderV2, Object.assign({}, mergeHeaderProps, { showLogo: !showLeftMenu })),
|
|
148
150
|
React.createElement(Flex, { className: "layout-body" },
|
|
149
151
|
showLeftMenu && (React.createElement(LeftMenu, Object.assign({ className: `layout-body__menu ${leftMenuClassName}` }, mergeLeftMenuProps, { appConfig: leftMenuAppConfig, onActiveMenuCodeChange: onActiveMenuCodeChange }))),
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Typography } from '../../../../../../atoms';
|
|
3
3
|
// Assets
|
|
4
4
|
import recommendationHumanImage from '@antscorp/antsomi-ui/es/assets/images/components/Layout/recommendation-human.png';
|
|
5
|
+
// Styled
|
|
5
6
|
import { ImageWrapper, MessageWrapper, RecommendationImageWrapper } from './styled';
|
|
6
7
|
export const RecommendationImage = () => (React.createElement(RecommendationImageWrapper, null,
|
|
7
8
|
React.createElement(MessageWrapper, null,
|
|
@@ -26,6 +26,21 @@ export const MessageWrapper = styled.div `
|
|
|
26
26
|
transform: rotate(180deg);
|
|
27
27
|
z-index: 100;
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
@media screen and (max-width: 1400px) {
|
|
31
|
+
width: 300px;
|
|
32
|
+
& > div.antsomi-typography {
|
|
33
|
+
font-size: 22px !important;
|
|
34
|
+
line-height: 26px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
@media screen and (max-width: 1330px) {
|
|
38
|
+
width: 250px;
|
|
39
|
+
& > div.antsomi-typography {
|
|
40
|
+
font-size: 20px !important;
|
|
41
|
+
line-height: 24px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
29
44
|
`;
|
|
30
45
|
export const ImageWrapper = styled.div `
|
|
31
46
|
width: 100%;
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
// Libraries
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
// Components
|
|
4
4
|
import { MenuMapping, RecommendationImage } from './components';
|
|
5
|
-
// Stores
|
|
6
|
-
import { useLayoutStore } from '../../stores';
|
|
7
5
|
// Styled
|
|
8
6
|
import { RecommendationWorkspaceWrapper } from './styled';
|
|
9
|
-
export const RecommendationWorkspace = () =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
document.title = 'Recommendation';
|
|
13
|
-
setHeaderState({
|
|
14
|
-
pageTitle: 'Recommendation',
|
|
15
|
-
});
|
|
16
|
-
return () => {
|
|
17
|
-
document.title = '';
|
|
18
|
-
setHeaderState({
|
|
19
|
-
pageTitle: '',
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
}, [setHeaderState]);
|
|
23
|
-
return (React.createElement(RecommendationWorkspaceWrapper, null,
|
|
24
|
-
React.createElement(RecommendationImage, null),
|
|
25
|
-
React.createElement(MenuMapping, null)));
|
|
26
|
-
};
|
|
7
|
+
export const RecommendationWorkspace = () => (React.createElement(RecommendationWorkspaceWrapper, null,
|
|
8
|
+
React.createElement(RecommendationImage, null),
|
|
9
|
+
React.createElement(MenuMapping, null)));
|
|
@@ -4,7 +4,7 @@ import { DeepPartial } from '@antscorp/antsomi-ui/es/types';
|
|
|
4
4
|
import { ContentWrapperProps, WorkspaceProps } from '../types';
|
|
5
5
|
import { LeftMenuProps } from '../../../organism';
|
|
6
6
|
export interface HeaderStore extends Partial<HeaderV2Props> {
|
|
7
|
-
|
|
7
|
+
browser?: string;
|
|
8
8
|
}
|
|
9
9
|
export interface LeftMenuStore extends LeftMenuProps {
|
|
10
10
|
show?: boolean;
|
|
@@ -148,12 +148,12 @@
|
|
|
148
148
|
"pageTitle": {
|
|
149
149
|
"recommendation": "Gợi ý",
|
|
150
150
|
"_dashboard": "Bảng tổng quan",
|
|
151
|
-
"_marketing": "",
|
|
151
|
+
"_marketing": "Tiếp thị",
|
|
152
152
|
"_content": "Nội dung",
|
|
153
153
|
"_templates": "Thư viện mẫu",
|
|
154
154
|
"_profiles": "Chân dung",
|
|
155
155
|
"_data": "Dữ liệu",
|
|
156
|
-
"_insights": "",
|
|
156
|
+
"_insights": "Nhận thức chiến lược",
|
|
157
157
|
"_settings": "Cài đặt",
|
|
158
158
|
"_overview": "Trang tổng quan",
|
|
159
159
|
"_allChannel": "Tất cả kênh",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.5-beta.
|
|
3
|
+
"version": "1.3.5-beta.495",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
"react-custom-scrollbars": "^4.2.1",
|
|
112
112
|
"react-draggable": "^4.4.5",
|
|
113
113
|
"react-frame-component": "^5.2.6",
|
|
114
|
+
"react-helmet": "^6.1.0",
|
|
114
115
|
"react-intersection-observer": "^9.10.3",
|
|
115
116
|
"react-konva": "^18.2.10",
|
|
116
117
|
"react-markdown": "^8.0.7",
|