@antscorp/antsomi-ui 1.3.5-beta.616 → 1.3.5-beta.618

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.
@@ -19,7 +19,7 @@ import CloseIcon from './icons/close';
19
19
  import SearchIcon from './icons/search';
20
20
  import { InnerCardStyled, InputSearchStyled, PackageSharingStyled, TriggerPopoverStyled, } from './styled';
21
21
  // Utils
22
- import { formatUserId, getObjectPropSafely, removeAppCookieSessionSubdomain, removeAppCookieSessionSubdomainPrefix, } from '@antscorp/antsomi-ui/es/utils';
22
+ import { formatUserId, getObjectPropSafely, removeAppCookieSessionSubdomain, removeAppCookieSessionSubdomainPrefix, setCookieSession, } from '@antscorp/antsomi-ui/es/utils';
23
23
  import { translate } from './utils';
24
24
  import Icon from '@antscorp/icons';
25
25
  import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounceV2';
@@ -481,6 +481,8 @@ export const AccountSharing = props => {
481
481
  }
482
482
  };
483
483
  xhr.send(JSON.stringify(data));
484
+ // Set cookie and session
485
+ setCookieSession({ name: 'api_pid', value: networkIdSelected });
484
486
  });
485
487
  const selectNetwork = network => {
486
488
  if (+networkId === +network.networkId) {
@@ -169,6 +169,9 @@ export const ChildMenu = memo(props => {
169
169
  };
170
170
  const onClickMenuItem = (menuItem) => {
171
171
  const { key, menu_item_domain = '', menu_item_path = '' } = menuItem || {};
172
+ // If menu_item_path is empty then return
173
+ if (!menu_item_path)
174
+ return;
172
175
  if (isPushDifferentDomain(menu_item_domain, menu_item_path)) {
173
176
  return navigatePath(menu_item_domain, menu_item_path);
174
177
  }
@@ -78,7 +78,7 @@ export const OldLeftMenu = memo(props => {
78
78
  React.createElement(Typography.Text, { ellipsis: { tooltip: app_name.toUpperCase() } }, app_name.toUpperCase()))) : (React.createElement(MenuLabel, null,
79
79
  React.createElement(Typography.Text, { ellipsis: { tooltip: menu_name } }, menu_name))),
80
80
  icon: icon ? React.createElement(IconWrapper, { url: icon }) : undefined,
81
- children: childs === null || childs === void 0 ? void 0 : childs.map(item => recursiveGetMenuItem(omit(item, ['childs']), app_code)),
81
+ children: childs === null || childs === void 0 ? void 0 : childs.map(item => item.show_hide ? recursiveGetMenuItem(omit(item, ['childs']), app_code) : null).filter(Boolean),
82
82
  };
83
83
  };
84
84
  const items = ((_a = orderBy(menuListPermission === null || menuListPermission === void 0 ? void 0 : menuListPermission.map(item => (Object.assign(Object.assign({}, item), { app_order: Number(item.app_order) }))), ['app_order'], ['asc'])) === null || _a === void 0 ? void 0 : _a.map(item => recursiveGetMenuItem(item))) || [];
@@ -4,6 +4,13 @@ interface RemoveCookieSubDomain {
4
4
  env?: TEnv;
5
5
  cookieOptions?: Record<string, any>;
6
6
  }
7
+ interface SetCookieSession {
8
+ name: string;
9
+ value: any;
10
+ env?: TEnv;
11
+ cookieOptions?: Record<string, any>;
12
+ }
13
+ export declare const setCookieSession: ({ name, value, cookieOptions }: SetCookieSession) => void;
7
14
  export declare const removeCookieSubDomain: ({ name, env, cookieOptions, }: RemoveCookieSubDomain) => void;
8
15
  export declare const removeAppCookieSessionSubdomain: (args: RemoveCookieSubDomain) => void;
9
16
  export declare const removeAppCookieSession: (args: RemoveCookieSubDomain) => void;
@@ -6,6 +6,14 @@ const cookies = new Cookies(null, {
6
6
  sameSite: 'none',
7
7
  secure: true,
8
8
  });
9
+ // Handle cookie
10
+ export const setCookieSession = ({ name, value, cookieOptions }) => {
11
+ cookies.set(name, value, Object.assign({}, cookieOptions));
12
+ if (typeof Storage !== undefined) {
13
+ sessionStorage.setItem(name, name);
14
+ }
15
+ };
16
+ // Handle cookie with subdomain
9
17
  export const removeCookieSubDomain = ({ name, env = 'development', cookieOptions, }) => {
10
18
  const arrTmp = location.hostname.split('.');
11
19
  cookies.remove(name, Object.assign(Object.assign(Object.assign({}, (env !== ENV.DEV && {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.616",
3
+ "version": "1.3.5-beta.618",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",