@antscorp/antsomi-ui 1.9.6 → 1.9.7

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.
@@ -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.9.6",
3
+ "version": "1.9.7",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",