@antscorp/antsomi-ui 1.9.0 → 1.9.1
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.
- package/es/components/organism/AccountSharing/AccountSharing.js +3 -1
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +2 -2
- package/es/components/organism/LeftMenu/components/common/ChildMenu/index.js +3 -0
- package/es/utils/cookie.d.ts +7 -0
- package/es/utils/cookie.js +8 -0
- package/package.json +1 -1
|
@@ -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) {
|
|
@@ -136,7 +136,7 @@ export function useDataTableListing(props) {
|
|
|
136
136
|
params: mapObject,
|
|
137
137
|
request: restOfApiColumnRequest,
|
|
138
138
|
},
|
|
139
|
-
options: Object.assign({ enabled: enabledApiColumn }, queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.getColumnMetricList),
|
|
139
|
+
options: Object.assign({ enabled: enabledApiColumn, refetchOnMount: 'always' }, queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.getColumnMetricList),
|
|
140
140
|
});
|
|
141
141
|
const getModifyColumnList = useGetModifyColumnList({
|
|
142
142
|
args: {
|
|
@@ -160,7 +160,7 @@ export function useDataTableListing(props) {
|
|
|
160
160
|
params: mapObject,
|
|
161
161
|
request: restOfApiFilterRequest,
|
|
162
162
|
},
|
|
163
|
-
options: Object.assign({ enabled: enabledApiFilter }, queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.getFilterMetricList),
|
|
163
|
+
options: Object.assign({ enabled: enabledApiFilter, refetchOnMount: 'always' }, queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.getFilterMetricList),
|
|
164
164
|
});
|
|
165
165
|
const getInfiniteMatchesAnyList = useGetInfiniteMatchesAnyList({
|
|
166
166
|
args: {
|
|
@@ -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
|
}
|
package/es/utils/cookie.d.ts
CHANGED
|
@@ -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;
|
package/es/utils/cookie.js
CHANGED
|
@@ -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 && {
|