fix: login v2 console feature toggle allow empty base uri (#11428)

# Which Problems Are Solved
The hosted login v2 required the base uri to be empty in the consoles
feature settings. The console however has a validator that checks if the
field is set to something.

# How the Problems Are Solved
Remove the required validator from the field.

# Additional Changes
Refactored the cnsl-login-v2-feature-toggle component to use the new
angular if statements.

# Additional Context
- Closes #11417
This commit is contained in:
Ramon
2026-02-11 08:32:56 +00:00
committed by GitHub
parent e545d7c5b1
commit 5dab2ba658
2 changed files with 32 additions and 31 deletions
@@ -1,16 +1,16 @@
@if (toggleState$ | async; as toggleState) {
<cnsl-feature-toggle
*ngIf="toggleState$ | async as toggleState"
toggleStateKey="loginV2"
[toggleState]="toggleState"
(toggleChange)="toggleState$.next($event); !$event.enabled && toggleChanged.emit($event)"
>
<cnsl-form-field *ngIf="toggleState.enabled">
@if (toggleState.enabled) {
<cnsl-form-field>
<cnsl-label>{{ 'SETTING.FEATURES.LOGINV2_BASEURI' | translate }}</cnsl-label>
<input cnslInput [formControl]="baseUri" />
<button
matTooltip="{{ 'ACTIONS.SAVE' | translate }}"
mat-icon-button
[disabled]="baseUri.invalid"
color="primary"
type="submit"
(click)="
@@ -24,4 +24,6 @@
<i class="las la-save"></i>
</button>
</cnsl-form-field>
}
</cnsl-feature-toggle>
}
@@ -2,8 +2,8 @@ import { ChangeDetectionStrategy, Component, DestroyRef, EventEmitter, Input, Ou
import { FeatureToggleComponent } from '../feature-toggle.component';
import { ToggleStates } from 'src/app/components/features/features.component';
import { distinctUntilKeyChanged, ReplaySubject } from 'rxjs';
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
import { AsyncPipe, NgIf } from '@angular/common';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { AsyncPipe } from '@angular/common';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { InputModule } from 'src/app/modules/input/input.module';
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
@@ -17,7 +17,6 @@ import { MatTooltipModule } from '@angular/material/tooltip';
imports: [
FeatureToggleComponent,
AsyncPipe,
NgIf,
ReactiveFormsModule,
InputModule,
HasRolePipeModule,
@@ -36,7 +35,7 @@ export class LoginV2FeatureToggleComponent {
public toggleChanged = new EventEmitter<ToggleStates['loginV2']>();
protected readonly toggleState$ = new ReplaySubject<ToggleStates['loginV2']>(1);
protected readonly baseUri = new FormControl('', { nonNullable: true, validators: [Validators.required] });
protected readonly baseUri = new FormControl('', { nonNullable: true });
constructor(destroyRef: DestroyRef) {
this.toggleState$.pipe(distinctUntilKeyChanged('baseUri'), takeUntilDestroyed(destroyRef)).subscribe(({ baseUri }) => {