@antscorp/antsomi-ui 1.3.5-beta.226 → 1.3.5-beta.228

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.
Files changed (25) hide show
  1. package/es/components/molecules/AccountSelection/AccountListing.d.ts +1 -1
  2. package/es/components/molecules/AccountSelection/AccountListing.js +18 -13
  3. package/es/components/molecules/AccountSelection/AccountSelection.js +45 -4
  4. package/es/components/molecules/HeaderV2/HeaderV2.d.ts +1 -1
  5. package/es/components/molecules/HeaderV2/HeaderV2.js +20 -19
  6. package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +1 -5
  7. package/es/components/organism/LeftMenu/components/common/ChildMenu/index.js +5 -10
  8. package/es/components/organism/LeftMenu/components/common/ChildMenu/utils.js +3 -2
  9. package/es/components/organism/LeftMenu/constants/sampleData.d.ts +2 -5
  10. package/es/components/organism/LeftMenu/hooks/useLeftMenu.js +14 -23
  11. package/es/components/organism/LeftMenu/hooks/useNavigatePath.d.ts +1 -1
  12. package/es/components/organism/LeftMenu/hooks/useNavigatePath.js +14 -8
  13. package/es/components/organism/LeftMenu/index.d.ts +6 -0
  14. package/es/components/organism/LeftMenu/index.js +10 -5
  15. package/es/components/organism/LeftMenu/stores/index.d.ts +2 -0
  16. package/es/components/organism/LeftMenu/styled.js +4 -0
  17. package/es/components/organism/LeftMenu/utils/index.d.ts +5 -0
  18. package/es/components/organism/LeftMenu/utils/index.js +17 -3
  19. package/es/components/template/Layout/Layout.d.ts +1 -0
  20. package/es/components/template/Layout/Layout.js +10 -8
  21. package/es/components/template/Layout/constants/permission.d.ts +5 -0
  22. package/es/components/template/Layout/constants/permission.js +5 -0
  23. package/es/components/template/Layout/stores/index.d.ts +0 -1
  24. package/es/providers/AppConfigProvider/contexts/index.d.ts +1 -0
  25. package/package.json +1 -1
@@ -10,7 +10,7 @@ export interface AccountListingProps {
10
10
  appCode?: string;
11
11
  };
12
12
  showAllAccount?: boolean;
13
- currentAccount?: number | 'ALL_ACCOUNT';
13
+ currentAccount?: string | 'ALL_ACCOUNT';
14
14
  onLabelChange?: (label: string) => void;
15
15
  onChange?: (userId: number | 'ALL_ACCOUNT') => void;
16
16
  }
@@ -1,5 +1,5 @@
1
1
  import Icon from '@antscorp/icons';
2
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import React, { useCallback, useMemo, useState } from 'react';
3
3
  import { Input, Text } from '@antscorp/antsomi-ui/es/components/atoms';
4
4
  import { AccountItem } from './components';
5
5
  import { AccountSelectionStyled } from './styled';
@@ -48,25 +48,30 @@ export const AccountListing = props => {
48
48
  return (data === null || data === void 0 ? void 0 : data.entries) || [];
49
49
  }, [data === null || data === void 0 ? void 0 : data.entries, permissionAccountList, portalId]);
50
50
  const [searchValue, setSearchValue] = useState('');
51
- const currentAccountInfo = useMemo(() => accountData === null || accountData === void 0 ? void 0 : accountData.find(account => account.userId === currentAccount), [accountData, currentAccount]);
52
- // HACK: this use for popover input label
53
- const inputLabel = currentAccount === 'ALL_ACCOUNT' ? 'All account' : currentAccountInfo === null || currentAccountInfo === void 0 ? void 0 : currentAccountInfo.userName;
54
- useEffect(() => {
55
- if (onLabelChange)
56
- onLabelChange(inputLabel);
57
- }, [inputLabel]);
51
+ // const currentAccountInfo = useMemo(
52
+ // () => accountData?.find(account => String(account.userId) === currentAccount),
53
+ // [accountData, currentAccount],
54
+ // );
55
+ const isAllAccount = !currentAccount || currentAccount === 'ALL_ACCOUNT';
56
+ // useEffect(() => {
57
+ // // HACK: this use for popover input label
58
+ // const inputLabel = isAllAccount ? 'All account' : currentAccountInfo?.userName;
59
+ // onLabelChange?.(inputLabel);
60
+ // }, [currentAccountInfo?.userName, isAllAccount, onLabelChange]);
58
61
  const handleSelectAccount = useCallback((userId) => {
59
- if (onChange)
60
- onChange(userId);
62
+ onChange === null || onChange === void 0 ? void 0 : onChange(userId);
63
+ // const userInfo = accountData?.find(account => String(account.userId) === userId);
64
+ // const inputLabel = userId === 'ALL_ACCOUNT' ? 'All account' : userInfo?.userName;
65
+ // onLabelChange?.(inputLabel);
61
66
  }, [onChange]);
62
67
  return (React.createElement(AccountSelectionStyled, { className: className },
63
68
  React.createElement(Input, { placeholder: "Search", suffix: React.createElement(Icon, { type: "icon-ants-search-2", style: { fontSize: '24px' } }), value: searchValue, onChange: event => setSearchValue(event.target.value) }),
64
69
  !!(recentData === null || recentData === void 0 ? void 0 : recentData.value) && (React.createElement(React.Fragment, null,
65
70
  React.createElement(Text, { className: "recent-text" }, "Recent"),
66
- React.createElement("ul", null, recentData === null || recentData === void 0 ? void 0 : recentData.value.map(accountId => accountData === null || accountData === void 0 ? void 0 : accountData.find(account => account.userId === accountId)).filter(Boolean).map(account => (React.createElement(AccountItem, { key: account.userId, userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: currentAccount === account.userId })))))),
71
+ React.createElement("ul", null, recentData === null || recentData === void 0 ? void 0 : recentData.value.map(accountId => accountData === null || accountData === void 0 ? void 0 : accountData.find(account => account.userId === accountId)).filter(Boolean).map(account => (React.createElement(AccountItem, { key: account.userId, userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: currentAccount === String(account.userId) })))))),
67
72
  React.createElement("div", { className: "antsomi-scroll-box account-list" },
68
73
  React.createElement("ul", { className: "scroll-content" }, accountData === null || accountData === void 0 ? void 0 : accountData.filter(account => !(recentData === null || recentData === void 0 ? void 0 : recentData.value.includes(account.userId)) &&
69
- searchStringQuery(account.userName, searchValue)).map(account => (React.createElement(AccountItem, { key: account.userId, userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: currentAccount === account.userId }))))),
70
- showAllAccount ? (React.createElement(Text, { className: `all-account ${currentAccount === 'ALL_ACCOUNT' ? 'is-selected' : ''}`, onClick: () => handleSelectAccount('ALL_ACCOUNT') },
74
+ searchStringQuery(account.userName, searchValue)).map(account => (React.createElement(AccountItem, { key: account.userId, userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: currentAccount === String(account.userId) }))))),
75
+ showAllAccount ? (React.createElement(Text, { className: `all-account ${isAllAccount ? 'is-selected' : ''}`, onClick: () => handleSelectAccount('ALL_ACCOUNT') },
71
76
  React.createElement("strong", null, "All account"))) : null));
