@antscorp/antsomi-ui 1.3.5-beta.612 → 1.3.5-beta.614

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.
@@ -157,7 +157,7 @@ export const AccountSharing = props => {
157
157
  });
158
158
  return arrMenus;
159
159
  };
160
- const checkRedirectHomePage = (homePage, data, userId) => {
160
+ const checkRedirectHomePage = (homePage, data, userId, newNetworkId) => {
161
161
  const convertedHomePage = String(homePage).replace(/:user_id/g, userId);
162
162
  if (!Array.isArray(data) || !data.length) {
163
163
  window.location.href = convertedHomePage;
@@ -167,14 +167,14 @@ export const AccountSharing = props => {
167
167
  if (!arrMenus.some(url => convertedHomePage.includes(url))) {
168
168
  // Redirect to recommendation
169
169
  if (env !== ENV.DEV) {
170
- window.location.assign(`${CDP_ROUTE[env || 'development']}/gen2/${networkId}/dashboard/recommendation`);
170
+ window.location.assign(`${CDP_ROUTE[env || 'development']}/gen2/${newNetworkId}/dashboard/recommendation`);
171
171
  return;
172
172
  }
173
173
  // return redirectFirstMenu(data, userId);
174
174
  }
175
175
  window.location.href = convertedHomePage;
176
176
  };
177
- const getAppsMenus = ({ token, userId, accountId, homePage }) => {
177
+ const getAppsMenus = ({ token, userId, accountId, homePage, newNetworkId }) => {
178
178
  if (permissionDomain && token && userId && accountId) {
179
179
  const apiUrl = permissionDomain + (usePrivilege ? '/api/privilege/index' : '/api/permission/index');
180
180
  return axios({
@@ -190,7 +190,7 @@ export const AccountSharing = props => {
190
190
  },
191
191
  }).then(res => {
192
192
  if (res && res.data) {
193
- checkRedirectHomePage(homePage, res.data.data, userId);
193
+ checkRedirectHomePage(homePage, res.data.data, userId, newNetworkId);
194
194
  }
195
195
  });
196
196
  }
@@ -428,6 +428,7 @@ export const AccountSharing = props => {
428
428
  userId: accountId,
429
429
  accountId,
430
430
  homePage: selectedNetworkRef.current.homePage,
431
+ newNetworkId: selectedNetworkRef.current.networkId,
431
432
  });
432
433
  // window.location.href = selectedNetworkRef.current.homePage.replaceAll(':user_id', accountId);
433
434
  }
@@ -51,7 +51,7 @@ export const usePermission = () => {
51
51
  portalId: auth === null || auth === void 0 ? void 0 : auth.portalId,
52
52
  token: auth === null || auth === void 0 ? void 0 : auth.token,
53
53
  languageCode,
54
- domain: 'https://sandbox-app.cdp.asia',
54
+ domain: CDP_API === null || CDP_API === void 0 ? void 0 : CDP_API[env],
55
55
  },
56
56
  });
57
57
  const { data: dashboardData, refetch: refetchDashboard } = useGetDashboard({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.612",
3
+ "version": "1.3.5-beta.614",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",