chore(console): remove all console eslint warnings (#11853)

<!--
Please inform yourself about the contribution guidelines on submitting a
PR here:
https://github.com/zitadel/zitadel/blob/main/CONTRIBUTING.md#submit-a-pull-request-pr.
Take note of how PR/commit titles should be written and replace the
template texts in the sections below. Don't remove any of the sections.
It is important that the commit history clearly shows what is changed
and why.
Important: By submitting a contribution you agree to the terms from our
Licensing Policy as described here:
https://github.com/zitadel/zitadel/blob/main/LICENSING.md#community-contributions.
-->

# Which Problems Are Solved

When running the nx target @zitadel/console:lint-check-ng currently
there are a lot of eslint warnings.

# How the Problems Are Solved

Removed unused variables, imports etc.

# Additional Changes

# Additional Context
This commit is contained in:
Ramon
2026-04-07 09:28:22 +00:00
committed by GitHub
parent f803ea8298
commit 23f0cd0ade
67 changed files with 105 additions and 183 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ export class AppComponent {
@HostBinding('class') public componentCssClass: string = 'dark-theme'; @HostBinding('class') public componentCssClass: string = 'dark-theme';
public yoffset: number = 0; public yoffset: number = 0;
@HostListener('window:scroll', ['$event']) onScroll(event: Event): void { @HostListener('window:scroll') onScroll(): void {
this.yoffset = this.viewPortScroller.getScrollPosition()[1]; this.yoffset = this.viewPortScroller.getScrollPosition()[1];
} }
public showAccount: boolean = false; public showAccount: boolean = false;
@@ -8,7 +8,7 @@ import { MatAutocompleteModule, MatAutocompleteSelectedEvent } from '@angular/ma
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { InputModule } from 'src/app/modules/input/input.module'; import { InputModule } from 'src/app/modules/input/input.module';
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { Observable, map, of, startWith, switchMap, tap } from 'rxjs'; import { Observable, map, of, startWith } from 'rxjs';
import { Framework } from '../quickstart/quickstart.component'; import { Framework } from '../quickstart/quickstart.component';
@Component({ @Component({
@@ -1,14 +1,6 @@
import { Component, Inject, signal } from '@angular/core'; import { Component, Inject, signal } from '@angular/core';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
MAT_DIALOG_DATA,
MatDialogActions,
MatDialogClose,
MatDialogContent,
MatDialogModule,
MatDialogRef,
MatDialogTitle,
} from '@angular/material/dialog';
import { FrameworkAutocompleteComponent } from '../framework-autocomplete/framework-autocomplete.component'; import { FrameworkAutocompleteComponent } from '../framework-autocomplete/framework-autocomplete.component';
import { Framework } from '../quickstart/quickstart.component'; import { Framework } from '../quickstart/quickstart.component';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
@@ -1,9 +1,9 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, signal } from '@angular/core'; import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { Observable, Subject, map, of, startWith, switchMap, tap } from 'rxjs'; import { Observable, startWith } from 'rxjs';
import { MatRadioModule } from '@angular/material/radio'; import { MatRadioModule } from '@angular/material/radio';
import { ConditionType } from '../actions-two-add-action-condition/actions-two-add-action-condition.component'; import { ConditionType } from '../actions-two-add-action-condition/actions-two-add-action-condition.component';
@@ -1,8 +1,8 @@
import { KeyValue } from '@angular/common'; import { KeyValue } from '@angular/common';
import { Component, DestroyRef, Input, OnDestroy, OnInit } from '@angular/core'; import { Component, DestroyRef, Input, OnInit } from '@angular/core';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb'; import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of, Subject } from 'rxjs'; import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, debounceTime, scan, take, takeUntil, tap } from 'rxjs/operators'; import { catchError, debounceTime, scan, take, tap } from 'rxjs/operators';
import { ListMyUserChangesResponse } from 'src/app/proto/generated/zitadel/auth_pb'; import { ListMyUserChangesResponse } from 'src/app/proto/generated/zitadel/auth_pb';
import { Change } from 'src/app/proto/generated/zitadel/change_pb'; import { Change } from 'src/app/proto/generated/zitadel/change_pb';
import { import {
@@ -269,7 +269,6 @@ export class ChangesComponent implements OnInit {
} }
// Order by ascending property value // Order by ascending property value
/* eslint-disable */
valueAscOrder = (a: KeyValue<number, string>, b: KeyValue<number, string>): number => { valueAscOrder = (a: KeyValue<number, string>, b: KeyValue<number, string>): number => {
return a.value.localeCompare(b.value); return a.value.localeCompare(b.value);
}; };
@@ -278,5 +277,4 @@ export class ChangesComponent implements OnInit {
keyDescOrder = (a: KeyValue<number, string>, b: KeyValue<number, string>): number => { keyDescOrder = (a: KeyValue<number, string>, b: KeyValue<number, string>): number => {
return a.key > b.key ? -1 : b.key > a.key ? 1 : 0; return a.key > b.key ? -1 : b.key > a.key ? 1 : 0;
}; };
/* eslint-enable */
} }
@@ -1,5 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component } from '@angular/core';
import { PrivacyPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service'; import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
import { faXTwitter } from '@fortawesome/free-brands-svg-icons'; import { faXTwitter } from '@fortawesome/free-brands-svg-icons';
@@ -4,7 +4,6 @@ import { MatDialog } from '@angular/material/dialog';
import { MatTableDataSource } from '@angular/material/table'; import { MatTableDataSource } from '@angular/material/table';
import { Router, RouterLink } from '@angular/router'; import { Router, RouterLink } from '@angular/router';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
import { BehaviorSubject, firstValueFrom, Observable, Subject } from 'rxjs'; import { BehaviorSubject, firstValueFrom, Observable, Subject } from 'rxjs';
import { import {
ListProvidersRequest as AdminListProvidersRequest, ListProvidersRequest as AdminListProvidersRequest,
@@ -20,8 +19,6 @@ import {
ProviderType, ProviderType,
} from 'src/app/proto/generated/zitadel/idp_pb'; } from 'src/app/proto/generated/zitadel/idp_pb';
import { import {
AddCustomLoginPolicyRequest,
AddCustomLoginPolicyResponse,
ListProvidersRequest as MgmtListProvidersRequest, ListProvidersRequest as MgmtListProvidersRequest,
ListProvidersResponse as MgmtListProvidersResponse, ListProvidersResponse as MgmtListProvidersResponse,
} from 'src/app/proto/generated/zitadel/management_pb'; } from 'src/app/proto/generated/zitadel/management_pb';
@@ -37,7 +34,6 @@ import { PageEvent, PaginatorComponent } from '../paginator/paginator.component'
import { PolicyComponentServiceType } from '../policies/policy-component-types.enum'; import { PolicyComponentServiceType } from '../policies/policy-component-types.enum';
import { WarnDialogComponent } from '../warn-dialog/warn-dialog.component'; import { WarnDialogComponent } from '../warn-dialog/warn-dialog.component';
import { LoginPolicyService } from '../../services/login-policy.service'; import { LoginPolicyService } from '../../services/login-policy.service';
import { first } from 'rxjs/operators';
@Component({ @Component({
selector: 'cnsl-idp-table', selector: 'cnsl-idp-table',
@@ -1,6 +1,5 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { App, AppState } from 'src/app/proto/generated/zitadel/app_pb'; import { App, AppState } from 'src/app/proto/generated/zitadel/app_pb';
import { IDP, IDPState } from 'src/app/proto/generated/zitadel/idp_pb';
import { InstanceDetail, State } from 'src/app/proto/generated/zitadel/instance_pb'; import { InstanceDetail, State } from 'src/app/proto/generated/zitadel/instance_pb';
import { Org, OrgState } from 'src/app/proto/generated/zitadel/org_pb'; import { Org, OrgState } from 'src/app/proto/generated/zitadel/org_pb';
import { LoginPolicy } from 'src/app/proto/generated/zitadel/policy_pb'; import { LoginPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
@@ -331,10 +331,8 @@ export class InputDirective implements MatFormFieldControl<any>, OnChanges, OnDe
// In Ivy the `host` bindings will be merged when this class is extended, whereas in // In Ivy the `host` bindings will be merged when this class is extended, whereas in
// ViewEngine they're overwritten. // ViewEngine they're overwritten.
/** Callback for the cases where the focused state of the input changes. */ /** Callback for the cases where the focused state of the input changes. */
/* eslint-disable */
@HostListener('focus', ['true']) @HostListener('focus', ['true'])
@HostListener('blur', ['false']) @HostListener('blur', ['false'])
/* eslint-enable */
_focusChanged(isFocused: boolean): void { _focusChanged(isFocused: boolean): void {
if (isFocused !== this.focused && (!this.readonly || !isFocused)) { if (isFocused !== this.focused && (!this.readonly || !isFocused)) {
this.focused = isFocused; this.focused = isFocused;
@@ -345,7 +343,6 @@ export class InputDirective implements MatFormFieldControl<any>, OnChanges, OnDe
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine. // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
// In Ivy the `host` bindings will be merged when this class is extended, whereas in // In Ivy the `host` bindings will be merged when this class is extended, whereas in
// ViewEngine they're overwritten. // ViewEngine they're overwritten.
// eslint-disable-next-line
@HostListener('input') @HostListener('input')
_onInput(): void { _onInput(): void {
// This is a noop function and is used to let Angular know whenever the value changes. // This is a noop function and is used to let Angular know whenever the value changes.
@@ -461,7 +458,6 @@ export class InputDirective implements MatFormFieldControl<any>, OnChanges, OnDe
this.focus(); this.focus();
} }
} }
/* eslint-disable */
static ngAcceptInputType_disabled: BooleanInput; static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_readonly: BooleanInput; static ngAcceptInputType_readonly: BooleanInput;
static ngAcceptInputType_required: BooleanInput; static ngAcceptInputType_required: BooleanInput;
@@ -469,5 +465,4 @@ export class InputDirective implements MatFormFieldControl<any>, OnChanges, OnDe
// Accept `any` to avoid conflicts with other directives on `<input>` that may // Accept `any` to avoid conflicts with other directives on `<input>` that may
// accept different types. // accept different types.
static ngAcceptInputType_value: any; static ngAcceptInputType_value: any;
/* eslint-enable */
} }
@@ -124,7 +124,7 @@ export class MembershipsTableComponent implements OnInit, OnDestroy {
const membershipOrg = await this.authService.getActiveOrg(membership.orgId); const membershipOrg = await this.authService.getActiveOrg(membership.orgId);
await this.router.navigate(['/org/members']); await this.router.navigate(['/org/members']);
this.startOrgContextWorkflow(membershipOrg?.id, org.id); this.startOrgContextWorkflow(membershipOrg?.id, org.id);
} catch (error) { } catch {
this.toast.showInfo('USER.MEMBERSHIPS.NOPERMISSIONTOEDIT', true); this.toast.showInfo('USER.MEMBERSHIPS.NOPERMISSIONTOEDIT', true);
} }
} else if (membership.projectGrantId && membership.details?.resourceOwner) { } else if (membership.projectGrantId && membership.details?.resourceOwner) {
@@ -133,7 +133,7 @@ export class MembershipsTableComponent implements OnInit, OnDestroy {
const membershipOrg = await this.authService.getActiveOrg(membership.details?.resourceOwner); const membershipOrg = await this.authService.getActiveOrg(membership.details?.resourceOwner);
await this.router.navigate(['/granted-projects', membership.projectId, 'grants', membership.projectGrantId]); await this.router.navigate(['/granted-projects', membership.projectId, 'grants', membership.projectGrantId]);
this.startOrgContextWorkflow(membershipOrg?.id, org.id); this.startOrgContextWorkflow(membershipOrg?.id, org.id);
} catch (error) { } catch {
this.toast.showInfo('USER.MEMBERSHIPS.NOPERMISSIONTOEDIT', true); this.toast.showInfo('USER.MEMBERSHIPS.NOPERMISSIONTOEDIT', true);
} }
} else if (membership.projectId && membership.details?.resourceOwner) { } else if (membership.projectId && membership.details?.resourceOwner) {
@@ -142,7 +142,7 @@ export class MembershipsTableComponent implements OnInit, OnDestroy {
const membershipOrg = await this.authService.getActiveOrg(membership.details?.resourceOwner); const membershipOrg = await this.authService.getActiveOrg(membership.details?.resourceOwner);
await this.router.navigate(['/projects', membership.projectId, 'members']); await this.router.navigate(['/projects', membership.projectId, 'members']);
this.startOrgContextWorkflow(membershipOrg?.id, org.id); this.startOrgContextWorkflow(membershipOrg?.id, org.id);
} catch (error) { } catch {
this.toast.showInfo('USER.MEMBERSHIPS.NOPERMISSIONTOEDIT', true); this.toast.showInfo('USER.MEMBERSHIPS.NOPERMISSIONTOEDIT', true);
} }
} else if (membership.iam) { } else if (membership.iam) {
@@ -1,12 +1,11 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { Component } from '@angular/core';
import { AdminService } from 'src/app/services/admin.service'; import { AdminService } from 'src/app/services/admin.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { UntypedFormBuilder } from '@angular/forms';
import { LanguagesService } from '../../../services/languages.service'; import { LanguagesService } from '../../../services/languages.service';
import { BehaviorSubject, concat, forkJoin, from, Observable, of, Subject, switchMap, take, takeUntil } from 'rxjs'; import { BehaviorSubject, forkJoin, from, Observable, take } from 'rxjs';
import { GrpcAuthService } from '../../../services/grpc-auth.service'; import { GrpcAuthService } from '../../../services/grpc-auth.service';
import { CdkDrag, CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; import { CdkDrag, CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
import { catchError, map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
interface State { interface State {
allowed: string[]; allowed: string[];
@@ -15,7 +15,6 @@ import { MatFormFieldModule } from '@angular/material/form-field';
import { DragDropModule } from '@angular/cdk/drag-drop'; import { DragDropModule } from '@angular/cdk/drag-drop';
import { MatRadioModule } from '@angular/material/radio'; import { MatRadioModule } from '@angular/material/radio';
import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTooltipModule } from '@angular/material/tooltip';
import { TableActionsModule } from '../../table-actions/table-actions.module';
import { MatMenuModule } from '@angular/material/menu'; import { MatMenuModule } from '@angular/material/menu';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
@@ -2,7 +2,7 @@ import { Component, Injector, Input, OnDestroy, OnInit, Type } from '@angular/co
import { FormControl, UntypedFormGroup } from '@angular/forms'; import { FormControl, UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb'; import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, interval, Observable, of, Subject, Subscription, switchMap, take, tap } from 'rxjs'; import { BehaviorSubject, from, interval, Observable, of, Subject, Subscription, take, tap } from 'rxjs';
import { map, pairwise, startWith, takeUntil } from 'rxjs/operators'; import { map, pairwise, startWith, takeUntil } from 'rxjs/operators';
import { import {
GetCustomLoginTextsRequest as AdminGetCustomLoginTextsRequest, GetCustomLoginTextsRequest as AdminGetCustomLoginTextsRequest,
@@ -27,7 +27,6 @@ import { LanguagesService } from '../../../services/languages.service';
const MIN_INTERVAL_SECONDS = 10; // if the difference of a newer version to the current exceeds this time, a refresh button is shown. const MIN_INTERVAL_SECONDS = 10; // if the difference of a newer version to the current exceeds this time, a refresh button is shown.
/* eslint-disable */
const KeyNamesArray = [ const KeyNamesArray = [
'emailVerificationDoneText', 'emailVerificationDoneText',
'emailVerificationText', 'emailVerificationText',
@@ -64,7 +63,6 @@ const KeyNamesArray = [
'passwordlessText', 'passwordlessText',
'externalRegistrationUserOverviewText', 'externalRegistrationUserOverviewText',
]; ];
/* eslint-enable */
const REQUESTMAP = { const REQUESTMAP = {
[PolicyComponentServiceType.MGMT]: { [PolicyComponentServiceType.MGMT]: {
@@ -180,7 +178,7 @@ export class LoginTextsComponent implements OnInit, OnDestroy {
// debounceTime(5000), // debounceTime(5000),
takeUntil(this.destroy$), takeUntil(this.destroy$),
) )
.subscribe((x) => { .subscribe(() => {
this.checkForChanges(); this.checkForChanges();
}); });
} }
@@ -1,7 +1,7 @@
import { Component, Injector, Input, OnDestroy, OnInit, Type } from '@angular/core'; import { Component, Injector, Input, OnDestroy, OnInit, Type } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { MatSelectChange } from '@angular/material/select'; import { MatSelectChange } from '@angular/material/select';
import { BehaviorSubject, from, Observable, of, Subscription, switchMap, take, tap } from 'rxjs'; import { BehaviorSubject, from, Observable, of, Subscription, take, tap } from 'rxjs';
import { import {
GetDefaultDomainClaimedMessageTextRequest as AdminGetDefaultDomainClaimedMessageTextRequest, GetDefaultDomainClaimedMessageTextRequest as AdminGetDefaultDomainClaimedMessageTextRequest,
GetDefaultInitMessageTextRequest as AdminGetDefaultInitMessageTextRequest, GetDefaultInitMessageTextRequest as AdminGetDefaultInitMessageTextRequest,
@@ -65,7 +65,6 @@ import { ToastService } from 'src/app/services/toast.service';
import { InfoSectionType } from '../../info-section/info-section.component'; import { InfoSectionType } from '../../info-section/info-section.component';
import { WarnDialogComponent } from '../../warn-dialog/warn-dialog.component'; import { WarnDialogComponent } from '../../warn-dialog/warn-dialog.component';
import { PolicyComponentServiceType } from '../policy-component-types.enum'; import { PolicyComponentServiceType } from '../policy-component-types.enum';
import { map } from 'rxjs/operators';
import { LanguagesService } from '../../../services/languages.service'; import { LanguagesService } from '../../../services/languages.service';
enum MESSAGETYPES { enum MESSAGETYPES {
@@ -1,8 +1,7 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, signal, WritableSignal } from '@angular/core'; import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, signal, WritableSignal } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { WebKey } from '@zitadel/proto/zitadel/webkey/v2/key_pb';
import { ReplaySubject } from 'rxjs'; import { ReplaySubject } from 'rxjs';
import { RSAHasher, RSABits, ECDSACurve } from '@zitadel/proto/zitadel/webkey/v2/key_pb'; import { RSAHasher, RSABits, ECDSACurve, WebKey } from '@zitadel/proto/zitadel/webkey/v2/key_pb';
type RawValue<T extends FormGroup> = ReturnType<T['getRawValue']>; type RawValue<T extends FormGroup> = ReturnType<T['getRawValue']>;
@@ -1,7 +1,7 @@
import { ChangeDetectionStrategy, Component, DestroyRef, OnInit, signal } from '@angular/core'; import { ChangeDetectionStrategy, Component, DestroyRef, signal } from '@angular/core';
import { WebKeysService } from 'src/app/services/webkeys.service'; import { WebKeysService } from 'src/app/services/webkeys.service';
import { defer, EMPTY, firstValueFrom, Observable, ObservedValueOf, of, shareReplay, Subject, switchMap } from 'rxjs'; import { firstValueFrom, Observable, ObservedValueOf, shareReplay, Subject, switchMap } from 'rxjs';
import { catchError, map, startWith, withLatestFrom } from 'rxjs/operators'; import { catchError, map, startWith } from 'rxjs/operators';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { MessageInitShape } from '@bufbuild/protobuf'; import { MessageInitShape } from '@bufbuild/protobuf';
import { OidcWebKeysCreateComponent } from './oidc-webkeys-create/oidc-webkeys-create.component'; import { OidcWebKeysCreateComponent } from './oidc-webkeys-create/oidc-webkeys-create.component';
@@ -9,9 +9,8 @@ import { TimestampToDatePipe } from 'src/app/pipes/timestamp-to-date-pipe/timest
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component'; import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { State, WebKey } from '@zitadel/proto/zitadel/webkey/v2/key_pb';
import { CreateWebKeyRequestSchema } from '@zitadel/proto/zitadel/webkey/v2/webkey_service_pb'; import { CreateWebKeyRequestSchema } from '@zitadel/proto/zitadel/webkey/v2/webkey_service_pb';
import { RSAHasher, RSABits, ECDSACurve } from '@zitadel/proto/zitadel/webkey/v2/key_pb'; import { RSAHasher, RSABits, ECDSACurve, State, WebKey } from '@zitadel/proto/zitadel/webkey/v2/key_pb';
const CACHE_WARNING_MS = 5 * 60 * 1000; // 5 minutes const CACHE_WARNING_MS = 5 * 60 * 1000; // 5 minutes
@@ -1,5 +1,5 @@
import { Component, Injector, Input, OnInit, Type } from '@angular/core'; import { Component, Injector, Input, OnInit, Type } from '@angular/core';
import { AbstractControl, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { AbstractControl, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { GetPasswordAgePolicyResponse as AdminGetPasswordAgePolicyResponse } from 'src/app/proto/generated/zitadel/admin_pb'; import { GetPasswordAgePolicyResponse as AdminGetPasswordAgePolicyResponse } from 'src/app/proto/generated/zitadel/admin_pb';
import { GetPasswordAgePolicyResponse as MgmtGetPasswordAgePolicyResponse } from 'src/app/proto/generated/zitadel/management_pb'; import { GetPasswordAgePolicyResponse as MgmtGetPasswordAgePolicyResponse } from 'src/app/proto/generated/zitadel/management_pb';
@@ -11,7 +11,6 @@ import { ToastService } from 'src/app/services/toast.service';
import { InfoSectionType } from '../../info-section/info-section.component'; import { InfoSectionType } from '../../info-section/info-section.component';
import { WarnDialogComponent } from '../../warn-dialog/warn-dialog.component'; import { WarnDialogComponent } from '../../warn-dialog/warn-dialog.component';
import { PolicyComponentServiceType } from '../policy-component-types.enum'; import { PolicyComponentServiceType } from '../policy-component-types.enum';
import { requiredValidator } from '../../form-field/validators/validators';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { GrpcAuthService } from '../../../services/grpc-auth.service'; import { GrpcAuthService } from '../../../services/grpc-auth.service';
import { take } from 'rxjs/operators'; import { take } from 'rxjs/operators';
@@ -123,10 +122,9 @@ export class PasswordAgePolicyComponent implements OnInit {
} }
public savePolicy(): void { public savePolicy(): void {
let promise: Promise<any>;
if (this.passwordAgeData) { if (this.passwordAgeData) {
if (this.service instanceof AdminService) { if (this.service instanceof AdminService) {
promise = this.service this.service
.updatePasswordAgePolicy(this.maxAgeDays?.value ?? 0, this.expireWarnDays?.value ?? 0) .updatePasswordAgePolicy(this.maxAgeDays?.value ?? 0, this.expireWarnDays?.value ?? 0)
.then(() => { .then(() => {
this.toast.showInfo('POLICY.TOAST.SET', true); this.toast.showInfo('POLICY.TOAST.SET', true);
@@ -137,7 +135,7 @@ export class PasswordAgePolicyComponent implements OnInit {
}); });
} else { } else {
if ((this.passwordAgeData as PasswordAgePolicy.AsObject).isDefault) { if ((this.passwordAgeData as PasswordAgePolicy.AsObject).isDefault) {
promise = (this.service as ManagementService) (this.service as ManagementService)
.addCustomPasswordAgePolicy(this.maxAgeDays?.value ?? 0, this.expireWarnDays?.value ?? 0) .addCustomPasswordAgePolicy(this.maxAgeDays?.value ?? 0, this.expireWarnDays?.value ?? 0)
.then(() => { .then(() => {
this.toast.showInfo('POLICY.TOAST.SET', true); this.toast.showInfo('POLICY.TOAST.SET', true);
@@ -147,7 +145,7 @@ export class PasswordAgePolicyComponent implements OnInit {
this.toast.showError(error); this.toast.showError(error);
}); });
} else { } else {
promise = (this.service as ManagementService) (this.service as ManagementService)
.updateCustomPasswordAgePolicy(this.maxAgeDays?.value ?? 0, this.expireWarnDays?.value ?? 0) .updateCustomPasswordAgePolicy(this.maxAgeDays?.value ?? 0, this.expireWarnDays?.value ?? 0)
.then(() => { .then(() => {
this.toast.showInfo('POLICY.TOAST.SET', true); this.toast.showInfo('POLICY.TOAST.SET', true);
@@ -117,10 +117,9 @@ export class PasswordLockoutPolicyComponent implements OnInit {
} }
public savePolicy(): void { public savePolicy(): void {
let promise: Promise<any>;
if (this.lockoutData) { if (this.lockoutData) {
if (this.service instanceof AdminService) { if (this.service instanceof AdminService) {
promise = this.service this.service
.updateLockoutPolicy(this.lockoutData.maxPasswordAttempts, this.lockoutData.maxOtpAttempts) .updateLockoutPolicy(this.lockoutData.maxPasswordAttempts, this.lockoutData.maxOtpAttempts)
.then(() => { .then(() => {
this.toast.showInfo('POLICY.TOAST.SET', true); this.toast.showInfo('POLICY.TOAST.SET', true);
@@ -131,7 +130,7 @@ export class PasswordLockoutPolicyComponent implements OnInit {
}); });
} else { } else {
if ((this.lockoutData as LockoutPolicy.AsObject).isDefault) { if ((this.lockoutData as LockoutPolicy.AsObject).isDefault) {
promise = (this.service as ManagementService) (this.service as ManagementService)
.addCustomLockoutPolicy(this.lockoutData.maxPasswordAttempts, this.lockoutData.maxOtpAttempts) .addCustomLockoutPolicy(this.lockoutData.maxPasswordAttempts, this.lockoutData.maxOtpAttempts)
.then(() => { .then(() => {
this.toast.showInfo('POLICY.TOAST.SET', true); this.toast.showInfo('POLICY.TOAST.SET', true);
@@ -141,7 +140,7 @@ export class PasswordLockoutPolicyComponent implements OnInit {
this.toast.showError(error); this.toast.showError(error);
}); });
} else { } else {
promise = (this.service as ManagementService) (this.service as ManagementService)
.updateCustomLockoutPolicy(this.lockoutData.maxPasswordAttempts, this.lockoutData.maxOtpAttempts) .updateCustomLockoutPolicy(this.lockoutData.maxPasswordAttempts, this.lockoutData.maxOtpAttempts)
.then(() => { .then(() => {
this.toast.showInfo('POLICY.TOAST.SET', true); this.toast.showInfo('POLICY.TOAST.SET', true);
@@ -117,7 +117,7 @@ export class PrivacyPolicyComponent implements OnInit, OnDestroy {
}); });
} }
}) })
.catch((error) => { .catch(() => {
this.privacyPolicy = undefined; this.privacyPolicy = undefined;
this.form.patchValue({ this.form.patchValue({
tosLink: '', tosLink: '',
@@ -14,7 +14,6 @@ import {
GetPreviewLabelPolicyResponse as MgmtGetPreviewLabelPolicyResponse, GetPreviewLabelPolicyResponse as MgmtGetPreviewLabelPolicyResponse,
UpdateCustomLabelPolicyRequest, UpdateCustomLabelPolicyRequest,
} from 'src/app/proto/generated/zitadel/management_pb'; } from 'src/app/proto/generated/zitadel/management_pb';
import { Org } from 'src/app/proto/generated/zitadel/org_pb';
import { LabelPolicy, ThemeMode } from 'src/app/proto/generated/zitadel/policy_pb'; import { LabelPolicy, ThemeMode } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service'; import { AdminService } from 'src/app/services/admin.service';
import { AssetEndpoint, AssetService, AssetType } from 'src/app/services/asset.service'; import { AssetEndpoint, AssetService, AssetType } from 'src/app/services/asset.service';
@@ -724,7 +723,7 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
try { try {
const font = opentype.parse(e.target.result); const font = opentype.parse(e.target.result);
this.fontName = font.names.fullName['en']; this.fontName = font.names.fullName['en'];
} catch (e) { } catch {
this.fontName = 'Could not parse font name'; this.fontName = 'Could not parse font name';
} }
} }
@@ -22,7 +22,7 @@ export class ProjectRolesDataSource extends DataSource<Role.AsObject> {
super(); super();
} }
public loadRoles(projectId: string, grantId: string, pageIndex: number, pageSize: number, sortDirection?: string): void { public loadRoles(projectId: string, grantId: string, pageIndex: number, pageSize: number): void {
const offset = pageIndex * pageSize; const offset = pageIndex * pageSize;
this.loadingSubject.next(true); this.loadingSubject.next(true);
@@ -2,7 +2,6 @@ import { Component, EventEmitter, Input, OnChanges, OnDestroy, Output } from '@a
import { FormControl, FormGroup } from '@angular/forms'; import { FormControl, FormGroup } from '@angular/forms';
import { Subject, takeUntil } from 'rxjs'; import { Subject, takeUntil } from 'rxjs';
import { Options, AutoLinkingOption } from 'src/app/proto/generated/zitadel/idp_pb'; import { Options, AutoLinkingOption } from 'src/app/proto/generated/zitadel/idp_pb';
import { AccessTokenType } from '../../proto/generated/zitadel/user_pb';
@Component({ @Component({
selector: 'cnsl-provider-options', selector: 'cnsl-provider-options',
@@ -219,7 +219,7 @@ export class ProviderAppleComponent {
this.loading = true; this.loading = true;
(this.service as ManagementService) (this.service as ManagementService)
.updateAppleProvider(req) .updateAppleProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -246,7 +246,7 @@ export class ProviderAppleComponent {
this.loading = true; this.loading = true;
(this.service as AdminService) (this.service as AdminService)
.updateAppleProvider(req) .updateAppleProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -272,7 +272,7 @@ export class ProviderAppleComponent {
} else { } else {
this.privateKey?.setValue(''); this.privateKey?.setValue('');
const reader = new FileReader(); const reader = new FileReader();
reader.onload = ((aXML) => { reader.onload = (() => {
return (e) => { return (e) => {
const keyBase64 = e.target?.result; const keyBase64 = e.target?.result;
if (keyBase64 && typeof keyBase64 === 'string') { if (keyBase64 && typeof keyBase64 === 'string') {
@@ -281,7 +281,7 @@ export class ProviderAppleComponent {
this.privateKey?.setValue(cropped); this.privateKey?.setValue(cropped);
} }
}; };
})(file); })();
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }
} }
@@ -14,7 +14,6 @@ import {
AutoLinkingOption, AutoLinkingOption,
AzureADTenant, AzureADTenant,
AzureADTenantType, AzureADTenantType,
IDPOwnerType,
Options, Options,
Provider, Provider,
} from 'src/app/proto/generated/zitadel/idp_pb'; } from 'src/app/proto/generated/zitadel/idp_pb';
@@ -273,7 +272,7 @@ export class ProviderAzureADComponent {
this.loading = true; this.loading = true;
this.service this.service
.updateAzureADProvider(req) .updateAzureADProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -219,7 +219,7 @@ export class ProviderGithubESComponent {
this.loading = true; this.loading = true;
this.service this.service
.updateGitHubEnterpriseServerProvider(req) .updateGitHubEnterpriseServerProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -213,7 +213,7 @@ export class ProviderGithubComponent {
this.loading = true; this.loading = true;
this.service this.service
.updateGitHubProvider(req) .updateGitHubProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -216,7 +216,7 @@ export class ProviderGitlabSelfHostedComponent {
this.loading = true; this.loading = true;
this.service this.service
.updateGitLabSelfHostedProvider(req) .updateGitLabSelfHostedProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -213,7 +213,7 @@ export class ProviderGitlabComponent {
this.loading = true; this.loading = true;
this.service this.service
.updateGitLabProvider(req) .updateGitLabProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -209,7 +209,7 @@ export class ProviderGoogleComponent {
this.loading = true; this.loading = true;
(this.service as ManagementService) (this.service as ManagementService)
.updateGoogleProvider(req) .updateGoogleProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -234,7 +234,7 @@ export class ProviderGoogleComponent {
this.loading = true; this.loading = true;
(this.service as AdminService) (this.service as AdminService)
.updateGoogleProvider(req) .updateGoogleProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -208,7 +208,7 @@ export class ProviderJWTComponent {
this.loading = true; this.loading = true;
this.service this.service
.updateJWTProvider(req) .updateJWTProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -243,7 +243,7 @@ export class ProviderLDAPComponent {
this.loading = true; this.loading = true;
(this.service as ManagementService) (this.service as ManagementService)
.updateLDAPProvider(req) .updateLDAPProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -226,7 +226,7 @@ export class ProviderOAuthComponent {
this.loading = true; this.loading = true;
this.service this.service
.updateGenericOAuthProvider(req) .updateGenericOAuthProvider(req)
.then((idp) => { .then(() => {
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.close(); this.close();
@@ -33,17 +33,17 @@ const typeMap = {
[ProviderType.PROVIDER_TYPE_SAML]: { path: 'saml', component: ProviderSamlSpComponent }, [ProviderType.PROVIDER_TYPE_SAML]: { path: 'saml', component: ProviderSamlSpComponent },
}; };
const routes: Routes = Object.entries(typeMap).map(([key, value]) => { const routes: Routes = Object.values(typeMap).map(({ path, component }) => {
return { return {
path: value.path, path,
children: [ children: [
{ {
path: 'create', path: 'create',
component: value.component, component,
}, },
{ {
path: ':id', path: ':id',
component: value.component, component,
}, },
], ],
}; };
@@ -2,7 +2,6 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes';
import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'; import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';
import { UntypedFormControl } from '@angular/forms'; import { UntypedFormControl } from '@angular/forms';
import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete'; import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { MatChipInputEvent } from '@angular/material/chips';
import { forkJoin, from, Subject } from 'rxjs'; import { forkJoin, from, Subject } from 'rxjs';
import { debounceTime, switchMap, takeUntil, tap } from 'rxjs/operators'; import { debounceTime, switchMap, takeUntil, tap } from 'rxjs/operators';
import { ListProjectGrantsResponse, ListProjectsResponse } from 'src/app/proto/generated/zitadel/management_pb'; import { ListProjectGrantsResponse, ListProjectsResponse } from 'src/app/proto/generated/zitadel/management_pb';
@@ -55,7 +55,7 @@ export class SearchRolesAutocompleteComponent implements OnDestroy {
this.isLoading = false; this.isLoading = false;
this.filteredRoles = resp.resultList; this.filteredRoles = resp.resultList;
}, },
(error) => { () => {
this.isLoading = false; this.isLoading = false;
}, },
); );
@@ -25,7 +25,7 @@
</div> </div>
<div class="shortcut-list-row"> <div class="shortcut-list-row">
<div cdkDropList [cdkDropListData]="main" class="shortcut-list" (cdkDropListDropped)="drop($event, 'main')"> <div cdkDropList [cdkDropListData]="main" class="shortcut-list" (cdkDropListDropped)="drop($event)">
@if (editState) { @if (editState) {
<p class="shortcut-desc cnsl-secondary-text">{{ 'HOME.SHORTCUTS.REORDER' | translate }}</p> <p class="shortcut-desc cnsl-secondary-text">{{ 'HOME.SHORTCUTS.REORDER' | translate }}</p>
} }
@@ -74,7 +74,7 @@
} }
</div> </div>
<div cdkDropList [cdkDropListData]="secondary" class="shortcut-list" (cdkDropListDropped)="drop($event, 'secondary')"> <div cdkDropList [cdkDropListData]="secondary" class="shortcut-list" (cdkDropListDropped)="drop($event)">
@if (editState) { @if (editState) {
<p class="shortcut-desc cnsl-secondary-text">{{ 'HOME.SHORTCUTS.REORDER' | translate }}</p> <p class="shortcut-desc cnsl-secondary-text">{{ 'HOME.SHORTCUTS.REORDER' | translate }}</p>
} }
@@ -123,7 +123,7 @@
} }
</div> </div>
<div cdkDropList [cdkDropListData]="third" class="shortcut-list" (cdkDropListDropped)="drop($event, 'third')"> <div cdkDropList [cdkDropListData]="third" class="shortcut-list" (cdkDropListDropped)="drop($event)">
@if (editState) { @if (editState) {
<p class="shortcut-desc cnsl-secondary-text">{{ 'HOME.SHORTCUTS.REORDER' | translate }}</p> <p class="shortcut-desc cnsl-secondary-text">{{ 'HOME.SHORTCUTS.REORDER' | translate }}</p>
} }
@@ -185,7 +185,7 @@
cdkDropList cdkDropList
[cdkDropListData]="allAvailableShortcuts" [cdkDropListData]="allAvailableShortcuts"
class="available-shortcut-list" class="available-shortcut-list"
(cdkDropListDropped)="drop($event, 'main')" (cdkDropListDropped)="drop($event)"
> >
@for (shortcut of allAvailableShortcuts; track shortcut) { @for (shortcut of allAvailableShortcuts; track shortcut) {
<ng-template cnslHasRole [hasRole]="shortcut.withRole"> <ng-template cnslHasRole [hasRole]="shortcut.withRole">
@@ -232,7 +232,7 @@ export class ShortcutsComponent implements OnDestroy {
this.destroy$.complete(); this.destroy$.complete();
} }
public drop(event: CdkDragDrop<ShortcutItem[]>, listName: string) { public drop(event: CdkDragDrop<ShortcutItem[]>) {
if (event.previousContainer === event.container) { if (event.previousContainer === event.container) {
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
this.saveStateToStorage(); this.saveStateToStorage();
@@ -1,4 +1,4 @@
import { CommonModule, TitleCasePipe } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
@@ -1,9 +1,8 @@
import { SelectionModel } from '@angular/cdk/collections'; import { SelectionModel } from '@angular/cdk/collections';
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { Router, RouterLink } from '@angular/router'; import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
import { SMTPConfigState } from 'src/app/proto/generated/zitadel/settings_pb';
import { ListQuery } from 'src/app/proto/generated/zitadel/object_pb'; import { ListQuery } from 'src/app/proto/generated/zitadel/object_pb';
import { LoginPolicy } from 'src/app/proto/generated/zitadel/policy_pb'; import { LoginPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service'; import { AdminService } from 'src/app/services/admin.service';
@@ -12,7 +11,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { PageEvent, PaginatorComponent } from '../paginator/paginator.component'; import { PageEvent, PaginatorComponent } from '../paginator/paginator.component';
import { PolicyComponentServiceType } from '../policies/policy-component-types.enum'; import { PolicyComponentServiceType } from '../policies/policy-component-types.enum';
import { ListSMTPConfigsRequest, ListSMTPConfigsResponse } from 'src/app/proto/generated/zitadel/admin_pb'; import { ListSMTPConfigsRequest, ListSMTPConfigsResponse } from 'src/app/proto/generated/zitadel/admin_pb';
import { SMTPConfig } from 'src/app/proto/generated/zitadel/settings_pb'; import { SMTPConfig, SMTPConfigState } from 'src/app/proto/generated/zitadel/settings_pb';
import { WarnDialogComponent } from '../warn-dialog/warn-dialog.component'; import { WarnDialogComponent } from '../warn-dialog/warn-dialog.component';
import { MatTableDataSource } from '@angular/material/table'; import { MatTableDataSource } from '@angular/material/table';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
@@ -1,4 +1,4 @@
import { Component, inject, Inject, signal } from '@angular/core'; import { Component, inject, signal } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
export type UserGrantRoleDialogData = { export type UserGrantRoleDialogData = {
@@ -1,5 +1,5 @@
import { Component, OnDestroy, signal } from '@angular/core'; import { Component, OnDestroy, signal } from '@angular/core';
import { ActivatedRoute, Navigation, Params, Router } from '@angular/router'; import { ActivatedRoute, Params, Router } from '@angular/router';
import { Subject, takeUntil } from 'rxjs'; import { Subject, takeUntil } from 'rxjs';
import { InfoSectionType } from 'src/app/modules/info-section/info-section.component'; import { InfoSectionType } from 'src/app/modules/info-section/info-section.component';
import { ProjectType } from 'src/app/modules/project-members/project-members-datasource'; import { ProjectType } from 'src/app/modules/project-members/project-members-datasource';
@@ -2,16 +2,13 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { MatSelectModule } from '@angular/material/select'; import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module'; import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
import { CreateLayoutModule } from 'src/app/modules/create-layout/create-layout.module'; import { CreateLayoutModule } from 'src/app/modules/create-layout/create-layout.module';
import { InfoSectionModule } from 'src/app/modules/info-section/info-section.module'; import { InfoSectionModule } from 'src/app/modules/info-section/info-section.module';
import { InputModule } from 'src/app/modules/input/input.module'; import { InputModule } from 'src/app/modules/input/input.module';
import { PasswordComplexityViewModule } from 'src/app/modules/password-complexity-view/password-complexity-view.module';
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module'; import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
import { SearchProjectAutocompleteModule } from 'src/app/modules/search-project-autocomplete/search-project-autocomplete.module'; import { SearchProjectAutocompleteModule } from 'src/app/modules/search-project-autocomplete/search-project-autocomplete.module';
@@ -106,7 +106,7 @@ export class ActionTableComponent implements OnInit {
if (req) { if (req) {
this.mgmtService this.mgmtService
.createAction(req) .createAction(req)
.then((resp) => { .then(() => {
this.refreshPage(); this.refreshPage();
}) })
.catch((error: any) => { .catch((error: any) => {
@@ -129,7 +129,7 @@ export class ActionTableComponent implements OnInit {
if (req) { if (req) {
this.mgmtService this.mgmtService
.updateAction(req) .updateAction(req)
.then((resp) => { .then(() => {
this.refreshPage(); this.refreshPage();
}) })
.catch((error: any) => { .catch((error: any) => {
@@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog';
import { ActionKeysType } from 'src/app/modules/action-keys/action-keys.component'; import { ActionKeysType } from 'src/app/modules/action-keys/action-keys.component';
import { InfoSectionType } from 'src/app/modules/info-section/info-section.component'; import { InfoSectionType } from 'src/app/modules/info-section/info-section.component';
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component'; import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
import { Action, ActionState, Flow, FlowType, TriggerType } from 'src/app/proto/generated/zitadel/action_pb'; import { Action, ActionState, Flow, FlowType } from 'src/app/proto/generated/zitadel/action_pb';
import { SetTriggerActionsRequest } from 'src/app/proto/generated/zitadel/management_pb'; import { SetTriggerActionsRequest } from 'src/app/proto/generated/zitadel/management_pb';
import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service'; import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service';
import { ManagementService } from 'src/app/services/mgmt.service'; import { ManagementService } from 'src/app/services/mgmt.service';
@@ -100,7 +100,7 @@ export class ActionsComponent {
}); });
} }
protected openAddTrigger(flow: FlowType.AsObject, trigger?: TriggerType.AsObject): void { protected openAddTrigger(flow: FlowType.AsObject): void {
const dialogRef = this.dialog.open(AddFlowDialogComponent, { const dialogRef = this.dialog.open(AddFlowDialogComponent, {
data: { data: {
flowType: flow, flowType: flow,
@@ -159,7 +159,7 @@ export class AddActionDialogComponent implements OnInit, OnDestroy {
if (resp) { if (resp) {
this.mgmtService this.mgmtService
.deleteAction(this.id) .deleteAction(this.id)
.then((resp) => { .then(() => {
this.dialogRef.close(); this.dialogRef.close();
}) })
.catch((error: any) => { .catch((error: any) => {
@@ -158,7 +158,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
acsURL: ['', []], acsURL: ['', []],
}); });
this.firstFormGroup.valueChanges.subscribe((value) => { this.firstFormGroup.valueChanges.subscribe(() => {
if (this.firstFormGroup.valid) { if (this.firstFormGroup.valid) {
this.oidcAppRequest.setName(this.name?.value); this.oidcAppRequest.setName(this.name?.value);
this.apiAppRequest.setName(this.name?.value); this.apiAppRequest.setName(this.name?.value);
@@ -380,7 +380,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
this.toast.showInfo('POLICY.PRIVATELABELING.MAXSIZEEXCEEDED', true); this.toast.showInfo('POLICY.PRIVATELABELING.MAXSIZEEXCEEDED', true);
} else { } else {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = ((aXML) => { reader.onload = (() => {
return (e) => { return (e) => {
const xmlBase64 = e.target?.result; const xmlBase64 = e.target?.result;
if (xmlBase64 && typeof xmlBase64 === 'string') { if (xmlBase64 && typeof xmlBase64 === 'string') {
@@ -388,7 +388,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
this.samlAppRequest.setMetadataXml(cropped); this.samlAppRequest.setMetadataXml(cropped);
} }
}; };
})(file); })();
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }
} }
@@ -92,16 +92,14 @@ export class AppDetailComponent implements OnInit, OnDestroy {
['Admin Service URL', `${env.api}/admin/v1`], ['Admin Service URL', `${env.api}/admin/v1`],
['Management Service URL', `${env.api}/management/v1`], ['Management Service URL', `${env.api}/management/v1`],
['Auth Service URL', `${env.api}/auth/v1`], ['Auth Service URL', `${env.api}/auth/v1`],
...wellknown.filter( ...wellknown.filter(([k]) => k === 'Revocation Endpoint' || k === 'JKWS URI' || k === 'Introspection Endpoint'),
([k, v]) => k === 'Revocation Endpoint' || k === 'JKWS URI' || k === 'Introspection Endpoint',
),
]; ];
}), }),
), ),
), ),
); );
public issuer$ = this.apiURLs$.pipe(map((urls) => urls.find(([k, v]) => k === 'Issuer')?.[1])); public issuer$ = this.apiURLs$.pipe(map((urls) => urls.find(([k]) => k === 'Issuer')?.[1]));
public samlURLs$ = this.envSvc.env.pipe( public samlURLs$ = this.envSvc.env.pipe(
map((env) => { map((env) => {
@@ -522,7 +520,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
this.entityId?.setValue(''); this.entityId?.setValue('');
this.acsURL?.setValue(''); this.acsURL?.setValue('');
const reader = new FileReader(); const reader = new FileReader();
reader.onload = ((aXML) => { reader.onload = (() => {
return (e) => { return (e) => {
const xmlBase64 = e.target?.result; const xmlBase64 = e.target?.result;
if (xmlBase64 && typeof xmlBase64 === 'string' && this.app?.samlConfig) { if (xmlBase64 && typeof xmlBase64 === 'string' && this.app?.samlConfig) {
@@ -532,7 +530,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
this.app.samlConfig.metadataXml = cropped; this.app.samlConfig.metadataXml = cropped;
} }
}; };
})(file); })();
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }
} }
@@ -1,29 +1,11 @@
import { C, COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
import { StepperSelectionEvent } from '@angular/cdk/stepper';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { Component, OnDestroy, OnInit, Signal, computed, effect, signal } from '@angular/core'; import { Component, OnDestroy, OnInit, effect, signal } from '@angular/core';
import { AbstractControl, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Params, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { Buffer } from 'buffer'; import { BehaviorSubject, Subject, combineLatest } from 'rxjs';
import { BehaviorSubject, Subject, Subscription, combineLatest } from 'rxjs'; import { map } from 'rxjs/operators';
import { debounceTime, map, takeUntil } from 'rxjs/operators'; import { OIDCAppType } from 'src/app/proto/generated/zitadel/app_pb';
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component'; import { AddAPIAppResponse, AddOIDCAppRequest, AddOIDCAppResponse } from 'src/app/proto/generated/zitadel/management_pb';
import { requiredValidator } from 'src/app/modules/form-field/validators/validators';
import {
APIAuthMethodType,
OIDCAppType,
OIDCAuthMethodType,
OIDCGrantType,
OIDCResponseType,
} from 'src/app/proto/generated/zitadel/app_pb';
import {
AddAPIAppRequest,
AddAPIAppResponse,
AddOIDCAppRequest,
AddOIDCAppResponse,
AddSAMLAppRequest,
} from 'src/app/proto/generated/zitadel/management_pb';
import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service'; import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service';
import { ManagementService } from 'src/app/services/mgmt.service'; import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@@ -1,4 +1,3 @@
import { Location } from '@angular/common';
import { Component, EventEmitter, OnInit } from '@angular/core'; import { Component, EventEmitter, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Params, Router } from '@angular/router'; import { ActivatedRoute, Params, Router } from '@angular/router';
@@ -24,7 +24,7 @@ export class ProjectGrantsDataSource extends DataSource<GrantedProject.AsObject>
super(); super();
} }
public loadGrants(projectId: string, pageIndex: number, pageSize: number, sortDirection?: string): void { public loadGrants(projectId: string, pageIndex: number, pageSize: number): void {
const offset = pageIndex * pageSize; const offset = pageIndex * pageSize;
this.loadingSubject.next(true); this.loadingSubject.next(true);
@@ -1,11 +1,10 @@
import { animate, state, style, transition, trigger } from '@angular/animations'; import { animate, state, style, transition, trigger } from '@angular/animations';
import { SelectionModel } from '@angular/cdk/collections'; import { SelectionModel } from '@angular/cdk/collections';
import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core'; import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { MatSelectChange } from '@angular/material/select'; import { MatSelectChange } from '@angular/material/select';
import { MatTable } from '@angular/material/table'; import { MatTable } from '@angular/material/table';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { tap } from 'rxjs/operators';
import { PageEvent, PaginatorComponent } from 'src/app/modules/paginator/paginator.component'; import { PageEvent, PaginatorComponent } from 'src/app/modules/paginator/paginator.component';
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component'; import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
import { GrantedProject, ProjectGrantState, Role } from 'src/app/proto/generated/zitadel/project_pb'; import { GrantedProject, ProjectGrantState, Role } from 'src/app/proto/generated/zitadel/project_pb';
@@ -253,7 +253,7 @@ export class UserCreateV2Component implements OnInit {
try { try {
// first we try to create a URL directly from the baseUri // first we try to create a URL directly from the baseUri
return new URL(baseUriWithTrailingSlash); return new URL(baseUriWithTrailingSlash);
} catch (_) { } catch {
// if this does not work we assume that the baseUri is relative, // if this does not work we assume that the baseUri is relative,
// and we need to add the location.origin // and we need to add the location.origin
// we make sure the relative url has a slash at the beginning and end // we make sure the relative url has a slash at the beginning and end
@@ -77,7 +77,7 @@ export class AuthPasswordlessComponent implements OnInit, OnDestroy {
}, },
}); });
dialogRef.afterClosed().subscribe((done) => { dialogRef.afterClosed().subscribe(() => {
setTimeout(() => { setTimeout(() => {
this.getPasswordless(); this.getPasswordless();
}, 1000); }, 1000);
@@ -1,18 +1,7 @@
import { Component, computed, DestroyRef, OnInit } from '@angular/core'; import { Component, computed, DestroyRef, OnInit } from '@angular/core';
import { AbstractControl, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { AbstractControl, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { import { map, switchMap, firstValueFrom, mergeWith, Observable, defer, of, shareReplay, combineLatestWith } from 'rxjs';
map,
switchMap,
firstValueFrom,
mergeWith,
Observable,
defer,
of,
shareReplay,
combineLatestWith,
EMPTY,
} from 'rxjs';
import { passwordConfirmValidator, requiredValidator } from 'src/app/modules/form-field/validators/validators'; import { passwordConfirmValidator, requiredValidator } from 'src/app/modules/form-field/validators/validators';
import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service'; import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@@ -37,12 +37,11 @@ import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.com
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { UserService } from 'src/app/services/user.service'; import { UserService } from 'src/app/services/user.service';
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { SearchQuery as UserSearchQuery } from 'src/app/proto/generated/zitadel/user_pb';
import { Type, UserFieldName } from '@zitadel/proto/zitadel/user/v2/query_pb'; import { Type, UserFieldName } from '@zitadel/proto/zitadel/user/v2/query_pb';
import { UserState, User } from '@zitadel/proto/zitadel/user/v2/user_pb'; import { UserState, User } from '@zitadel/proto/zitadel/user/v2/user_pb';
import { MessageInitShape } from '@bufbuild/protobuf'; import { MessageInitShape } from '@bufbuild/protobuf';
import { ListUsersRequestSchema, ListUsersResponse } from '@zitadel/proto/zitadel/user/v2/user_service_pb'; import { ListUsersRequestSchema, ListUsersResponse } from '@zitadel/proto/zitadel/user/v2/user_service_pb';
import { UserState as UserStateV1 } from 'src/app/proto/generated/zitadel/user_pb'; import { UserState as UserStateV1, SearchQuery as UserSearchQuery } from 'src/app/proto/generated/zitadel/user_pb';
import { NewOrganizationService } from 'src/app/services/new-organization.service'; import { NewOrganizationService } from 'src/app/services/new-organization.service';
import { AuthenticationService } from 'src/app/services/authentication.service'; import { AuthenticationService } from 'src/app/services/authentication.service';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service'; import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
@@ -6,7 +6,7 @@ import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
standalone: false, standalone: false,
}) })
export class DurationToSecondsPipe implements PipeTransform { export class DurationToSecondsPipe implements PipeTransform {
transform(value?: Duration.AsObject, ...args: unknown[]): unknown { transform(value?: Duration.AsObject): unknown {
if (value) { if (value) {
return this.durationToSeconds(value); return this.durationToSeconds(value);
} else { } else {
@@ -5,7 +5,7 @@ import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
name: 'timestampToRetention', name: 'timestampToRetention',
}) })
export class TimestampToRetentionPipe implements PipeTransform { export class TimestampToRetentionPipe implements PipeTransform {
transform(value?: Duration.AsObject, ...args: unknown[]): unknown { transform(value?: Duration.AsObject): unknown {
if (value) { if (value) {
return this.retentionFromTimestamp(value); return this.retentionFromTimestamp(value);
} else { } else {
+4 -4
View File
@@ -395,16 +395,16 @@ export class AdminService {
}), }),
}; };
}); });
const toArray = Object.entries(obj).sort(([key0, a], [key1, b]) => a.order - b.order); const toArray = Object.entries(obj).sort(([_key0, a], [_key1, b]) => a.order - b.order);
const toDo = toArray.filter(([key, value]) => value.reached === undefined); const toDo = toArray.filter(([_, value]) => value.reached === undefined);
const done = toArray.filter(([key, value]) => !!value.reached); const done = toArray.filter(([_, value]) => !!value.reached);
return [...toDo, ...done]; return [...toDo, ...done];
}), }),
tap((milestones) => { tap((milestones) => {
const total = milestones.length; const total = milestones.length;
const done = milestones.map(([type, value]) => value.reached !== undefined).filter((res) => !!res).length; const done = milestones.map(([_, value]) => value.reached !== undefined).filter((res) => !!res).length;
const percentage = Math.round((done / total) * 100); const percentage = Math.round((done / total) * 100);
this.progressDone.next(done); this.progressDone.next(done);
this.progressTotal.next(total); this.progressTotal.next(total);
-2
View File
@@ -215,8 +215,6 @@ import {
GetProjectGrantByIDResponse, GetProjectGrantByIDResponse,
GetProviderByIDRequest, GetProviderByIDRequest,
GetProviderByIDResponse, GetProviderByIDResponse,
GetSupportedLanguagesRequest,
GetSupportedLanguagesResponse,
GetUserByIDRequest, GetUserByIDRequest,
GetUserByIDResponse, GetUserByIDResponse,
GetUserByLoginNameGlobalRequest, GetUserByLoginNameGlobalRequest,
@@ -23,7 +23,6 @@ import {
ResendHumanInitializationResponse, ResendHumanInitializationResponse,
ResendHumanPhoneVerificationRequestSchema, ResendHumanPhoneVerificationRequestSchema,
ResendHumanPhoneVerificationResponse, ResendHumanPhoneVerificationResponse,
SendHumanResetPasswordNotificationRequest_Type,
SendHumanResetPasswordNotificationRequestSchema, SendHumanResetPasswordNotificationRequestSchema,
SendHumanResetPasswordNotificationResponse, SendHumanResetPasswordNotificationResponse,
SetUserMetadataRequestSchema, SetUserMetadataRequestSchema,
@@ -31,7 +31,7 @@ export class OverlayService {
const dialogRef = new CnslOverlayRef(overlayRef); const dialogRef = new CnslOverlayRef(overlayRef);
const overlayComponent = this.attachOverlayContainer(overlayRef, dialogConfig, overlayRef); this.attachOverlayContainer(overlayRef, dialogConfig, overlayRef);
overlayRef.backdropClick().subscribe((_) => dialogRef.close()); overlayRef.backdropClick().subscribe((_) => dialogRef.close());
+1 -1
View File
@@ -30,7 +30,7 @@ export class PosthogService implements OnDestroy {
enable_heatmaps: true, enable_heatmaps: true,
persistence: 'memory', persistence: 'memory',
loaded: (posthog) => { loaded: (posthog) => {
posthog.onFeatureFlags((flags) => { posthog.onFeatureFlags(() => {
if (posthog.isFeatureEnabled('session_recording')) { if (posthog.isFeatureEnabled('session_recording')) {
posthog.startSessionRecording(); posthog.startSessionRecording();
} }
@@ -1,8 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
declare const tinycolor: any;
export interface Color { export interface Color {
name: string; name: string;
hex: string; hex: string;
+1 -1
View File
@@ -38,7 +38,7 @@ export class ToastService {
public showError = (error: any | string, isGrpc: boolean = true, i18nKey: boolean = false) => { public showError = (error: any | string, isGrpc: boolean = true, i18nKey: boolean = false) => {
if (isGrpc) { if (isGrpc) {
const { message, code, metadata } = error; const { message, code } = error;
if (code !== 16) { if (code !== 16) {
this.translate this.translate
.get('ACTIONS.CLOSE') .get('ACTIONS.CLOSE')
+1 -1
View File
@@ -10,7 +10,7 @@ export function formatPhone(phone?: string): { phone: string; country: CountryCo
if (phoneNumber) { if (phoneNumber) {
return { phone: phoneNumber.formatInternational(), country }; return { phone: phoneNumber.formatInternational(), country };
} }
} catch (e) { } catch {
return null; return null;
} }
} }
+8 -8
View File
@@ -2,23 +2,23 @@ import { OnboardingActions } from '../services/admin.service';
import { COLORS } from './color'; import { COLORS } from './color';
import { MilestoneType } from '../proto/generated/zitadel/milestone/v1/milestone_pb'; import { MilestoneType } from '../proto/generated/zitadel/milestone/v1/milestone_pb';
const reddark: string = COLORS[0][700]; // const reddark: string = COLORS[0][700];
const redlight = COLORS[0][200]; // const redlight = COLORS[0][200];
const yellowdark: string = COLORS[3][700]; // const yellowdark: string = COLORS[3][700];
const yellowlight = COLORS[3][200]; // const yellowlight = COLORS[3][200];
const greendark: string = COLORS[6][700]; const greendark: string = COLORS[6][700];
const greenlight = COLORS[6][200]; const greenlight = COLORS[6][200];
const bluedark: string = COLORS[9][700]; // const bluedark: string = COLORS[9][700];
const bluelight = COLORS[9][200]; // const bluelight = COLORS[9][200];
const purpledark: string = COLORS[12][700]; const purpledark: string = COLORS[12][700];
const purplelight = COLORS[12][200]; const purplelight = COLORS[12][200];
const pinkdark: string = COLORS[15][700]; // const pinkdark: string = COLORS[15][700];
const pinklight = COLORS[15][200]; // const pinklight = COLORS[15][200];
const sthdark: string = COLORS[18][700]; const sthdark: string = COLORS[18][700];
const sthlight = COLORS[18][200]; const sthlight = COLORS[18][200];
@@ -1,4 +1,4 @@
import { combineLatestWith, distinctUntilChanged, Observable, ObservableInput, ObservableInputTuple } from 'rxjs'; import { combineLatestWith, distinctUntilChanged, Observable, ObservableInputTuple } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
// withLatestFrom does not work in this case, so we use // withLatestFrom does not work in this case, so we use