@antscorp/antsomi-ui 1.3.5-beta.274 → 1.3.5-beta.275
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/atoms/Input/Input.js +1 -0
- package/es/components/molecules/AccountSelection/AccountListing.d.ts +1 -0
- package/es/components/molecules/AccountSelection/AccountListing.js +2 -2
- package/es/components/molecules/HeaderV2/HeaderV2.d.ts +1 -0
- package/es/components/molecules/HeaderV2/HeaderV2.js +6 -3
- package/es/components/molecules/index.d.ts +1 -1
- package/es/components/molecules/index.js +1 -1
- package/es/components/template/Layout/Layout.js +3 -1
- package/es/constants/api.js +11 -1
- package/es/constants/variables.d.ts +1 -0
- package/es/constants/variables.js +1 -0
- package/es/providers/AppConfigProvider/contexts/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { searchStringQuery } from '@antscorp/antsomi-ui/es/utils';
|
|
|
8
8
|
import { useGetAccountList, useGetPermissionAccountList, useGetRecentAccount } from '../../..';
|
|
9
9
|
export const AccountListing = props => {
|
|
10
10
|
const { className, apiConfig, showAllAccount = true, currentAccount = '', onChange } = props;
|
|
11
|
-
const { domain, token, userId, appCode, portalId } = apiConfig;
|
|
11
|
+
const { domain, token, userId, appCode, menuCode, portalId } = apiConfig;
|
|
12
12
|
// States
|
|
13
13
|
const [searchValue, setSearchValue] = useState('');
|
|
14
14
|
// Queries
|
|
@@ -27,7 +27,7 @@ export const AccountListing = props => {
|
|
|
27
27
|
domain,
|
|
28
28
|
appCode: appCode || '',
|
|
29
29
|
fullParent: true,
|
|
30
|
-
menuCode: appCode || '',
|
|
30
|
+
menuCode: menuCode || appCode || '',
|
|
31
31
|
},
|
|
32
32
|
options: {
|
|
33
33
|
enabled: portalId === PORTALS_IDS.SANDBOX_76753,
|
|
@@ -20,15 +20,16 @@ import { AccountSharing, Help, Notification, } from '../../organism';
|
|
|
20
20
|
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';
|
|
21
21
|
import { useContextSelector } from 'use-context-selector';
|
|
22
22
|
import { AppConfigContext } from '../../..';
|
|
23
|
+
const { DATAFLOWS, APP_ANTALYSER } = APP_CODES;
|
|
23
24
|
export const HeaderV2 = memo(props => {
|
|
24
25
|
var _a, _b;
|
|
25
|
-
const { auth, env: envContext, languageCode = 'en', appCode, urlLogout: urlLogoutProvider = '', } = useContextSelector(AppConfigContext, state => state);
|
|
26
|
+
const { auth, env: envContext, languageCode = 'en', appCode: contextAppCode, urlLogout: urlLogoutProvider = '', menuCode: contextMenuCode, } = useContextSelector(AppConfigContext, state => state);
|
|
26
27
|
const { search } = useLocation();
|
|
27
28
|
const history = useHistory();
|
|
28
29
|
/** Prefer to use Header in AppConfigContext */
|
|
29
30
|
const { className, style, pageTitle = '', accountSelection = {}, helpConfig, notificationConfig = {}, accountSharingConfig, useURLParam, config, } = props;
|
|
30
31
|
/** General config for children component */
|
|
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 || {};
|
|
32
|
+
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, appCode = contextAppCode, menuCode = contextMenuCode, } = config || {};
|
|
32
33
|
const { currentAccount, inputStyle = 'select', onSelectAccount } = accountSelection, accountSelectionProps = __rest(accountSelection, ["currentAccount", "inputStyle", "onSelectAccount"]);
|
|
33
34
|
const urlParams = useMemo(() => new URLSearchParams(search), [search]);
|
|
34
35
|
const oidParam = (_a = urlParams.get('oid')) !== null && _a !== void 0 ? _a : '';
|
|
@@ -40,7 +41,8 @@ export const HeaderV2 = memo(props => {
|
|
|
40
41
|
if (portalId !== PORTALS_IDS.SANDBOX_76753)
|
|
41
42
|
return CDP_API[env || 'development'];
|
|
42
43
|
switch (appCode) {
|
|
43
|
-
case
|
|
44
|
+
case DATAFLOWS:
|
|
45
|
+
case APP_ANTALYSER:
|
|
44
46
|
return (_a = APP_PERMISSION_DOMAIN[appCode || '']) === null || _a === void 0 ? void 0 : _a[env || ''];
|
|
45
47
|
default:
|
|
46
48
|
return CDP_API[env || 'development'];
|
|
@@ -58,6 +60,7 @@ export const HeaderV2 = memo(props => {
|
|
|
58
60
|
portalId,
|
|
59
61
|
token,
|
|
60
62
|
appCode,
|
|
63
|
+
menuCode,
|
|
61
64
|
};
|
|
62
65
|
const helpConfigProps = Object.assign(Object.assign({}, configs), { portalId: portalId.toString(), userId: userId.toString(), token, domain: CDP_API[env], domainTicket: ISSUE_API[env], domainPlatform: PLATFORM_API, config: Object.assign(Object.assign({}, configs.config), { user_language: language }) });
|
|
63
66
|
const notificationConfigProps = {
|
|
@@ -46,7 +46,7 @@ export * from './SelectMulti';
|
|
|
46
46
|
export * from './SelectEventAttribute';
|
|
47
47
|
export * from './DatePickerV2';
|
|
48
48
|
export { ModalSelect } from './ModalSelect';
|
|
49
|
-
export
|
|
49
|
+
export * from './EmptyData';
|
|
50
50
|
export * from './PreviewModal';
|
|
51
51
|
export * from './Drawer';
|
|
52
52
|
export * from './DrawerDetail';
|
|
@@ -46,7 +46,7 @@ export * from './SelectMulti';
|
|
|
46
46
|
export * from './SelectEventAttribute';
|
|
47
47
|
export * from './DatePickerV2';
|
|
48
48
|
export { ModalSelect } from './ModalSelect';
|
|
49
|
-
export
|
|
49
|
+
export * from './EmptyData';
|
|
50
50
|
export * from './PreviewModal';
|
|
51
51
|
export * from './Drawer';
|
|
52
52
|
export * from './DrawerDetail';
|
|
@@ -30,7 +30,7 @@ import '@antscorp/processing-notification/dist/index.css';
|
|
|
30
30
|
import { useLayoutStore } from './stores';
|
|
31
31
|
// Utils
|
|
32
32
|
import { checkingRoleScope } from './utils';
|
|
33
|
-
const { DATAFLOWS } = APP_CODES;
|
|
33
|
+
const { DATAFLOWS, APP_ANTALYSER } = APP_CODES;
|
|
34
34
|
export const Layout = memo(props => {
|
|
35
35
|
const { leftMenuProps, headerProps = {}, workspaceProps, processingNotificationProps, children, onActiveMenuChange, } = props;
|
|
36
36
|
const _a = leftMenuProps || {}, { className = '' } = _a, restOfLeftMenuProps = __rest(_a, ["className"]);
|
|
@@ -52,6 +52,7 @@ export const Layout = memo(props => {
|
|
|
52
52
|
return PERMISSION_API;
|
|
53
53
|
switch (appCode) {
|
|
54
54
|
case DATAFLOWS:
|
|
55
|
+
case APP_ANTALYSER:
|
|
55
56
|
return ((_a = APP_PERMISSION_DOMAIN[appCode]) === null || _a === void 0 ? void 0 : _a[env || 'development']) || PERMISSION_API;
|
|
56
57
|
default:
|
|
57
58
|
return PERMISSION_API;
|
|
@@ -67,6 +68,7 @@ export const Layout = memo(props => {
|
|
|
67
68
|
return IAM_API;
|
|
68
69
|
switch (appCode) {
|
|
69
70
|
case DATAFLOWS:
|
|
71
|
+
case APP_ANTALYSER:
|
|
70
72
|
return ((_a = APP_IAM_DOMAIN[appCode]) === null || _a === void 0 ? void 0 : _a[env || 'development']) || IAM_API;
|
|
71
73
|
default:
|
|
72
74
|
return IAM_API;
|
package/es/constants/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Constants
|
|
2
2
|
import { ENV } from '../config';
|
|
3
3
|
import { APP_CODES } from './variables';
|
|
4
|
-
const { DATAFLOWS } = APP_CODES;
|
|
4
|
+
const { DATAFLOWS, APP_ANTALYSER } = APP_CODES;
|
|
5
5
|
export const TINYMCE_API_KEY = 'scyw71pj8619analvxs56ppc2w2fj2kpy5vnmflhhc300y35';
|
|
6
6
|
export const CDP_API = {
|
|
7
7
|
[ENV.DEV]: 'https://sandbox-app.cdp.asia',
|
|
@@ -23,6 +23,11 @@ export const APP_PERMISSION_DOMAIN = {
|
|
|
23
23
|
[ENV.SANDBOX]: 'https://sandbox-permission.ants.vn',
|
|
24
24
|
[ENV.PROD]: 'https://permission.antsomi.com',
|
|
25
25
|
},
|
|
26
|
+
[APP_ANTALYSER]: {
|
|
27
|
+
[ENV.DEV]: 'https://sandbox-permission.ants.vn',
|
|
28
|
+
[ENV.SANDBOX]: 'https://sandbox-permission.ants.vn',
|
|
29
|
+
[ENV.PROD]: 'https://permission.antsomi.com',
|
|
30
|
+
},
|
|
26
31
|
};
|
|
27
32
|
export const APP_IAM_DOMAIN = {
|
|
28
33
|
[DATAFLOWS]: {
|
|
@@ -30,4 +35,9 @@ export const APP_IAM_DOMAIN = {
|
|
|
30
35
|
[ENV.SANDBOX]: 'https://sandbox-aacm.ants.vn',
|
|
31
36
|
[ENV.PROD]: 'https://iam.ants.tech',
|
|
32
37
|
},
|
|
38
|
+
[APP_ANTALYSER]: {
|
|
39
|
+
[ENV.DEV]: 'https://sandbox-aacm.ants.vn',
|
|
40
|
+
[ENV.SANDBOX]: 'https://sandbox-aacm.ants.vn',
|
|
41
|
+
[ENV.PROD]: 'https://iam.ants.tech',
|
|
42
|
+
},
|
|
33
43
|
};
|