@antscorp/antsomi-ui 1.3.5-beta.645 → 1.3.5-beta.647

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.
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  // Libraries
13
- import React, { Suspense } from 'react';
13
+ import React from 'react';
14
14
  import { cloneDeep, isArray, isEmpty, isNil, sortBy } from 'lodash';
15
15
  // Components
16
16
  // import { LazyIcon as Icons } from '@antscorp/antsomi-ui/es/components/icons/LazyIcon';
@@ -522,8 +522,11 @@ export const renderMenuIcon = (iconName) => {
522
522
  try {
523
523
  // const ComponentIcon = iconName && Icons[iconName];
524
524
  const ComponentIcon = iconName && Icons[iconName];
525
- return ComponentIcon ? (React.createElement(Suspense, { fallback: null },
526
- React.createElement(ComponentIcon, { className: "menu-item__icon", size: 30 }))) : (React.createElement(IconWrapper, null, isNil(iconName) ? null : React.createElement(Icon, { type: iconName })));
525
+ return ComponentIcon ? (
526
+ // <Suspense fallback={null}>
527
+ React.createElement(ComponentIcon, { className: "menu-item__icon", size: 30 })) : (
528
+ // </Suspense>
529
+ React.createElement(IconWrapper, null, isNil(iconName) ? null : React.createElement(Icon, { type: iconName })));
527
530
  }
528
531
  catch (error) {
529
532
  return React.createElement(IconWrapper, null, isNil(iconName) ? null : React.createElement(Icon, { type: iconName }));
@@ -39,7 +39,7 @@ import { HeaderV2, AccessDenied } from '../../molecules';
39
39
  // Contexts
40
40
  import { AppConfigContext } from '../../..';
41
41
  // Constants
42
- import { APP_CODES, APP_IAM_DOMAIN, APP_PERMISSION_DOMAIN, CDP_ROUTE, IAM_API, PERMISSION_API, PORTALS_IDS, SOCKET_API, UOGS_PREFIX, } from '../../../constants';
42
+ import { APP_CACHE_PARAMS, APP_CODES, APP_IAM_DOMAIN, APP_PERMISSION_DOMAIN, CDP_ROUTE, IAM_API, PERMISSION_API, PORTALS_IDS, SOCKET_API, UOGS_PREFIX, } from '../../../constants';
43
43
  import { ENV } from '@antscorp/antsomi-ui/es/config';
44
44
  // Css
45
45
  import '@antscorp/processing-notification/dist/index.css';
@@ -150,6 +150,16 @@ export const Layout = memo(props => {
150
150
  const antsProcessingNotificationConfig = useMemo(() => (Object.assign({ permissionDomain, socketDomain: SOCKET_API, token, accountId: userId, userId, lang: languageCode, networkId: portalId }, processingNotificationProps)), [permissionDomain, token, userId, languageCode, portalId, processingNotificationProps]);
151
151
  const onActiveMenuCodeChange = useCallback((activeItemPath, flattenPermissionList, menuListPermission) => {
152
152
  var _a;
153
+ // Set menuActiveArr for CDP app to tracking
154
+ if (window && window[APP_CACHE_PARAMS] && (activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath.length)) {
155
+ const menuActiveArr = activeItemPath.map((item, index) => ({
156
+ code: item.menu_item,
157
+ label: item.menu_item_name,
158
+ /** In case index equal 0 (App level 1) then not set permission code */
159
+ permission_code: index !== 0 ? item.permission_code : null,
160
+ }));
161
+ window[APP_CACHE_PARAMS].menuActiveArr = menuActiveArr;
162
+ }
153
163
  const activeMenuItem = activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath[(activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath.length) - 1];
154
164
  const { menu_item_code, page_title, menu_item_name, permission_code } = activeMenuItem || {};
155
165
  setActivePageTitle(page_title
@@ -51,3 +51,4 @@ export declare const ENDPOINT: {
51
51
  toolkitV2: string;
52
52
  };
53
53
  export declare const UOGS_PREFIX = "uogs_";
54
+ export declare const APP_CACHE_PARAMS = "APP_CACHE_PARAMS";
@@ -54,3 +54,4 @@ export const ENDPOINT = {
54
54
  toolkitV2: `toolkit/v${TOOLKIT_API_VERSION}`,
55
55
  };
56
56
  export const UOGS_PREFIX = 'uogs_';
57
+ export const APP_CACHE_PARAMS = 'APP_CACHE_PARAMS';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.645",
3
+ "version": "1.3.5-beta.647",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",