@antscorp/antsomi-ui 1.3.5-beta.518 → 1.3.5-beta.519
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.
|
@@ -182,7 +182,11 @@ export const ChildMenu = memo(props => {
|
|
|
182
182
|
return !!icon || !!logo_url ? (React.createElement(Flex, { style: { flexShrink: 0 }, align: "center" }, !isNil(icon) ? (React.createElement(IconWrapper, null,
|
|
183
183
|
React.createElement(Icon, { type: icon }))) : !isNil(logo_url) ? (React.createElement(MenuItemImage, { imageUrl: logo_url, fallbackIcon: (_a = args === null || args === void 0 ? void 0 : args.parent) === null || _a === void 0 ? void 0 : _a.icon, className: classNames({ isActive: currentActiveItem === key }) })) : null)) : null;
|
|
184
184
|
};
|
|
185
|
-
const renderTitle = () => !menu_item_path || isRecommendation ? (renderLabel()) : isPushDifferentDomain(menu_item_domain, menu_item_path) ? (React.createElement("div", { onClick: () => navigatePath(menu_item_domain, menu_item_path), className: "menu-link" },
|
|
185
|
+
const renderTitle = () => !menu_item_path || isRecommendation ? (renderLabel()) : isPushDifferentDomain(menu_item_domain, menu_item_path) ? (React.createElement("div", { onClick: () => navigatePath(menu_item_domain, menu_item_path), className: "menu-link" },
|
|
186
|
+
"1 ",
|
|
187
|
+
renderLabel())) : (React.createElement(Link, { to: getPath(menu_item_path, key), className: "menu-link", onClick: e => e.stopPropagation() },
|
|
188
|
+
"2 ",
|
|
189
|
+
renderLabel()));
|
|
186
190
|
return {
|
|
187
191
|
key,
|
|
188
192
|
label: (React.createElement(Flex, { gap: 10, align: "center", justify: "space-between", style: { height: '100%' } },
|
|
@@ -16,6 +16,7 @@ import { usePermission } from './usePermission';
|
|
|
16
16
|
export const useNavigatePath = () => {
|
|
17
17
|
const appConfig = useLeftMenuContext(store => store.appConfig);
|
|
18
18
|
const { auth, env } = appConfig || {};
|
|
19
|
+
console.log('🚀 ~ useNavigatePath ~ env:', env);
|
|
19
20
|
const { search } = useLocation();
|
|
20
21
|
const isDev = env === ENV.DEV;
|
|
21
22
|
const { activeItemPath, flattenMenuPermission } = usePermission();
|
|
@@ -24,7 +25,7 @@ export const useNavigatePath = () => {
|
|
|
24
25
|
const oidParam = hasRole ? urlParams.get('oid') : null;
|
|
25
26
|
const searchParams = oidParam ? `?oid=${oidParam}` : '';
|
|
26
27
|
const isPushDifferentDomain = useCallback((domain, path) => {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f;
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
28
29
|
if (isDev)
|
|
29
30
|
return false;
|
|
30
31
|
const customDomain = domain !== null && domain !== void 0 ? domain : '';
|
|
@@ -34,9 +35,11 @@ export const useNavigatePath = () => {
|
|
|
34
35
|
if (isCurrentPathIncludeHash && isNextPathIncludeHash) {
|
|
35
36
|
const currentRoute = ((_e = (_d = (_c = window.location.href) === null || _c === void 0 ? void 0 : _c.split) === null || _d === void 0 ? void 0 : _d['#']) === null || _e === void 0 ? void 0 : _e[0]) || '';
|
|
36
37
|
const nextRoute = `${customDomain}${splitNextPath[0]}`;
|
|
38
|
+
console.log('🚀 ~ useNavigatePath ~ currentRoute:', currentRoute, nextRoute);
|
|
37
39
|
return currentRoute !== nextRoute;
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
console.log('out:: ', customDomain, (_f = window.location) === null || _f === void 0 ? void 0 : _f.origin);
|
|
42
|
+
return !!customDomain && customDomain !== ((_g = window.location) === null || _g === void 0 ? void 0 : _g.origin);
|
|
40
43
|
}, [isDev]);
|
|
41
44
|
const getPath = useCallback((path, itemKey) => {
|
|
42
45
|
var _a;
|
|
@@ -151,6 +151,7 @@ export const getMappingAppChildren = (args) => {
|
|
|
151
151
|
(destinationChannelEntries === null || destinationChannelEntries === void 0 ? void 0 : destinationChannelEntries.map(item => (Object.assign({}, getInitialFeatureMenuItem({
|
|
152
152
|
menu_item_code: item.channelCode,
|
|
153
153
|
menu_item_name: item.translateLabel,
|
|
154
|
+
menu_item_domain: cloneMenuItem.menu_item_domain,
|
|
154
155
|
logo_url: item.logoUrl,
|
|
155
156
|
menu_item_parent: menuItem.menu_item,
|
|
156
157
|
menu_item_path: getGeneratePath(path, Object.assign(Object.assign({}, auth), { channelId: item.channelId })),
|
|
@@ -168,6 +169,7 @@ export const getMappingAppChildren = (args) => {
|
|
|
168
169
|
})();
|
|
169
170
|
cloneMenuItem.children =
|
|
170
171
|
(destinationChannelGen2Entries === null || destinationChannelGen2Entries === void 0 ? void 0 : destinationChannelGen2Entries.map(item => (Object.assign({}, getInitialFeatureMenuItem({
|
|
172
|
+
menu_item_domain: cloneMenuItem.menu_item_domain,
|
|
171
173
|
menu_item_code: `${menuItem.menu_item_code}_${item.channelCode}`,
|
|
172
174
|
menu_item_name: item.translateLabel,
|
|
173
175
|
logo_url: item.logoUrl,
|