@c8y/ngx-components 1023.22.2 → 1023.22.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.
@@ -9390,10 +9390,11 @@ const operationStatusClasses = {
9390
9390
 
9391
9391
  /** The helper UI service for tenant related methods built upon client services. */
9392
9392
  class TenantUiService {
9393
- constructor(userService, appStateService, tenantLoginOption) {
9393
+ constructor(userService, appStateService, tenantLoginOption, options) {
9394
9394
  this.userService = userService;
9395
9395
  this.appStateService = appStateService;
9396
9396
  this.tenantLoginOption = tenantLoginOption;
9397
+ this.options = options;
9397
9398
  this.MANAGEMENT = 'management';
9398
9399
  this.ROLE_TENANT_MANAGEMENT_READ = Permissions.ROLE_TENANT_MANAGEMENT_READ;
9399
9400
  }
@@ -9490,11 +9491,22 @@ class TenantUiService {
9490
9491
  return defaultFallback;
9491
9492
  }
9492
9493
  else {
9493
- const visibleLoginOptions = loginOptions.filter(this.isVisibleOnLoginPage);
9494
- return (visibleLoginOptions.find(this.isOauthInternal) ||
9494
+ let visibleLoginOptions = loginOptions.filter(this.isVisibleOnLoginPage);
9495
+ // should ignore the OAUTH2 option if skipSSORedirect is set
9496
+ if (this.options.get('skipSSORedirect', false)) {
9497
+ visibleLoginOptions = visibleLoginOptions.filter(lo => lo.type !== TenantLoginOptionType.OAUTH2);
9498
+ // in case there is no other visible option, we fallback to all options except OAUTH2
9499
+ if (visibleLoginOptions.length === 0) {
9500
+ visibleLoginOptions = loginOptions.filter(lo => lo.type !== TenantLoginOptionType.OAUTH2);
9501
+ }
9502
+ }
9503
+ const preferredLoginOption = visibleLoginOptions.find(this.isOauthInternal) ||
9495
9504
  visibleLoginOptions.find(this.isBasic) ||
9496
9505
  visibleLoginOptions.find(this.isOauth2) ||
9497
- defaultFallback);
9506
+ defaultFallback;
9507
+ // ensure the returned login option is marked as visible on login page
9508
+ preferredLoginOption.visibleOnLoginPage = true;
9509
+ return preferredLoginOption;
9498
9510
  }
9499
9511
  }
9500
9512
  /**
@@ -9634,13 +9646,13 @@ class TenantUiService {
9634
9646
  isManagement(currentTenant) {
9635
9647
  return currentTenant.name === this.MANAGEMENT;
9636
9648
  }
9637
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TenantUiService, deps: [{ token: i1.UserService }, { token: AppStateService }, { token: i1.TenantLoginOptionsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
9649
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TenantUiService, deps: [{ token: i1.UserService }, { token: AppStateService }, { token: i1.TenantLoginOptionsService }, { token: OptionsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
9638
9650
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TenantUiService, providedIn: 'root' }); }
9639
9651
  }
9640
9652
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TenantUiService, decorators: [{
9641
9653
  type: Injectable,
9642
9654
  args: [{ providedIn: 'root' }]
9643
- }], ctorParameters: () => [{ type: i1.UserService }, { type: AppStateService }, { type: i1.TenantLoginOptionsService }] });
9655
+ }], ctorParameters: () => [{ type: i1.UserService }, { type: AppStateService }, { type: i1.TenantLoginOptionsService }, { type: OptionsService }] });
9644
9656
 
9645
9657
  class ZipService {
9646
9658
  getEntries(zipFile) {