@open-rlb/ng-app 3.0.37 → 3.0.39
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.
|
@@ -546,7 +546,7 @@ class AppsService {
|
|
|
546
546
|
this.selectApp(undefined);
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
|
-
// CASE 1: SINGLE APP REDIRECT
|
|
549
|
+
// CASE 1: SINGLE APP REDIRECT
|
|
550
550
|
// We are in root route and there is only one app available
|
|
551
551
|
if (isRoot && domainApps.length === 1) {
|
|
552
552
|
const singleApp = domainApps[0];
|
|
@@ -565,6 +565,19 @@ class AppsService {
|
|
|
565
565
|
// ====================================================================
|
|
566
566
|
if (isRoot && domainApps.length > 1) {
|
|
567
567
|
this.logger.info(`Root detected with multiple apps (${domainApps.length}). Showing App Hub / Core home page.`);
|
|
568
|
+
const redirectApps = domainApps.filter((app) => app.autoRedirectOnRootEnabled);
|
|
569
|
+
if (redirectApps?.length > 1) {
|
|
570
|
+
this.logger.warn('Multiple apps have autoRedirectOnRootEnabled: true. Picking the first one.', redirectApps);
|
|
571
|
+
}
|
|
572
|
+
if (redirectApps) {
|
|
573
|
+
const targetUrl = redirectApps[0].core?.url;
|
|
574
|
+
this.logger.info(`[AutoRedirect] Detected app with root redirect. Redirecting to: ${targetUrl}`);
|
|
575
|
+
this.router.navigate([targetUrl], {
|
|
576
|
+
queryParams: route.snapshot.queryParams,
|
|
577
|
+
replaceUrl: true
|
|
578
|
+
});
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
568
581
|
this.selectApp(undefined); // Explicit reset chosen app
|
|
569
582
|
return;
|
|
570
583
|
}
|