@antscorp/antsomi-ui 1.3.5-beta.531 → 1.3.5-beta.533
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/components/common/ChildMenu/index.js +25 -16
- package/es/components/organism/LeftMenu/constants/variables.js +1 -0
- package/es/components/organism/LeftMenu/hooks/useLeftMenu.js +2 -0
- package/es/components/organism/LeftMenu/utils/index.js +1 -1
- package/es/components/template/Layout/Layout.js +6 -5
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/index.js +2 -0
- package/package.json +1 -1
|
@@ -54,6 +54,9 @@ export const ChildMenu = memo(props => {
|
|
|
54
54
|
const [openKeys, setOpenKeys] = useState([]);
|
|
55
55
|
const { pathname, hash } = window.location;
|
|
56
56
|
const { isPushDifferentDomain, getPath, navigatePath } = useNavigatePath();
|
|
57
|
+
useDeepCompareEffect(() => {
|
|
58
|
+
setOpenKeys((items === null || items === void 0 ? void 0 : items.map(item => item.key)) || []);
|
|
59
|
+
}, [items]);
|
|
57
60
|
useDeepCompareEffect(() => {
|
|
58
61
|
switch (true) {
|
|
59
62
|
case isCustomized: {
|
|
@@ -132,25 +135,31 @@ export const ChildMenu = memo(props => {
|
|
|
132
135
|
env,
|
|
133
136
|
]);
|
|
134
137
|
const onClick = e => {
|
|
135
|
-
var _a;
|
|
136
138
|
if (isRecommendation) {
|
|
137
|
-
const permissionCode = (
|
|
138
|
-
activeKey: e.key,
|
|
139
|
-
menuItems: items || [],
|
|
140
|
-
})) === null || _a === void 0 ? void 0 : _a.permission_code;
|
|
141
|
-
const permissionCodePath = (() => {
|
|
139
|
+
const [permissionCode, permissionCodePath] = (() => {
|
|
142
140
|
var _a;
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
if (e.key === 'WEB_PERSONALIZE') {
|
|
142
|
+
return ['WEB_PERSONALIZE-JOURNEY', ['WEB_PERSONALIZE-JOURNEY']];
|
|
143
|
+
}
|
|
144
|
+
const permissionCode = (_a = recursiveFindItemByKey({
|
|
145
|
+
activeKey: e.key,
|
|
146
|
+
menuItems: items || [],
|
|
147
|
+
})) === null || _a === void 0 ? void 0 : _a.permission_code;
|
|
148
|
+
const permissionCodePath = (() => {
|
|
145
149
|
var _a;
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
const array = [];
|
|
151
|
+
(_a = e.keyPath) === null || _a === void 0 ? void 0 : _a.forEach(item => {
|
|
152
|
+
var _a;
|
|
153
|
+
const permissionCode = (_a = recursiveFindItemByKey({
|
|
154
|
+
activeKey: item,
|
|
155
|
+
menuItems: items || [],
|
|
156
|
+
})) === null || _a === void 0 ? void 0 : _a.permission_code;
|
|
157
|
+
if (permissionCode)
|
|
158
|
+
array.push(permissionCode);
|
|
159
|
+
});
|
|
160
|
+
return uniq(array);
|
|
161
|
+
})();
|
|
162
|
+
return [permissionCode, permissionCodePath];
|
|
154
163
|
})();
|
|
155
164
|
if (permissionCode)
|
|
156
165
|
onMenuClick === null || onMenuClick === void 0 ? void 0 : onMenuClick(permissionCode, permissionCodePath);
|
|
@@ -132,7 +132,7 @@ export const recursiveGetInitialFeatureMenuItem = (featureMenuItem) => (Object.a
|
|
|
132
132
|
export const recursiveGetMenuItemByPermission = (featureMenuItem) => {
|
|
133
133
|
var _a;
|
|
134
134
|
return ({
|
|
135
|
-
key: featureMenuItem.permission_code || 'null',
|
|
135
|
+
key: featureMenuItem.permission_code || featureMenuItem.menu_item_code || 'null',
|
|
136
136
|
label: featureMenuItem.menu_item_name,
|
|
137
137
|
icon: featureMenuItem.icon_name,
|
|
138
138
|
logo_url: featureMenuItem.logo_url,
|
|
@@ -142,11 +142,12 @@ export const Layout = memo(props => {
|
|
|
142
142
|
return (React.createElement(LayoutWrapper, { showLeftMenu: !!showLeftMenu },
|
|
143
143
|
React.createElement(Helmet, null,
|
|
144
144
|
React.createElement("meta", { charSet: "utf-8" }),
|
|
145
|
-
React.createElement("title", null, (header === null || header === void 0 ? void 0 : header.browserTitle) ||
|
|
146
|
-
|
|
147
|
-
? header === null || header === void 0 ? void 0 : header.pageTitle
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
React.createElement("title", null, (header === null || header === void 0 ? void 0 : header.browserTitle) ||
|
|
146
|
+
((header === null || header === void 0 ? void 0 : header.pageTitle)
|
|
147
|
+
? isString(header === null || header === void 0 ? void 0 : header.pageTitle)
|
|
148
|
+
? header === null || header === void 0 ? void 0 : header.pageTitle
|
|
149
|
+
: ''
|
|
150
|
+
: activePageTitle))),
|
|
150
151
|
React.createElement(HeaderV2, Object.assign({}, mergeHeaderProps, { showLogo: !showLeftMenu })),
|
|
151
152
|
React.createElement(Flex, { className: "layout-body" },
|
|
152
153
|
showLeftMenu && (React.createElement(LeftMenu, Object.assign({ className: `layout-body__menu ${leftMenuClassName}` }, mergeLeftMenuProps, { appConfig: leftMenuAppConfig, onActiveMenuCodeChange: onActiveMenuCodeChange }))),
|