mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
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:
+5
-3
@@ -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>
|
||||
}
|
||||
|
||||
+3
-4
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user