@antscorp/antsomi-ui 1.3.5-beta.923 → 1.3.5-beta.924

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.
@@ -26,7 +26,11 @@ export const HeaderV2 = memo(props => {
26
26
  // * Prefer to use Header in AppConfigContext
27
27
  const { show = true, className, style, breadcrumbs, showLogo = false, rightContent, pageTitle = '', accountSelection = {}, helpConfig, notificationConfig = {}, accountSharingConfig, useURLParam, config, onCLickLogo, } = props;
28
28
  /** General config for children component */
29
- const { env = envContext, language = languageCode, userId = isNaN(Number(auth?.userId)) ? 0 : Number(auth?.userId), portalId = auth?.portalId, token = auth?.token, permissionDomain = PERMISSION_API, iamDomain = IAM_API, appCode = contextAppCode, menuCode = contextMenuCode, } = config || {};
29
+ const { env = envContext, language = languageCode,
30
+ // NOTE: Just hot fix for change userId to accountId
31
+ userId = isNaN(Number(auth?.accountId || auth?.userId))
32
+ ? 0
33
+ : Number(auth?.accountId || auth?.userId), portalId = auth?.portalId, token = auth?.token, permissionDomain = PERMISSION_API, iamDomain = IAM_API, appCode = contextAppCode, menuCode = contextMenuCode, } = config || {};
30
34
  const { currentAccount, inputStyle = 'select', onSelectAccount, ...accountSelectionProps } = accountSelection;
31
35
  const urlParams = useMemo(() => new URLSearchParams(search), [search]);
32
36
  const oidParam = urlParams.get('oid') || currentAccount || 'all';
@@ -253,10 +253,10 @@ export const Layout = memo(props => {
253
253
  useDeepCompareEffect(() => {
254
254
  const { userId: userIdParam } = (params || {});
255
255
  console.log('🚀 ~ useDeepCompareEffect ~ userId:', userIdParam, userId);
256
- if (userIdParam && userId && +userIdParam !== +userId && location.pathname) {
257
- replace(`${location.pathname.replace(userIdParam, `${userId}`)}${location.search}`);
256
+ if (userIdParam && accountId && +userIdParam !== +accountId && location.pathname) {
257
+ replace(`${location.pathname.replace(userIdParam, `${accountId}`)}${location.search}`);
258
258
  }
259
- }, [params, location.pathname, userId, replace]);
259
+ }, [params, location.pathname, accountId, replace]);
260
260
  /** If left menu props has customization then set layout loading to false, because we don't need check permission here */
261
261
  useDeepCompareEffect(() => {
262
262
  if (mergeLeftMenuProps.customization) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.923",
3
+ "version": "1.3.5-beta.924",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",