@open-rlb/ng-app 3.1.48 → 3.1.49

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.
@@ -563,7 +563,7 @@ class AppsService {
563
563
  return null;
564
564
  return {
565
565
  busId: app.data[this.confAcl.businessIdKey],
566
- resId: app.data[this.confAcl.resourceIdKey]
566
+ resId: app.data[this.confAcl.resourceIdKey],
567
567
  };
568
568
  }
569
569
  get currentApp() {
@@ -592,7 +592,7 @@ class AppsService {
592
592
  this.store.dispatch(AppContextActions.setCurrentApp({ app, mode: viewMode, url }));
593
593
  }
594
594
  initAuthProviders(store, confAuth) {
595
- const currentProviderInStore = this.store.selectSignal((state) => state[authsFeatureKey].currentProvider)();
595
+ const currentProviderInStore = this.store.selectSignal(state => state[authsFeatureKey].currentProvider)();
596
596
  if (currentProviderInStore) {
597
597
  this.logger.info(`Auth provider already set to '${currentProviderInStore}' by Initializer. AppsService initAuthProviders skipping init.`);
598
598
  return;
@@ -637,14 +637,17 @@ class AppsService {
637
637
  routes: app.routes || [],
638
638
  viewMode: app.viewMode,
639
639
  enabled: app.enabled,
640
- core: app.core
640
+ core: app.core,
641
641
  }));
642
642
  let appRoutesMatched = [];
643
643
  if (configPath && !this.isDefaultRoute(configPath)) {
644
- appRoutesMatched = appRoutes?.filter(app => app.routes?.some(r => r.includes(configPath))) ?? [];
644
+ appRoutesMatched =
645
+ appRoutes?.filter(app => app.routes?.some(r => r.includes(configPath))) ?? [];
645
646
  }
646
647
  this.logger.info('Matched appRoute:', appRoutesMatched);
647
- return this.store.select(state => state[appContextFeatureKey].apps).pipe(
648
+ return this.store
649
+ .select(state => state[appContextFeatureKey].apps)
650
+ .pipe(
648
651
  // waiting for all "finalizeApp" dispatches
649
652
  filter(apps => {
650
653
  if (!apps || apps.length === 0)
@@ -660,7 +663,7 @@ class AppsService {
660
663
  route,
661
664
  appsConfig: appRoutesMatched,
662
665
  apps,
663
- fullPath: actualPath
666
+ fullPath: actualPath,
664
667
  };
665
668
  }
666
669
  return null;
@@ -683,7 +686,7 @@ class AppsService {
683
686
  return;
684
687
  }
685
688
  // Filter by domain
686
- const domainApps = data.apps.filter(app => !app.domains || app.domains?.some((domain) => domain.includes(this.currentDomain)));
689
+ const domainApps = data.apps.filter(app => !app.domains || app.domains?.some(domain => domain.includes(this.currentDomain)));
687
690
  if (domainApps.length === 0) {
688
691
  this.logger.warn(`No apps allowed for domain: ${this.currentDomain}`);
689
692
  this.selectApp(undefined);
@@ -698,7 +701,7 @@ class AppsService {
698
701
  this.logger.info(`[AutoRedirect] Single app detected at root. Redirecting to: ${targetUrl}`);
699
702
  this.router.navigate([targetUrl], {
700
703
  queryParams: route.snapshot.queryParams,
701
- replaceUrl: true
704
+ replaceUrl: true,
702
705
  });
703
706
  return;
704
707
  }
@@ -708,7 +711,7 @@ class AppsService {
708
711
  // ====================================================================
709
712
  if (isRoot && domainApps.length > 1) {
710
713
  this.logger.info(`Root detected with multiple apps (${domainApps.length}). Showing App Hub / Core home page.`);
711
- const redirectApps = domainApps.filter((app) => app.autoRedirectOnRootEnabled);
714
+ const redirectApps = domainApps.filter(app => app.autoRedirectOnRootEnabled);
712
715
  if (redirectApps?.length > 1) {
713
716
  this.logger.warn('Multiple apps have autoRedirectOnRootEnabled: true. Picking the first one.', redirectApps);
714
717
  }
@@ -717,7 +720,7 @@ class AppsService {
717
720
  this.logger.info(`[AutoRedirect] Detected app with root redirect. Redirecting to: ${targetUrl}`);
718
721
  this.router.navigate([targetUrl], {
719
722
  queryParams: route.snapshot.queryParams,
720
- replaceUrl: true
723
+ replaceUrl: true,
721
724
  });
722
725
  return;
723
726
  }
@@ -726,8 +729,15 @@ class AppsService {
726
729
  }
727
730
  // CASE 3: Standard logic to get app (Deep linking) ---
728
731
  // Here we go only if route not empty !="" and not root !="/"
729
- const matchedApps = domainApps.filter(app => app.routes?.some(r => r.includes(route.routeConfig?.path)) ||
730
- app.core?.url === '/' + route.routeConfig?.path);
732
+ const configPath = this.getConfigPath(route);
733
+ const matchedApps = domainApps.filter(app => {
734
+ if (!configPath || configPath === '') {
735
+ return false;
736
+ }
737
+ const hasRouteMatch = app.routes?.some(r => r.includes(configPath) || configPath.includes(r));
738
+ const hasCoreMatch = app.core?.url === '/' + configPath || app.core?.url?.includes(configPath);
739
+ return hasRouteMatch || hasCoreMatch;
740
+ });
731
741
  let appToSelect;
732
742
  if (matchedApps.length === 1) {
733
743
  appToSelect = matchedApps[0];
@@ -767,8 +777,7 @@ class AppsService {
767
777
  return route.routeConfig?.path?.includes('settings') ?? false;
768
778
  }
769
779
  isDefaultRoute(route) {
770
- return DEFAULT_ROUTES_CONFIG
771
- .some(r => r.path.includes(route));
780
+ return DEFAULT_ROUTES_CONFIG.some(r => r.path.includes(route));
772
781
  }
773
782
  getConfigPath(route) {
774
783
  const segments = [];
@@ -799,7 +808,7 @@ class AppsService {
799
808
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppsService, decorators: [{
800
809
  type: Injectable,
801
810
  args: [{
802
- providedIn: 'root'
811
+ providedIn: 'root',
803
812
  }]
804
813
  }], ctorParameters: () => [{ type: i1$1.Store }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: AppLoggerService }, { type: undefined, decorators: [{
805
814
  type: Inject,