@antscorp/antsomi-ui 1.3.5-beta.343 → 1.3.5-beta.344

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.
@@ -65,6 +65,7 @@ export const useHomeMenu = () => {
65
65
  }, [auth, navigate, onClickCreateDashboard, replace, urlParams]);
66
66
  const onMenuClick = useCallback((key, _) => {
67
67
  const newPathName = getGeneratePath(HOME_REPORT_ROUTES.DETAIL, Object.assign(Object.assign({}, auth), { dashboardId: key }));
68
+ console.log('newPathName', newPathName);
68
69
  if (newPathName !== pathname) {
69
70
  navigate(newPathName);
70
71
  }
@@ -32,6 +32,7 @@ export const LeftMenu = memo(props => {
32
32
  }, [activeAppCode, isCustomized, state.hoverItem, onMenuItemClick]);
33
33
  const renderFeatureMenuItems = useCallback((item) => {
34
34
  const { menu_item_name, menu_item, icon_name, menu_item_code, menu_item_path, menu_item_domain, } = item;
35
+ console.log('🚀 ~ item:', item);
35
36
  const isActive = activeAppCode === menu_item_code;
36
37
  const isHover = state.hoverItem === menu_item_code;
37
38
  const renderLabel = () => (React.createElement("li", { role: "menuitem", className: classNames({ isActive, isHover }) },
@@ -11,7 +11,6 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  // Libraries
13
13
  import { cloneDeep, isArray, isEmpty, sortBy } from 'lodash';
14
- import { generatePath } from 'react-router-dom';
15
14
  // Constants
16
15
  import { APP_KEYS, MARKETING_CHANNEL_KEY, HOME_MENU_ITEMS, MARKETING_ROUTES, MENU_ITEM_TYPE, RENDER_OPTION, HOME_REPORT_ROUTES, SETTING_APP, } from '../constants';
17
16
  import { MARKETING_CHANNEL_CODE } from '../../../template/Layout/constants';
@@ -70,13 +69,24 @@ export const recursivePermissionMenu = (menuItems, MenuPermissions) => {
70
69
  export const getGeneratePath = (path, params) => {
71
70
  try {
72
71
  const { portalId, userId, dashboardId, channelId } = params || {};
73
- return generatePath(path, {
72
+ // return generatePath(path, {
73
+ // user_id: userId ?? '-1',
74
+ // networkId: portalId ?? -1,
75
+ // portalId: portalId ?? -1,
76
+ // dashboardId: dashboardId ?? '-1',
77
+ // channelId: channelId ?? -1,
78
+ // });
79
+ const paramsObjects = {
74
80
  user_id: userId !== null && userId !== void 0 ? userId : '-1',
75
81
  networkId: portalId !== null && portalId !== void 0 ? portalId : -1,
76
82
  portalId: portalId !== null && portalId !== void 0 ? portalId : -1,
77
83
  dashboardId: dashboardId !== null && dashboardId !== void 0 ? dashboardId : '-1',
78
84
  channelId: channelId !== null && channelId !== void 0 ? channelId : -1,
85
+ };
86
+ Object.keys(paramsObjects).forEach(key => {
87
+ path = path.replace(`:${key}`, paramsObjects[key]);
79
88
  });
89
+ return path;
80
90
  }
81
91
  catch (error) {
82
92
  handleError(error, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.343",
3
+ "version": "1.3.5-beta.344",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",