@antscorp/antsomi-ui 1.3.5-beta.611 → 1.3.5-beta.613
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;
|
|
@@ -165,11 +165,16 @@ export const AccountSharing = props => {
|
|
|
165
165
|
}
|
|
166
166
|
const arrMenus = buildListAppMenus(data, userId);
|
|
167
167
|
if (!arrMenus.some(url => convertedHomePage.includes(url))) {
|
|
168
|
-
|
|
168
|
+
// Redirect to recommendation
|
|
169
|
+
if (env !== ENV.DEV) {
|
|
170
|
+
window.location.assign(`${CDP_ROUTE[env || 'development']}/gen2/${newNetworkId}/dashboard/recommendation`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
// return redirectFirstMenu(data, userId);
|
|
169
174
|
}
|
|
170
175
|
window.location.href = convertedHomePage;
|
|
171
176
|
};
|
|
172
|
-
const getAppsMenus = ({ token, userId, accountId, homePage }) => {
|
|
177
|
+
const getAppsMenus = ({ token, userId, accountId, homePage, newNetworkId }) => {
|
|
173
178
|
if (permissionDomain && token && userId && accountId) {
|
|
174
179
|
const apiUrl = permissionDomain + (usePrivilege ? '/api/privilege/index' : '/api/permission/index');
|
|
175
180
|
return axios({
|
|
@@ -185,7 +190,7 @@ export const AccountSharing = props => {
|
|
|
185
190
|
},
|
|
186
191
|
}).then(res => {
|
|
187
192
|
if (res && res.data) {
|
|
188
|
-
checkRedirectHomePage(homePage, res.data.data, userId);
|
|
193
|
+
checkRedirectHomePage(homePage, res.data.data, userId, newNetworkId);
|
|
189
194
|
}
|
|
190
195
|
});
|
|
191
196
|
}
|
|
@@ -423,6 +428,7 @@ export const AccountSharing = props => {
|
|
|
423
428
|
userId: accountId,
|
|
424
429
|
accountId,
|
|
425
430
|
homePage: selectedNetworkRef.current.homePage,
|
|
431
|
+
newNetworkId: selectedNetworkRef.current.networkId,
|
|
426
432
|
});
|
|
427
433
|
// window.location.href = selectedNetworkRef.current.homePage.replaceAll(':user_id', accountId);
|
|
428
434
|
}
|