@antscorp/antsomi-ui 1.3.5-beta.368 → 1.3.5-beta.369

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.
@@ -1,26 +1,6 @@
1
1
  :root {
2
2
  --primary-color: #005fb8;
3
3
  --text-base-color: #222222;
4
-
5
- --border-primary: #005eb8;
6
- --border-normal: #b8cfe6;
7
- --border-hover: #81bcf4;
8
- --border-active: #005eb8;
9
- --border-disable: #d4d4d4;
10
-
11
- --divider-1: #e5e5e5;
12
- --divider-2: #d4d4d4;
13
- --divider-3: #bebebe;
14
4
  }
15
5
 
16
- *,
17
- *:before,
18
- *:after {
19
- -webkit-box-sizing: border-box;
20
- -moz-box-sizing: border-box;
21
- box-sizing: border-box;
22
- }
23
6
 
24
- .rc-virtual-list-scrollbar {
25
- width: 4px !important;
26
- }
@@ -28,6 +28,9 @@ export const usePermission = () => {
28
28
  type: 'menu-item-permission',
29
29
  },
30
30
  },
31
+ options: {
32
+ enabled: !!(auth === null || auth === void 0 ? void 0 : auth.userId) && !!auth.portalId,
33
+ },
31
34
  });
32
35
  const { data: dashboardData, refetch: refetchDashboard } = useGetDashboard({
33
36
  args: {
@@ -35,7 +35,7 @@ export const Layout = memo(props => {
35
35
  const { leftMenuProps, headerProps = {}, workspaceProps, contentWrapperProps, processingNotificationProps, children, onActiveMenuChange, } = props;
36
36
  const _a = workspaceProps || {}, { workspaceContentProps } = _a, restOfWorkspaceProps = __rest(_a, ["workspaceContentProps"]);
37
37
  const appConfig = useContextSelector(AppConfigContext, state => state);
38
- const { auth, languageCode, appCode, permissionDomain: configPermissionDomain, env } = appConfig;
38
+ const { auth, languageCode, appCode, permissionDomain: configPermissionDomain, iamDomain: configIamDomain, env, } = appConfig;
39
39
  const { token, userId, portalId } = auth || {};
40
40
  const leftMenu = useLayoutStore(store => store.state.leftMenu);
41
41
  const header = useLayoutStore(store => store.state.header);
@@ -84,6 +84,8 @@ export const Layout = memo(props => {
84
84
  }, [appCode, configPermissionDomain, env, portalId]);
85
85
  const iamDomain = useMemo(() => {
86
86
  var _a;
87
+ if (configIamDomain)
88
+ return configIamDomain;
87
89
  /**
88
90
  * Check if appCode not exist and portalId is SANDBOX
89
91
  * then return production iam api
@@ -107,7 +109,7 @@ export const Layout = memo(props => {
107
109
  p_f_longdatetime: "dd MMMM 'at' HH:mm:ss",
108
110
  embeddedData: {},
109
111
  INSIGHT_U_OGS: 'uogs',
110
- } }) }), 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 }) }));
112
+ } }) }), accountSharingConfig: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSharingConfig), { u_ogs: 'uogs', appCode: 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 }) }));
111
113
  }, [headerProps, iamDomain, permissionDomain, showAccountSelection]);
112
114
  const mergeHeaderProps = useDeepCompareMemo(() => merge(cloneDeep(initialHeaderProps), header), [initialHeaderProps, header]);
113
115
  const _b = useDeepCompareMemo(() => merge(cloneDeep(contentWrapperProps), cloneDeep(contentWrapper)), [contentWrapperProps, contentWrapper]), { noPadding } = _b, mergeContentWrapperProps = __rest(_b, ["noPadding"]);
@@ -10,6 +10,7 @@ export interface AppConfigProps {
10
10
  urlLogout?: string;
11
11
  /** Domain */
12
12
  permissionDomain?: string;
13
+ iamDomain?: string;
13
14
  setAppConfig: React.Dispatch<React.SetStateAction<AppConfigProviderProps>>;
14
15
  }
15
16
  export interface AppConfigProviderProps extends Omit<AppConfigProps, 'setAppConfig'> {
@@ -9,12 +9,30 @@ import { fas } from '@fortawesome/free-solid-svg-icons';
9
9
  import { far } from '@fortawesome/free-regular-svg-icons';
10
10
  import { fab } from '@fortawesome/free-brands-svg-icons';
11
11
  library.add(fas, far, fab);
12
- const { accent6, accent7, gray5, scrollBarSize } = THEME.token || {};
12
+ const { accent6, accent7, gray5, scrollBarSize, bw3, bw4, bw5 } = THEME.token || {};
13
13
  export const GlobalStyle = () => {
14
14
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39;
15
15
  return (React.createElement(Global, { styles: css `
16
16
  @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap');
17
17
 
18
+ :root {
19
+ --divider-1: ${bw3};
20
+ --divider-2: ${bw4};
21
+ --divider-3: ${bw5};
22
+ }
23
+
24
+ *,
25
+ *:before,
26
+ *:after {
27
+ -webkit-box-sizing: border-box;
28
+ -moz-box-sizing: border-box;
29
+ box-sizing: border-box;
30
+ }
31
+
32
+ .rc-virtual-list-scrollbar {
33
+ width: 4px !important;
34
+ }
35
+
18
36
  /* Custom */
19
37
  .antsomi-scrollbar-hidden {
20
38
  -ms-overflow-style: none; /* for Internet Explorer, Edge */
@@ -25,12 +25,13 @@ export const useUpdateTask = () => {
25
25
  };
26
26
  export const useGetListMenu = (params) => {
27
27
  const { options, args } = params;
28
- return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_LIST_MENU, args.params, args.auth], queryFn: () => getListMenu(params.args), onSuccess() { } }, options));
28
+ const { auth } = args || {};
29
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_LIST_MENU, args.params, args.auth], queryFn: () => getListMenu(params.args), onSuccess() { }, enabled: !!(auth === null || auth === void 0 ? void 0 : auth.token) && !!auth.portalId && !!(auth === null || auth === void 0 ? void 0 : auth.userId) }, options));
29
30
  };
30
31
  export const useGetListMenuPermission = (params) => {
31
32
  const { options, args } = params;
32
33
  const { token, accountId, userId } = args.auth;
33
- return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_LIST_MENU_PERMISSION, args.params, token, accountId, userId], queryFn: () => getListMenuPermission(params.args), onSuccess() { } }, options));
34
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_LIST_MENU_PERMISSION, args.params, token, accountId, userId], queryFn: () => getListMenuPermission(params.args), onSuccess() { }, enabled: !!token && !!userId }, options));
34
35
  };
35
36
  export const useGetDestinationChannel = (params) => {
36
37
  const { options, args } = params;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.368",
3
+ "version": "1.3.5-beta.369",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",