@antscorp/antsomi-ui 1.3.5-beta.225 → 1.3.5-beta.227

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 @@ 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}
@@ -10,12 +10,11 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  // Libraries
13
- import { THEME } from '@antscorp/antsomi-ui/es/constants';
13
+ import { globalToken } from '@antscorp/antsomi-ui/es/constants';
14
14
  import React from 'react';
15
15
  import styled from 'styled-components';
16
16
  // Icons
17
17
  import { ExpandMoreRight } from '../../../icons';
18
- const { token } = THEME || {};
19
18
  /* Styled */
20
19
  const StyledToggleButton = styled.div `
21
20
  position: absolute;
@@ -25,8 +24,8 @@ const StyledToggleButton = styled.div `
25
24
  display: flex;
26
25
  align-items: center;
27
26
  justify-content: center;
28
- background-color: ${token === null || token === void 0 ? void 0 : token.blue1_2};
29
- color: ${token === null || token === void 0 ? void 0 : token.bw8};
27
+ background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue1_2};
28
+ color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8};
30
29
  top: 50%;
31
30
  transform: translateY(-50%);
32
31
  left: -5px;
@@ -1,11 +1,8 @@
1
- var _a, _b;
2
1
  // Libraries
3
2
  import styled from 'styled-components';
4
3
  // Drawer
5
4
  import { Drawer } from '../Drawer';
6
- // Constants
7
- import { THEME } from '@antscorp/antsomi-ui/es/constants';
8
- const { token } = THEME || {};
5
+ import { globalToken } from '@antscorp/antsomi-ui/es/constants';
9
6
  export const StyledDrawer = styled(Drawer) `
10
7
  &.antsomi-drawer-content {
11
8
  overflow: visible !important;
@@ -26,7 +23,7 @@ export const StyledDrawer = styled(Drawer) `
26
23
  display: flex;
27
24
  align-items: center;
28
25
  justify-content: center;
29
- color: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.bw8};
26
+ color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8};
30
27
  transition: all 0.3s;
31
28
  z-index: 100;
32
29
  cursor: pointer;
@@ -45,7 +42,7 @@ export const Content = styled.div `
45
42
  export const LeftMenu = styled.div `
46
43
  width: 46px;
47
44
  height: 100%;
48
- background-color: ${token === null || token === void 0 ? void 0 : token.blue1_2};
45
+ background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue1_2};
49
46
  padding: 8px 5px;
50
47
  box-sizing: border-box;
51
48
  display: flex;
@@ -61,7 +58,7 @@ export const CloseBtn = styled.div `
61
58
  display: flex;
62
59
  align-items: center;
63
60
  justify-content: center;
64
- color: ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.bw8};
61
+ color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8};
65
62
  transition: all 0.3s;
66
63
  cursor: pointer;
67
64
 
@@ -72,7 +69,7 @@ export const CloseBtn = styled.div `
72
69
  export const MenuItem = styled.div `
73
70
  height: 36px;
74
71
  width: 36px;
75
- border-radius: ${token === null || token === void 0 ? void 0 : token.borderRadiusXL}px;
72
+ border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadiusXL}px;
76
73
  background-color: transparent;
77
74
  display: flex;
78
75
  align-items: center;
@@ -81,7 +78,7 @@ export const MenuItem = styled.div `
81
78
  transition: all 0.2s;
82
79
 
83
80
  * {
84
- color: ${token === null || token === void 0 ? void 0 : token.bw8};
81
+ color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8};
85
82
  }
86
83
 
87
84
  i {
@@ -91,10 +88,10 @@ export const MenuItem = styled.div `
91
88
  }
92
89
 
93
90
  &:hover {
94
- background-color: ${token === null || token === void 0 ? void 0 : token.bw0};
91
+ background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw0};
95
92
 
96
93
  * {
97
- color: ${token === null || token === void 0 ? void 0 : token.colorPrimary};
94
+ color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorPrimary};
98
95
  }
99
96
  }
100
97
 
@@ -102,7 +99,7 @@ export const MenuItem = styled.div `
102
99
  background-color: #d3e3fd;
103
100
 
104
101
  * {
105
- color: ${token === null || token === void 0 ? void 0 : token.colorPrimary};
102
+ color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorPrimary};
106
103
  }
107
104
  }
108
105
  `;
@@ -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,26 +19,28 @@ 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
+ // urlParams.append('oid', 'ALL_ACCOUNT');
43
+ // urlParams.append('oid', `${currentAccount ?? userId ?? 'ALL_ACCOUNT'}`);
42
44
  const newUrl = `${window.location.pathname}?${urlParams.toString()}${window.location.hash}`;
43
45
  window.history.replaceState(null, '', newUrl);
44
46
  }
@@ -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" },
@@ -8,9 +8,12 @@ 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;
14
17
  // Callbacks
15
18
  const isPushDifferentDomain = useCallback((domain, path) => {
16
19
  var _a, _b, _c, _d, _e, _f;
@@ -33,11 +36,11 @@ export const useNavigatePath = () => {
33
36
  const customPath = ((_a = path === null || path === void 0 ? void 0 : path.split('#')) === null || _a === void 0 ? void 0 : _a[1]) || '';
34
37
  return getGeneratePath(customPath, auth);
35
38
  }
36
- return getGeneratePath(`${path !== null && path !== void 0 ? path : ''}`, auth);
37
- }, [auth, isPushDifferentDomain]);
39
+ return getGeneratePath(`${path !== null && path !== void 0 ? path : ''}${searchParams}`, auth);
40
+ }, [auth, isPushDifferentDomain, searchParams]);
38
41
  const navigatePath = useCallback((domain, path) => {
39
42
  const newDomain = isNil(domain) || env === ENV.DEV ? '' : domain;
40
- window.location.assign(getGeneratePath(`${newDomain}${path}`, auth));
41
- }, [auth, env]);
43
+ window.location.assign(getGeneratePath(`${newDomain}${path}${searchParams}`, auth));
44
+ }, [auth, env, searchParams]);
42
45
  return { isPushDifferentDomain, getPath, navigatePath };
43
46
  };
@@ -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;
@@ -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,17 +23,16 @@ 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
@@ -74,7 +73,7 @@ export const Layout = memo(props => {
74
73
  }, [appCode, env, portalId]);
75
74
  const initialHeaderProps = useMemo(() => {
76
75
  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,
76
+ 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
77
  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
78
  p_timezone: 'Asia/Singapore',
80
79
  api_pid: 33167,
@@ -86,6 +85,8 @@ export const Layout = memo(props => {
86
85
  const mergeHeaderProps = useMemo(() => merge(initialHeaderProps, headerStore), [initialHeaderProps, headerStore]);
87
86
  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
87
  const onActiveMenuCodeChange = useCallback((activeItemPath, flattenPermissionList) => {
88
+ var _a;
89
+ 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
90
  if (isEmpty(activeItemPath)) {
90
91
  setShowAccountSelection(false);
91
92
  return;
@@ -124,7 +125,7 @@ export const Layout = memo(props => {
124
125
  }
125
126
  }
126
127
  setShowAccountSelection(roleScope);
127
- }, []);
128
+ }, [onActiveMenuChange]);
128
129
  return (React.createElement(LayoutWrapper, null,
129
130
  React.createElement(HeaderV2, Object.assign({}, mergeHeaderProps)),
130
131
  React.createElement(Flex, { className: "layout-body" },
@@ -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.225",
3
+ "version": "1.3.5-beta.227",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",