72
77
  };
@@ -10,20 +10,61 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import Icon from '@antscorp/icons';
13
- import React, { useCallback, useState } from 'react';
13
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
14
14
  import { Popover } from '@antscorp/antsomi-ui/es/components/atoms';
15
15
  import { PopoverFieldStyled } from './styled';
16
16
  import { Tooltip } from 'antd';
17
17
  import { AccountListing } from './AccountListing';
18
+ import { useGetAccountList, useGetPermissionAccountList } from '../../..';
19
+ import { PORTALS_IDS } from '@antscorp/antsomi-ui/es/constants';
18
20
  export const AccountSelection = props => {
19
21
  const { show = true, inputStyle = 'input', inputClassName, onChange, getPopupContainer, zIndex } = props, accountListingProps = __rest(props, ["show", "inputStyle", "inputClassName", "onChange", "getPopupContainer", "zIndex"]);
20
- const [inputLabel, setInputLabel] = useState('');
22
+ const [inputLabel, setInputLabel] = useState('All account');
21
23
  const [open, setOpen] = useState(false);
22
24
  // const [searchValue, setSearchValue] = useState<string>('');
25
+ const { apiConfig, currentAccount } = props;
26
+ const { domain, token, userId, appCode, portalId } = apiConfig;
27
+ const { data } = useGetAccountList({
28
+ apiConfig,
29
+ options: {
30
+ enabled: portalId !== PORTALS_IDS.SANDBOX_76753,
31
+ },
32
+ });
33
+ const { data: permissionAccountList } = useGetPermissionAccountList({
34
+ args: {
35
+ _account_id: userId,
36
+ _user_id: userId,
37
+ _app_code: appCode || '',
38
+ _token: token,
39
+ domain,
40
+ appCode: appCode || '',
41
+ fullParent: true,
42
+ menuCode: appCode || '',
43
+ },
44
+ options: {
45
+ enabled: portalId === PORTALS_IDS.SANDBOX_76753,
46
+ },
47
+ });
48
+ const accountData = useMemo(() => {
49
+ if (portalId === PORTALS_IDS.SANDBOX_76753) {
50
+ return ((permissionAccountList === null || permissionAccountList === void 0 ? void 0 : permissionAccountList.map(account => ({
51
+ email: account.email,
52
+ userId: account.user_id,
53
+ userName: account.full_name,
54
+ status: 1,
55
+ }))) || []);
56
+ }
57
+ return (data === null || data === void 0 ? void 0 : data.entries) || [];
58
+ }, [data === null || data === void 0 ? void 0 : data.entries, permissionAccountList, portalId]);
59
+ const currentAccountInfo = useMemo(() => accountData === null || accountData === void 0 ? void 0 : accountData.find(account => String(account.userId) === currentAccount), [accountData, currentAccount]);
60
+ const isAllAccount = !currentAccount || currentAccount === 'ALL_ACCOUNT';
61
+ useEffect(() => {
62
+ const newLabel = isAllAccount ? 'All account' : currentAccountInfo === null || currentAccountInfo === void 0 ? void 0 : currentAccountInfo.userName;
63
+ setInputLabel(newLabel);
64
+ }, [currentAccountInfo === null || currentAccountInfo === void 0 ? void 0 : currentAccountInfo.userName, isAllAccount]);
23
65
  const handleSelectAccount = useCallback((userId) => {
24
66
  setOpen(false);
25
- if (onChange)
26
- onChange(userId);
67
+ onChange === null || onChange === void 0 ? void 0 : onChange(userId);
27
68
  }, [onChange]);
28
69
  return (show && (React.createElement(Popover, { content: React.createElement(AccountListing, Object.assign({}, accountListingProps, { onChange: handleSelectAccount, onLabelChange: newLabel => setInputLabel(newLabel) })), trigger: "click", overlayInnerStyle: { padding: 0 },
29
70
  // getPopupContainer={triggerNode => triggerNode}
@@ -8,7 +8,7 @@ export interface HeaderV2Props {
8
8
  style?: React.CSSProperties;
9
9
  pageTitle?: string | React.ReactNode;
10
10
  accountSelection?: Omit<AccountSelectionProps, 'onChange' | 'apiConfig'> & {
11
- onSelectAccount?: (account: number | 'ALL_ACCOUNT') => void;
11
+ onSelectAccount?: (account: string | 'ALL_ACCOUNT') => void;
12
12
  };
13
13
  helpConfig: Omit<IHelpProps, 'configs'> & {
14
14
  configs: Omit<IHelpProps['configs'], 'portalId' | 'userId' | 'token' | 'domain' | 'domainTicket' | 'domainPlatform'>;
@@ -19,32 +19,34 @@ import { AccountSharing, Help, Notification, } from '../../organism';
19
19
  import { APP_CODES, APP_PERMISSION_DOMAIN, CDP_API, IAM_API, ISSUE_API, PERMISSION_API, PLATFORM_API, PORTALS_IDS, SOCKET_API, } from '@antscorp/antsomi-ui/es/constants';
20
20
  import { useContextSelector } from 'use-context-selector';
21
21
  import { AppConfigContext } from '../../..';
22
- const { DATAFLOWS } = APP_CODES;
22
+ import { useHistory, useLocation } from 'react-router-dom';
23
23
  export const HeaderV2 = memo(props => {
24
- var _a, _b, _c;
25
- const { auth, env: envContext, languageCode = 'en', appCode, } = useContextSelector(AppConfigContext, state => state);
24
+ var _a;
25
+ const { auth, env: envContext, languageCode = 'en', appCode, urlLogout: urlLogoutProvider = '', } = useContextSelector(AppConfigContext, state => state);
26
+ const { search } = useLocation();
27
+ const history = useHistory();
26
28
  /** Prefer to use Header in AppConfigContext */
27
29
  const { className, style, pageTitle = 'Page Title', accountSelection = {}, helpConfig, notificationConfig = {}, accountSharingConfig, useURLParam, config, } = props;
28
30
  /** General config for children component */
29
31
  const { env = envContext, language = languageCode, userId = isNaN(Number(auth === null || auth === void 0 ? void 0 : auth.userId)) ? 0 : Number(auth === null || auth === void 0 ? void 0 : auth.userId), portalId = auth === null || auth === void 0 ? void 0 : auth.portalId, token = auth === null || auth === void 0 ? void 0 : auth.token, permissionDomain = PERMISSION_API, iamDomain = IAM_API, } = config || {};
30
32
  const { currentAccount, inputStyle = 'select', onSelectAccount } = accountSelection, accountSelectionProps = __rest(accountSelection, ["currentAccount", "inputStyle", "onSelectAccount"]);
31
- const urlParams = new URLSearchParams(window.location.search);
33
+ const urlParams = useMemo(() => new URLSearchParams(search), [search]);
32
34
  const oidParam = urlParams.get('oid');
33
- const [selectedAccount, setSelectedAccount] = useState(useURLParam
34
- ? (_b = (_a = Number(oidParam)) !== null && _a !== void 0 ? _a : userId) !== null && _b !== void 0 ? _b : 'ALL_ACCOUNT'
35
- : (_c = currentAccount !== null && currentAccount !== void 0 ? currentAccount : userId) !== null && _c !== void 0 ? _c : 'ALL_ACCOUNT');
35
+ // States
36
+ const [selectedAccount, setSelectedAccount] = useState(`${useURLParam ? oidParam !== null && oidParam !== void 0 ? oidParam : '' : (_a = currentAccount !== null && currentAccount !== void 0 ? currentAccount : userId) !== null && _a !== void 0 ? _a : ''}`);
37
+ // Side effects
36
38
  useEffect(() => {
37
- var _a;
38
39
  if (!useURLParam)
39
40
  return;
40
41
  if (!oidParam) {
41
- urlParams.append('oid', `${(_a = currentAccount !== null && currentAccount !== void 0 ? currentAccount : userId) !== null && _a !== void 0 ? _a : 'ALL_ACCOUNT'}`);
42
- const newUrl = `${window.location.pathname}?${urlParams.toString()}${window.location.hash}`;
43
- window.history.replaceState(null, '', newUrl);
42
+ // urlParams.append('oid', 'ALL_ACCOUNT');
43
+ // urlParams.append('oid', `${currentAccount ?? userId ?? 'ALL_ACCOUNT'}`);
44
+ // const newUrl = `${window.location.pathname}?${urlParams.toString()}${window.location.hash}`;
45
+ // window.history.replaceState(null, '', newUrl);
44
46
  }
45
47
  else {
46
- const newUrl = `${window.location.pathname}?${urlParams.toString()}${window.location.hash}`;
47
- window.history.replaceState(null, '', newUrl);
48
+ // const newUrl = `${window.location.pathname}?${urlParams.toString()}${window.location.hash}`;
49
+ // window.history.replaceState(null, '', newUrl);
48
50
  }
49
51
  // eslint-disable-next-line react-hooks/exhaustive-deps
50
52
  }, [oidParam, useURLParam, userId]);
@@ -89,21 +91,20 @@ export const HeaderV2 = memo(props => {
89
91
  networkId: portalId,
90
92
  urlEditProfile: `${permissionDomain}/${portalId}#/account/profile/`,
91
93
  // 6006 is storybook port so direct to sandbox page
92
- urlLogout: window.location.origin,
94
+ urlLogout: urlLogoutProvider || window.location.origin,
95
+ // urlLogout: window.location.origin,
93
96
  token,
94
97
  lang: language,
95
98
  };
96
99
  return (React.createElement(HeaderV2Styled, { className: className || '', style: style },
97
100
  React.createElement("div", { className: "left-side" },
98
101
  React.createElement(AccountSelection, Object.assign({}, accountSelectionProps, { currentAccount: selectedAccount, apiConfig: accountSelectionApiConfig, onChange: userId => {
99
- setSelectedAccount(userId);
102
+ setSelectedAccount(String(userId));
100
103
  if (useURLParam) {
101
104
  urlParams.set('oid', `${userId}`);
102
- const newUrl = `${window.location.pathname}?${urlParams.toString()}`;
103
- window.history.replaceState(null, '', newUrl);
105
+ history.replace({ search: urlParams.toString() });
104
106
  }
105
- if (onSelectAccount)
106
- onSelectAccount(userId);
107
+ onSelectAccount === null || onSelectAccount === void 0 ? void 0 : onSelectAccount(String(userId));
107
108
  }, inputStyle: inputStyle })),
108
109
  typeof pageTitle === 'string' ? React.createElement("div", { className: "page-title" }, pageTitle) : pageTitle),
109
110
  React.createElement("div", { className: "right-side" },
@@ -1,14 +1,11 @@
1
1
  // Libraries
2
2
  import { useCallback, useMemo } from 'react';
3
- import { useContextSelector } from 'use-context-selector';
4
3
  import { useHistory, useLocation } from 'react-router-dom';
5
4
  // Constants
6
5
  import { CONFIG_OPTIONS } from './constants';
7
6
  import { HOME_REPORT_ROUTES } from '../../constants';
8
7
  // Utils
9
8
  import { getGeneratePath, getMenuItem } from '../../utils';
10
- // Contexts
11
- import { AppConfigContext } from '@antscorp/antsomi-ui/es/providers';
12
9
  // Types
13
10
  import { useLeftMenuStore } from '../../stores';
14
11
  export const useHomeMenu = () => {
@@ -16,8 +13,7 @@ export const useHomeMenu = () => {
16
13
  const { pathname } = useLocation();
17
14
  const history = useHistory();
18
15
  const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
19
- // Contexts
20
- const auth = useContextSelector(AppConfigContext, state => state === null || state === void 0 ? void 0 : state.auth);
16
+ const auth = useLeftMenuStore(store => { var _a; return (_a = store.state.appConfig) === null || _a === void 0 ? void 0 : _a.auth; });
21
17
  // Memos
22
18
  const onOptionCallback = useCallback((args) => {
23
19
  const { optionKey, menuItemKey } = args;
@@ -3,8 +3,7 @@ import React, { memo, useEffect, useState } from 'react';
3
3
  import Icon from '@antscorp/icons';
4
4
  import { isEmpty, isNil, uniq } from 'lodash';
5
5
  import classNames from 'classnames';
6
- import { Link, useLocation } from 'react-router-dom';
7
- import { useContextSelector } from 'use-context-selector';
6
+ import { Link } from 'react-router-dom';
8
7
  // Components
9
8
  import { Dropdown, Menu } from 'antd';
10
9
  import { Flex } from '../../../../../atoms';
@@ -14,8 +13,6 @@ import { LabelCustom, MenuWrapper } from './styled';
14
13
  import { IconWrapper } from '../../../styled';
15
14
  // Constants
16
15
  import { ICON_SIZE } from '../../../constants';
17
- // Contexts
18
- import { AppConfigContext } from '@antscorp/antsomi-ui/es/providers';
19
16
  // Utils
20
17
  import { findActiveAppCodeByUrl, findLastMatchedItemByUrl } from '../../../utils';
21
18
  import { recursiveFindParentOfActiveItem } from './utils';
@@ -25,9 +22,8 @@ import { useLeftMenuStore } from '../../../stores';
25
22
  import { useNavigatePath } from '../../../hooks/useNavigatePath';
26
23
  export const ChildMenu = memo(props => {
27
24
  const { items = [], parentKey, onMenuClick } = props;
28
- // Contexts
29
- const auth = useContextSelector(AppConfigContext, state => state === null || state === void 0 ? void 0 : state.auth);
30
25
  // Stores
26
+ const auth = useLeftMenuStore(store => { var _a; return (_a = store.state.appConfig) === null || _a === void 0 ? void 0 : _a.auth; });
31
27
  const activeAppCode = useLeftMenuStore(store => store.state.activeAppCode);
32
28
  const menuItems = useLeftMenuStore(store => store.state.menuItems);
33
29
  const setLeftMenuState = useLeftMenuStore(store => store.setState);
@@ -37,12 +33,12 @@ export const ChildMenu = memo(props => {
37
33
  // Variables
38
34
  const randomMenuWrapperId = random(10);
39
35
  // Hooks
40
- const { pathname, hash, search } = useLocation();
36
+ const { pathname, hash } = window.location;
41
37
  const { isPushDifferentDomain, getPath, navigatePath } = useNavigatePath();
42
38
  // Side Effects
43
39
  useEffect(() => {
44
40
  var _a;
45
- const url = `${pathname}${hash}${search}`;
41
+ const url = `${pathname}${hash}`;
46
42
  /** Active menu item by current url */
47
43
  const activeMenuItem = (_a = findLastMatchedItemByUrl({ url, menuItems, auth })) === null || _a === void 0 ? void 0 : _a.menu_item_code;
48
44
  if (activeMenuItem && activeMenuItem !== currentActiveItem) {
@@ -64,7 +60,6 @@ export const ChildMenu = memo(props => {
64
60
  hash,
65
61
  items,
66
62
  pathname,
67
- search,
68
63
  parentKey,
69
64
  activeAppCode,
70
65
  menuItems,
@@ -93,7 +88,7 @@ export const ChildMenu = memo(props => {
93
88
  React.createElement(Icon, { className: "child-menu-item-icon", type: "icon-ants-three-dot-vertical", style: { marginTop: '2px', zIndex: 1000 } })))) : (React.createElement(LabelCustom, { ellipsis: { tooltip: label } }, label));
94
89
  return {
95
90
  key,
96
- label: !menu_item_path ? (labelComponent()) : isPushDifferentDomain(menu_item_domain, menu_item_path) ? (React.createElement("div", { onClick: () => navigatePath(menu_item_domain, menu_item_path), className: "menu-link" }, labelComponent())) : (React.createElement(Link, { to: getPath(menu_item_domain, menu_item_path), className: "menu-link" }, labelComponent())),
91
+ label: !menu_item_path ? (labelComponent()) : isPushDifferentDomain(menu_item_domain, menu_item_path) ? (React.createElement("div", { onClick: () => navigatePath(menu_item_domain, menu_item_path), className: "menu-link" }, labelComponent())) : (React.createElement(Link, { to: getPath(menu_item_path), className: "menu-link" }, labelComponent())),
97
92
  icon: !isNil(icon) ? (React.createElement(IconWrapper, null,
98
93
  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,
99
94
  children: customMenuItems({ parent: item, items: children }),
@@ -1,5 +1,5 @@
1
1
  // Utils
2
- import { getGeneratePath } from '../../../utils';
2
+ import { getComparePath, getGeneratePath } from '../../../utils';
3
3
  import { handleError } from '@antscorp/antsomi-ui/es/utils';
4
4
  const PATH = 'src/components/organism/LeftMenu/components/common/ChildMenu/utils.ts';
5
5
  /**
@@ -22,7 +22,8 @@ export const findActiveMenuItemByUrl = (args) => {
22
22
  const recursiveFindActiveItem = (items) => {
23
23
  let activeItem;
24
24
  for (const item of items) {
25
- if (!!(item === null || item === void 0 ? void 0 : item.menu_item_path) && url.includes(getGeneratePath(item.menu_item_path, auth))) {
25
+ if (!!(item === null || item === void 0 ? void 0 : item.menu_item_path) &&
26
+ url.includes(getComparePath(getGeneratePath(item.menu_item_path, auth)))) {
26
27
  activeItem = item === null || item === void 0 ? void 0 : item.menu_item_code;
27
28
  break;
28
29
  }
@@ -1,7 +1,4 @@
1
1
  import { TFeatureMenu } from '@antscorp/antsomi-ui/es/models/LeftMenu';
2
- export declare const MENU_ITEMS: {
3
- key: string;
4
- label: string;
5
- icon: string;
6
- }[];
2
+ import { TMenuItem } from '../types';
3
+ export declare const MENU_ITEMS: TMenuItem[];
7
4
  export declare const MENU_SAMPLE: TFeatureMenu[];
@@ -1,10 +1,6 @@
1
1
  // Libraries
2
2
  import { useCallback, useEffect, useMemo, useState } from 'react';
3
- import { useContextSelector } from 'use-context-selector';
4
3
  import { isArray, sortBy } from 'lodash';
5
- import { useLocation } from 'react-router-dom';
6
- // Contexts
7
- import { AppConfigContext } from '@antscorp/antsomi-ui/es/providers';
8
4
  // Queries
9
5
  import { useGetDashboard, useGetDestinationChannel, useGetListMenu, useGetListMenuPermission, } from '@antscorp/antsomi-ui/es/queries/LeftMenu';
10
6
  // Utils
@@ -18,16 +14,15 @@ const initialState = {
18
14
  };
19
15
  export const useLeftMenu = (props) => {
20
16
  // Props
21
- const { objectType = 'OVERVIEW', objectId = 1, isGrouped = true, onActiveMenuCodeChange } = props;
17
+ const { objectType = 'OVERVIEW', objectId = 1, isGrouped = true, appConfig, onActiveMenuCodeChange, } = props;
22
18
  // Hooks
23
- const { pathname, hash, search } = useLocation();
24
- // Contexts
25
- const appConfig = useContextSelector(AppConfigContext, state => state);
19
+ const { pathname, hash } = window.location;
20
+ console.log({ pathname, hash, locationWindow: window.location });
26
21
  // Stores
27
22
  const activeAppCode = useLeftMenuStore(store => store.state.activeAppCode);
28
23
  const setLeftMenuState = useLeftMenuStore(store => store.setState);
29
24
  // Destructuring variables
30
- const { auth, languageCode } = appConfig;
25
+ const { auth, languageCode } = appConfig || {};
31
26
  // State
32
27
  const [state, setState] = useState(initialState);
33
28
  // Queries
@@ -101,7 +96,7 @@ export const useLeftMenu = (props) => {
101
96
  dashboardData,
102
97
  destinationChannelEntries: destinationChannel === null || destinationChannel === void 0 ? void 0 : destinationChannel.entries,
103
98
  }), [auth, dashboardData, destinationChannel === null || destinationChannel === void 0 ? void 0 : destinationChannel.entries, permissionMenu]);
104
- /* Handers */
99
+ /* Handlers */
105
100
  const receivePostMessage = (event) => {
106
101
  const { data } = event;
107
102
  const { type } = data || {};
@@ -119,7 +114,12 @@ export const useLeftMenu = (props) => {
119
114
  useEffect(() => {
120
115
  window.addEventListener('message', receivePostMessage);
121
116
  return () => window.removeEventListener('message', receivePostMessage);
117
+ // eslint-disable-next-line react-hooks/exhaustive-deps
122
118
  }, []);
119
+ useEffect(() => {
120
+ if (appConfig)
121
+ setLeftMenuState({ appConfig });
122
+ }, [appConfig, setLeftMenuState]);
123
123
  /**
124
124
  * Change list menu children when hovering or activating items, giving priority to hovering items
125
125
  */
@@ -137,20 +137,19 @@ export const useLeftMenu = (props) => {
137
137
  * Active App Item having code matching url
138
138
  */
139
139
  useEffect(() => {
140
- const url = `${pathname}${hash}${search}`;
140
+ const url = `${pathname}${hash}`;
141
141
  const matchAppCode = findActiveAppCodeByUrl({ url, menuItems: mappingChildrenMenu, auth });
142
142
  if (matchAppCode && matchAppCode !== activeAppCode) {
143
143
  setLeftMenuState({ activeAppCode: matchAppCode });
144
144
  }
145
145
  }, [
146
146
  activeAppCode,
147
- appConfig.auth,
147
+ appConfig === null || appConfig === void 0 ? void 0 : appConfig.auth,
148
148
  auth,
149
149
  hash,
150
150
  mappingChildrenMenu,
151
151
  pathname,
152
152
  permissionMenu,
153
- search,
154
153
  setLeftMenuState,
155
154
  ]);
156
155
  /**
@@ -158,7 +157,7 @@ export const useLeftMenu = (props) => {
158
157
  */
159
158
  useEffect(() => {
160
159
  var _a;
161
- const url = `${pathname}${hash}${search}`;
160
+ const url = `${pathname}${hash}`;
162
161
  const matchedCode = (_a = findLastMatchedItemByUrl({
163
162
  url,
164
163
  menuItems: mappingChildrenMenu,
@@ -171,15 +170,7 @@ export const useLeftMenu = (props) => {
171
170
  })
172
171
  : [];
173
172
  onActiveMenuCodeChange === null || onActiveMenuCodeChange === void 0 ? void 0 : onActiveMenuCodeChange(activeItemPath, flattenMenuPermission);
174
- }, [
175
- auth,
176
- flattenMenuPermission,
177
- hash,
178
- mappingChildrenMenu,
179
- onActiveMenuCodeChange,
180
- pathname,
181
- search,
182
- ]);
173
+ }, [auth, flattenMenuPermission, hash, mappingChildrenMenu, onActiveMenuCodeChange, pathname]);
183
174
  /* Callbacks */
184
175
  const onToggleChildMenu = useCallback(() => {
185
176
  setState(prev => (Object.assign(Object.assign({}, prev), { isExpandMenu: !prev.isExpandMenu })));
@@ -1,5 +1,5 @@
1
1
  export declare const useNavigatePath: () => {
2
2
  isPushDifferentDomain: (domain: string | null, path: string | null) => boolean;
3
- getPath: (domain: string | null, path: string | null) => string;
3
+ getPath: (path: string | null) => string;
4
4
  navigatePath: (domain: string | null, path: string | null) => void;
5
5
  };
@@ -8,13 +8,17 @@ import { AppConfigContext } from '@antscorp/antsomi-ui/es/providers';
8
8
  import { getGeneratePath } from '../utils';
9
9
  // Constants
10
10
  import { ENV } from '@antscorp/antsomi-ui/es/config';
11
+ import { useLocation } from 'react-router-dom';
11
12
  export const useNavigatePath = () => {
12
13
  // Contexts
13
14
  const { auth, env } = useContextSelector(AppConfigContext, state => state);
15
+ const { search } = useLocation();
16
+ const searchParams = search === '?' || !search ? '' : search;
17
+ const isDev = env === ENV.DEV;
14
18
  // Callbacks
15
19
  const isPushDifferentDomain = useCallback((domain, path) => {
16
20
  var _a, _b, _c, _d, _e, _f;
17
- if (env === ENV.DEV)
21
+ if (isDev)
18
22
  return false;
19
23
  const customDomain = domain !== null && domain !== void 0 ? domain : '';
20
24
  const splitNextPath = (path === null || path === void 0 ? void 0 : path.split('#')) || ['', ''];
@@ -26,18 +30,20 @@ export const useNavigatePath = () => {
26
30
  return currentRoute !== nextRoute;
27
31
  }
28
32
  return !!customDomain && customDomain !== ((_f = window.location) === null || _f === void 0 ? void 0 : _f.origin);
29
- }, [env]);
30
- const getPath = useCallback((domain, path) => {
33
+ }, [isDev]);
34
+ const getPath = useCallback((path) => {
31
35
  var _a;
32
- if ((path === null || path === void 0 ? void 0 : path.includes('#')) && isPushDifferentDomain(domain, path)) {
36
+ if (path === null || path === void 0 ? void 0 : path.includes('#')) {
33
37
  const customPath = ((_a = path === null || path === void 0 ? void 0 : path.split('#')) === null || _a === void 0 ? void 0 : _a[1]) || '';
34
38
  return getGeneratePath(customPath, auth);
35
39
  }
36
- return getGeneratePath(`${path !== null && path !== void 0 ? path : ''}`, auth);
37
- }, [auth, isPushDifferentDomain]);
40
+ return `${getGeneratePath(path !== null && path !== void 0 ? path : '', auth)}`;
41
+ // return `${getGeneratePath(path ?? '', auth)}${searchParams}`;
42
+ }, [auth, searchParams]);
38
43
  const navigatePath = useCallback((domain, path) => {
39
44
  const newDomain = isNil(domain) || env === ENV.DEV ? '' : domain;
40
- window.location.assign(getGeneratePath(`${newDomain}${path}`, auth));
41
- }, [auth, env]);
45
+ window.location.assign(`${getGeneratePath(`${newDomain}${path}`, auth)}`);
46
+ // window.location.assign(`${getGeneratePath(`${newDomain}${path}`, auth)}${searchParams}`);
47
+ }, [auth, env, searchParams]);
42
48
  return { isPushDifferentDomain, getPath, navigatePath };
43
49
  };
@@ -1,12 +1,18 @@
1
1
  import React from 'react';
2
2
  import { TFeatureMenu } from '@antscorp/antsomi-ui/es/models/LeftMenu/FeatureMenu';
3
3
  import { FeatureMenuPermission } from '@antscorp/antsomi-ui/es/models/LeftMenu';
4
+ import { AppConfigProviderProps } from '../../..';
5
+ import { TMenuItem } from './types';
4
6
  export interface LeftMenuProps {
7
+ appConfig?: AppConfigProviderProps;
5
8
  objectType?: string;
6
9
  objectId?: number;
7
10
  isGrouped?: boolean;
8
11
  style?: React.CSSProperties;
9
12
  className?: string;
13
+ isExpandable?: boolean;
14
+ items?: TMenuItem[];
15
+ isCustomized?: boolean;
10
16
  onActiveMenuCodeChange?: (activeItemPath: TFeatureMenu[], flattenPermissionList?: FeatureMenuPermission[]) => void;
11
17
  }
12
18
  export declare const LeftMenu: React.FC<LeftMenuProps>;
@@ -18,7 +18,7 @@ import { useLeftMenu } from './hooks';
18
18
  import { useNavigatePath } from './hooks/useNavigatePath';
19
19
  export const LeftMenu = memo(props => {
20
20
  var _a;
21
- const { style, className } = props;
21
+ const { style, className, isExpandable = true, isCustomized = false } = props;
22
22
  // Hooks
23
23
  const {
24
24
  /* State */
@@ -71,8 +71,13 @@ export const LeftMenu = memo(props => {
71
71
  React.createElement("div", { className: "icon-wrapper" }, isNil(icon_name) ? null : React.createElement(Icon, { type: icon_name, style: { fontSize: ICON_SIZE } })),
72
72
  React.createElement(Typography.Text, null, menu_item_name),
73
73
  React.createElement("div", { className: "popup-triangle" })));
74
- return (React.createElement(FeatureMenuItem, { key: menu_item, onMouseEnter: () => onMouseEnter(menu_item_code) }, isString(menu_item_path) ? (isPushDifferentDomain(menu_item_domain, menu_item_path) ? (React.createElement("div", { onClick: () => navigatePath(menu_item_domain, menu_item_path) }, labelComponent())) : (React.createElement(Link, { to: getPath(menu_item_domain, menu_item_path), className: "menu-link" }, labelComponent()))) : (labelComponent())));
74
+ return (React.createElement(FeatureMenuItem, { key: menu_item, onMouseEnter: () => onMouseEnter(menu_item_code) }, isString(menu_item_path) ? (isPushDifferentDomain(menu_item_domain, menu_item_path) ? (React.createElement("div", { onClick: () => navigatePath(menu_item_domain, menu_item_path) }, labelComponent())) : (React.createElement(Link, { to: getPath(menu_item_path), className: "menu-link" }, labelComponent()))) : (labelComponent())));
75
75
  };
76
+ // const renderCustomizedMenuItems = (items: TMenuItem) => {
77
+ // return items?.map(item => {
78
+ // return <FeatureMenuItem key={menu_item} onMouseEnter={() => onMouseEnter(menu_item_code)} />;
79
+ // });
80
+ // };
76
81
  return (React.createElement(LeftMenuNavWrapper, { style: style, className: className },
77
82
  React.createElement(LeftMenuNav, null,
78
83
  React.createElement(FeatureMenuWrapper, { isExpandMenu: state.isExpandMenu, vertical: true },
@@ -88,12 +93,12 @@ export const LeftMenu = memo(props => {
88
93
  const settingFeature = permissionMenu === null || permissionMenu === void 0 ? void 0 : permissionMenu.find(item => item.menu_item_code === APP_KEYS.SETTINGS);
89
94
  return settingFeature ? renderFeatureMenuItems(settingFeature) : null;
90
95
  })())),
91
- React.createElement(ExpandWrapper, { onMouseEnter: onMouseLeave },
96
+ isExpandable && (React.createElement(ExpandWrapper, { onMouseEnter: onMouseLeave },
92
97
  React.createElement(Icon, { type: "icon-ants-expand-more", style: {
93
98
  cursor: 'pointer',
94
99
  fontSize: '20px',
95
100
  transform: `rotate(${state.isExpandMenu ? '90deg' : '270deg'})`,
96
- }, onClick: onToggleChildMenu }))),
97
- React.createElement(ChildMenuWrapper, { isExpand: state.isExpandMenu, className: "antsomi-scroll-box" },
101
+ }, onClick: onToggleChildMenu })))),
102
+ React.createElement(ChildMenuWrapper, { isExpand: state.isExpandMenu && isExpandable, className: "antsomi-scroll-box" },
98
103
  React.createElement("div", { className: "scroll-content" }, childMenu))));
99
104
  });
@@ -1,8 +1,10 @@
1
1
  import { TFeatureMenu } from '@antscorp/antsomi-ui/es/models/LeftMenu';
2
+ import { AppConfigProviderProps } from '@antscorp/antsomi-ui/es/providers';
2
3
  export interface LeftMenuState {
3
4
  activeAppCode: string;
4
5
  menuItems: TFeatureMenu[];
5
6
  appMenuChildren: TFeatureMenu[];
7
+ appConfig?: AppConfigProviderProps;
6
8
  }
7
9
  interface LeftMenuStore {
8
10
  state: LeftMenuState;
@@ -125,6 +125,10 @@ export const FeatureMenuItem = styled.div `
125
125
  padding: 5px 0;
126
126
  position: relative;
127
127
 
128
+ &::before {
129
+ display: none !important;
130
+ }
131
+
128
132
  .icon-wrapper {
129
133
  height: 30px;
130
134
  width: 30px;
@@ -28,6 +28,11 @@ export declare const getGeneratePath: (path: string, params?: Partial<PayloadInf
28
28
  dashboardId?: string;
29
29
  channelId?: number;
30
30
  }) => string;
31
+ /**
32
+ * This is used to delete the hash of the path returned from the api,
33
+ * the purpose of which is to compare with the url to activate the app
34
+ */
35
+ export declare const getComparePath: (path: string) => string;
31
36
  /**
32
37
  * Creates an initial feature menu item object with default values.
33
38
  * @param {Partial<TFeatureMenu>} featureMenuItem - The partial feature menu item object.
@@ -87,6 +87,18 @@ export const getGeneratePath = (path, params) => {
87
87
  return '';
88
88
  }
89
89
  };
90
+ /**
91
+ * This is used to delete the hash of the path returned from the api,
92
+ * the purpose of which is to compare with the url to activate the app
93
+ */
94
+ export const getComparePath = (path) => {
95
+ var _a;
96
+ if (path === null || path === void 0 ? void 0 : path.includes('#')) {
97
+ const customPath = ((_a = path === null || path === void 0 ? void 0 : path.split('#')) === null || _a === void 0 ? void 0 : _a[1]) || '';
98
+ return customPath;
99
+ }
100
+ return path;
101
+ };
90
102
  /**
91
103
  * Creates an initial feature menu item object with default values.
92
104
  * @param {Partial<TFeatureMenu>} featureMenuItem - The partial feature menu item object.
@@ -167,7 +179,8 @@ export const findActiveAppCodeByUrl = (args) => {
167
179
  const recursiveCheckHasActiveChild = (items) => {
168
180
  let matchAppCode = false;
169
181
  for (const item of items) {
170
- if (!!(item === null || item === void 0 ? void 0 : item.menu_item_path) && url.includes(getGeneratePath(item.menu_item_path, auth))) {
182
+ if (!!(item === null || item === void 0 ? void 0 : item.menu_item_path) &&
183
+ url.includes(getComparePath(getGeneratePath(item.menu_item_path, auth)))) {
171
184
  matchAppCode = true;
172
185
  break;
173
186
  }
@@ -182,7 +195,7 @@ export const findActiveAppCodeByUrl = (args) => {
182
195
  };
183
196
  for (const menuItem of menuItems) {
184
197
  if (!!(menuItem === null || menuItem === void 0 ? void 0 : menuItem.menu_item_path) &&
185
- url.includes(getGeneratePath(menuItem.menu_item_path, auth))) {
198
+ url.includes(getComparePath(getGeneratePath(menuItem.menu_item_path, auth)))) {
186
199
  matchAppCode = menuItem.menu_item_code;
187
200
  break;
188
201
  }
@@ -208,7 +221,8 @@ export const findLastMatchedItemByUrl = (args) => {
208
221
  const matchedItems = [];
209
222
  const recursiveFindActiveItem = (items) => {
210
223
  for (const item of items) {
211
- if (!!(item === null || item === void 0 ? void 0 : item.menu_item_path) && url.includes(getGeneratePath(item.menu_item_path, auth))) {
224
+ if (!!(item === null || item === void 0 ? void 0 : item.menu_item_path) &&
225
+ url.includes(getComparePath(getGeneratePath(item.menu_item_path, auth)))) {
212
226
  matchedItems.push(item);
213
227
  }
214
228
  if ((item === null || item === void 0 ? void 0 : item.children) && item.children.length) {
@@ -12,6 +12,7 @@ interface LayoutProps {
12
12
  workspaceProps?: React.HTMLAttributes<HTMLDivElement> & {
13
13
  workspaceContentProps?: React.HTMLAttributes<HTMLDivElement>;
14
14
  };
15
+ onActiveMenuChange?: (menuActive?: string) => void;
15
16
  }
16
17
  export declare const Layout: React.FC<PropsWithChildren<LayoutProps>>;
17
18
  declare global {
@@ -23,21 +23,21 @@ import { HeaderV2 } from '../../molecules';
23
23
  // Contexts
24
24
  import { AppConfigContext } from '../../..';
25
25
  // Constants
26
+ import { MENU_PERMISSIONS } from './constants';
26
27
  import { APP_CODES, APP_IAM_DOMAIN, APP_PERMISSION_DOMAIN, IAM_API, PERMISSION_API, PORTALS_IDS, SOCKET_API, } from '../../../constants';
27
28
  // Css
28
29
  import '@antscorp/processing-notification/dist/index.css';
29
30
  import { useLayoutStore } from './stores';
30
31
  // Utils
31
32
  import { checkingRoleScope } from './utils';
32
- import { MENU_PERMISSIONS } from './constants';
33
- // Types
34
33
  const { DATAFLOWS } = APP_CODES;
35
34
  export const Layout = memo(props => {
36
- const { leftMenuProps, headerProps = {}, workspaceProps, processingNotificationProps, children, } = props;
35
+ const { leftMenuProps, headerProps = {}, workspaceProps, processingNotificationProps, children, onActiveMenuChange, } = props;
37
36
  const _a = leftMenuProps || {}, { className = '' } = _a, restOfLeftMenuProps = __rest(_a, ["className"]);
38
37
  const _b = workspaceProps || {}, { workspaceContentProps } = _b, restOfWorkspaceProps = __rest(_b, ["workspaceContentProps"]);
39
38
  // Selectors
40
- const { auth, languageCode, appCode, env } = useContextSelector(AppConfigContext, state => state);
39
+ const appConfig = useContextSelector(AppConfigContext, state => state);
40
+ const { auth, languageCode, appCode, env } = appConfig;
41
41
  const { token, userId, portalId } = auth || {};
42
42
  const headerStore = useLayoutStore(store => store.state.header);
43
43
  const [showAccountSelection, setShowAccountSelection] = useState(false);
@@ -74,7 +74,7 @@ export const Layout = memo(props => {
74
74
  }, [appCode, env, portalId]);
75
75
  const initialHeaderProps = useMemo(() => {
76
76
  var _a, _b;
77
- return (Object.assign(Object.assign({ className: 'layout-header' }, headerProps), { config: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.config), { permissionDomain,
77
+ return (Object.assign(Object.assign({ className: 'layout-header', useURLParam: true }, headerProps), { config: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.config), { permissionDomain,
78
78
  iamDomain }), helpConfig: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.helpConfig), { configs: Object.assign(Object.assign({}, (_a = headerProps === null || headerProps === void 0 ? void 0 : headerProps.helpConfig) === null || _a === void 0 ? void 0 : _a.configs), { appCode: 'SANDBOX_MARKETING', avatar: '//c0-platform.ants.tech/avatar/2021/09/17/0xgbkurioo.png', config: {
79
79
  p_timezone: 'Asia/Singapore',
80
80
  api_pid: 33167,
@@ -82,10 +82,12 @@ export const Layout = memo(props => {
82
82
  embeddedData: {},
83
83
  INSIGHT_U_OGS: 'uogs',
84
84
  } }) }), accountSharingConfig: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSharingConfig), { u_ogs: 'uogs', appCode: 'APP_CUSTOMER_360' }), accountSelection: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection), { show: !!((_b = headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection) === null || _b === void 0 ? void 0 : _b.show) && showAccountSelection }) }));
85
- }, [headerProps, permissionDomain, showAccountSelection]);
85
+ }, [headerProps, iamDomain, permissionDomain, showAccountSelection]);
86
86
  const mergeHeaderProps = useMemo(() => merge(initialHeaderProps, headerStore), [initialHeaderProps, headerStore]);
87
87
  const antsProcessingNotificationConfig = useMemo(() => (Object.assign({ permissionDomain, socketDomain: SOCKET_API, token, accountId: userId, userId, lang: languageCode, networkId: portalId }, processingNotificationProps)), [permissionDomain, token, userId, languageCode, portalId, processingNotificationProps]);
88
88
  const onActiveMenuCodeChange = useCallback((activeItemPath, flattenPermissionList) => {
89
+ var _a;
90
+ onActiveMenuChange === null || onActiveMenuChange === void 0 ? void 0 : onActiveMenuChange((_a = activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath[(activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath.length) - 1]) === null || _a === void 0 ? void 0 : _a.menu_item_code);
89
91
  if (isEmpty(activeItemPath)) {
90
92
  setShowAccountSelection(false);
91
93
  return;
@@ -124,11 +126,11 @@ export const Layout = memo(props => {
124
126
  }
125
127
  }
126
128
  setShowAccountSelection(roleScope);
127
- }, []);
129
+ }, [onActiveMenuChange]);
128
130
  return (React.createElement(LayoutWrapper, null,
129
131
  React.createElement(HeaderV2, Object.assign({}, mergeHeaderProps)),
130
132
  React.createElement(Flex, { className: "layout-body" },
131
- React.createElement(LeftMenu, Object.assign({ className: `layout-body__menu ${className}` }, restOfLeftMenuProps, { onActiveMenuCodeChange: onActiveMenuCodeChange })),
133
+ React.createElement(LeftMenu, Object.assign({ className: `layout-body__menu ${className}`, appConfig: appConfig }, restOfLeftMenuProps, { onActiveMenuCodeChange: onActiveMenuCodeChange })),
132
134
  React.createElement(ContentWrapper, null,
133
135
  React.createElement("div", Object.assign({}, restOfWorkspaceProps, { className: `layout-body__content ${(workspaceProps === null || workspaceProps === void 0 ? void 0 : workspaceProps.className) || ''}` }),
134
136
  React.createElement(NotificationWrapper, null,
@@ -17,4 +17,9 @@ export declare const MENU_PERMISSIONS: {
17
17
  ALL_CHANNEL: string;
18
18
  ORCHESTRATION: string;
19
19
  CAMPAIGN: string;
20
+ BATCH_STREAM: string;
21
+ REALTIME_STREAM: string;
22
+ DF_DATA_SOURCE: string;
23
+ DESTINATION: string;
24
+ REPORT: string;
20
25
  };
@@ -17,4 +17,9 @@ export const MENU_PERMISSIONS = {
17
17
  [MARKETING_CHANNEL_CODE.ALL_CHANNEL]: 'JOURNEY',
18
18
  [MARKETING_CHANNEL_CODE.ORCHESTRATION]: 'JOURNEY',
19
19
  [MARKETING_CHANNEL_CODE.CAMPAIGN]: 'JOURNEY',
20
+ BATCH_STREAM: 'BATCH_STREAM',
21
+ REALTIME_STREAM: 'REALTIME_STREAM',
22
+ DF_DATA_SOURCE: 'DF_DATA_SOURCE',
23
+ DESTINATION: 'DESTINATION',
24
+ REPORT: 'REPORT',
20
25
  };
@@ -3,7 +3,6 @@ import { DeepPartial } from '@antscorp/antsomi-ui/es/types';
3
3
  export interface HeaderStore extends Partial<HeaderV2Props> {
4
4
  }
5
5
  export interface LeftMenuStore {
6
- menuCodeActive?: string;
7
6
  }
8
7
  export interface WorkspaceStore {
9
8
  }
@@ -6,6 +6,7 @@ export interface AppConfigProviderProps {
6
6
  auth?: Omit<PayloadInfo, 'url'>;
7
7
  appCode?: string;
8
8
  languageCode?: string;
9
+ urlLogout?: string;
9
10
  }
10
11
  declare const AppConfigContext: import("use-context-selector").Context<AppConfigProviderProps>;
11
12
  declare const AppConfigProvider: React.FC<React.PropsWithChildren<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.226",
3
+ "version": "1.3.5-beta.228",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",