@resolveio/client-lib-core 1.3.4 → 1.3.6

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.
@@ -4835,8 +4835,8 @@ class NavbarModuleComponent extends BaseComponent {
4835
4835
  this.selectedTab = this.menuData.tabs[0];
4836
4836
  }
4837
4837
  else {
4838
- this.selectedTab = null;
4839
4838
  this.currentRoute = this._services._router.url.replace(/\/[a-f0-9]{24}$/, '').replace(/\?.+$/, '');
4839
+ this.selectedTab = null;
4840
4840
  for (let i = 0; i < this.menuData.tabs.length; i++) {
4841
4841
  let tab = this.menuData.tabs[i];
4842
4842
  if (tab.link === this.currentRoute) {
@@ -4844,6 +4844,16 @@ class NavbarModuleComponent extends BaseComponent {
4844
4844
  break;
4845
4845
  }
4846
4846
  }
4847
+ while (!this.selectedTab && this.currentRoute.includes('/')) {
4848
+ this.currentRoute = this.currentRoute.replace(/(\/[^\/]+$)/, '');
4849
+ for (let i = 0; i < this.menuData.tabs.length; i++) {
4850
+ let tab = this.menuData.tabs[i];
4851
+ if (tab.link === this.currentRoute) {
4852
+ this.selectedTab = tab;
4853
+ break;
4854
+ }
4855
+ }
4856
+ }
4847
4857
  }
4848
4858
  }
4849
4859
  }
@@ -5516,7 +5526,7 @@ class AuthGuard {
5516
5526
  if (user.roles.super_admin) {
5517
5527
  resolve(true);
5518
5528
  }
5519
- else if (!user.roles.groups.filter(a => a.views.some(b => b === view && !this.isLinkPartialRoute(b))).length) {
5529
+ else if (!this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b === view)).length) {
5520
5530
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5521
5531
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5522
5532
  this._router.navigateByUrl(link);
@@ -5526,7 +5536,7 @@ class AuthGuard {
5526
5536
  }
5527
5537
  resolve(false);
5528
5538
  }
5529
- else if (!user.roles.groups.filter(a => a.views.some(b => b.startsWith(view) && this.isLinkPartialRoute(b))).length) {
5539
+ else if (this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b.startsWith(view))).length) {
5530
5540
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5531
5541
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5532
5542
  this._router.navigateByUrl(link);
@@ -5540,7 +5550,7 @@ class AuthGuard {
5540
5550
  resolve(true);
5541
5551
  }
5542
5552
  }
5543
- else if (!user.roles.groups.filter(a => a.views.some(b => b === view && !this.isLinkPartialRoute(b))).length) {
5553
+ else if (!this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b === view)).length) {
5544
5554
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5545
5555
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5546
5556
  this._router.navigateByUrl(link);
@@ -5550,7 +5560,7 @@ class AuthGuard {
5550
5560
  }
5551
5561
  resolve(false);
5552
5562
  }
5553
- else if (!user.roles.groups.filter(a => a.views.some(b => b.startsWith(view) && this.isLinkPartialRoute(b))).length) {
5563
+ else if (this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b.startsWith(view))).length) {
5554
5564
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5555
5565
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5556
5566
  this._router.navigateByUrl(link);
@@ -5586,7 +5596,7 @@ class AuthGuard {
5586
5596
  if (user.roles.super_admin) {
5587
5597
  resolve(true);
5588
5598
  }
5589
- else if (!user.roles.groups.filter(a => a.views.some(b => b === view && !this.isLinkPartialRoute(b))).length) {
5599
+ else if (!this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b === view)).length) {
5590
5600
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5591
5601
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5592
5602
  this._router.navigateByUrl(link);
@@ -5596,7 +5606,7 @@ class AuthGuard {
5596
5606
  }
5597
5607
  resolve(false);
5598
5608
  }
5599
- else if (!user.roles.groups.filter(a => a.views.some(b => b.startsWith(view) && this.isLinkPartialRoute(b))).length) {
5609
+ else if (this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b.startsWith(view))).length) {
5600
5610
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5601
5611
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5602
5612
  this._router.navigateByUrl(link);
@@ -5610,7 +5620,7 @@ class AuthGuard {
5610
5620
  resolve(true);
5611
5621
  }
5612
5622
  }
5613
- else if (!user.roles.groups.filter(a => a.views.some(b => b === view && !this.isLinkPartialRoute(b))).length) {
5623
+ else if (!this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b === view)).length) {
5614
5624
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5615
5625
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5616
5626
  this._router.navigateByUrl(link);
@@ -5620,7 +5630,7 @@ class AuthGuard {
5620
5630
  }
5621
5631
  resolve(false);
5622
5632
  }
5623
- else if (!user.roles.groups.filter(a => a.views.some(b => b.startsWith(view) && this.isLinkPartialRoute(b))).length) {
5633
+ else if (this.isLinkPartialRoute(view) && !user.roles.groups.filter(a => a.views.some(b => b.startsWith(view))).length) {
5624
5634
  if (user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b))).length) {
5625
5635
  let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
5626
5636
  this._router.navigateByUrl(link);