mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-14 09:55:12 +00:00
fix(console): migrate from tslint to eslint, project delete from table (#2490)
* es lint * modify tsconfig, auto lint some stuff * lint * lint * lint * lint * html ts lint * lint * lint, tsconfig * fix project delete, state table * eslint config, remove cnslHint directive * mfa selector, info row fixes * lint * fix login policy, granted orgs table state, lint Co-authored-by: Florian Forster <[email protected]>
This commit is contained in:
co-authored by
Florian Forster
parent
bdf63800f7
commit
b1caef81da
+10
-10
@@ -1,5 +1,5 @@
|
||||
<form>
|
||||
<cnsl-form-field *ngIf="target && target == UserTarget.SELF" appearance="outline" class="full-width more-space">
|
||||
<cnsl-form-field *ngIf="target && target === UserTarget.SELF" appearance="outline" class="full-width more-space">
|
||||
<cnsl-label>Organizations User Loginname</cnsl-label>
|
||||
|
||||
<input cnslInput *ngIf="singleOutput" type="text" placeholder="Search for the user loginname" #usernameInput
|
||||
@@ -8,7 +8,7 @@
|
||||
<mat-chip-list *ngIf="!singleOutput" #chipList aria-label="loginname selection">
|
||||
<mat-chip class="chip" *ngFor="let selecteduser of users" [selectable]="selectable" [removable]="removable"
|
||||
(removed)="remove(selecteduser)">
|
||||
{{ selecteduser?.human?.profile ? (selecteduser.human.profile.displayName) :
|
||||
{{ (selecteduser.human && selecteduser.human.profile) ? (selecteduser.human.profile.displayName) :
|
||||
selecteduser?.machine?.name}}
|
||||
| <small>
|
||||
{{selecteduser.preferredLoginName}}</small>
|
||||
@@ -25,7 +25,7 @@
|
||||
<mat-spinner diameter="30"></mat-spinner>
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let user of filteredUsers" [value]="user">
|
||||
{{user.human?.profile?.displayName ? user.human.profile.displayName : user.machine?.name}}
|
||||
{{(user.human && user.human.profile && user.human.profile.displayName) ? user.human.profile.displayName : user.machine?.name}}
|
||||
<small>{{user.preferredLoginName}}</small>
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
@@ -36,12 +36,12 @@
|
||||
</span>
|
||||
</cnsl-form-field>
|
||||
|
||||
<div *ngIf="target && target == UserTarget.EXTERNAL" class="line">
|
||||
<div *ngIf="target && target === UserTarget.EXTERNAL" class="line">
|
||||
<cnsl-form-field class="form-field" appearance="outline">
|
||||
<cnsl-label>Global User Loginname</cnsl-label>
|
||||
<input cnslInput type="text" [formControl]="globalLoginNameControl" />
|
||||
<span class="target-desc">
|
||||
{{(target == UserTarget.SELF ? 'USER.TARGET.SELF' : 'USER.TARGET.EXTERNAL') | translate}}
|
||||
{{(target === UserTarget.SELF ? 'USER.TARGET.SELF' : 'USER.TARGET.EXTERNAL') | translate}}
|
||||
<a (click)="changeTarget()">{{'USER.TARGET.CLICKHERE' | translate}}</a>
|
||||
</span>
|
||||
</cnsl-form-field>
|
||||
@@ -51,14 +51,14 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="found" *ngIf="target == UserTarget.EXTERNAL && users.length > 0">
|
||||
<div class="found" *ngIf="target === UserTarget.EXTERNAL && users.length > 0">
|
||||
<span class="found-label">{{'USER.SEARCH.FOUND' | translate}}:</span>
|
||||
<div class="found-user-row" *ngFor="let user of users; index as i">
|
||||
<div class="circle">
|
||||
<app-avatar
|
||||
*ngIf="user.human && user.human.displayName && user.human?.firstName && user.human?.lastName; else cog"
|
||||
class="avatar" [name]="user.human.displayName" [avatarUrl]="user.human?.profile?.avatarUrl || ''" [forColor]="user?.preferredLoginName" [size]="32">
|
||||
</app-avatar>
|
||||
<cnsl-avatar
|
||||
*ngIf="user.human && user.human.profile && user.human.profile.displayName && user.human.profile.firstName && user.human.profile.lastName; else cog"
|
||||
class="avatar" [name]="user.human.profile.displayName" [avatarUrl]="user.human.profile?.avatarUrl || ''" [forColor]="user.preferredLoginName ?? 'A'" [size]="32">
|
||||
</cnsl-avatar>
|
||||
<ng-template #cog>
|
||||
<div class="sa-icon">
|
||||
<i class="las la-user-cog"></i>
|
||||
|
||||
+5
-3
@@ -27,7 +27,7 @@ export enum UserTarget {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-search-user-autocomplete',
|
||||
selector: 'cnsl-search-user-autocomplete',
|
||||
templateUrl: './search-user-autocomplete.component.html',
|
||||
styleUrls: ['./search-user-autocomplete.component.scss'],
|
||||
})
|
||||
@@ -95,8 +95,8 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
|
||||
});
|
||||
}
|
||||
|
||||
public displayFn(user?: User.AsObject): string | undefined {
|
||||
return user ? `${user.preferredLoginName}` : undefined;
|
||||
public displayFn(user?: User.AsObject): string {
|
||||
return user ? `${user.preferredLoginName}` : '';
|
||||
}
|
||||
|
||||
public add(event: MatChipInputEvent): void {
|
||||
@@ -108,6 +108,8 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
|
||||
const index = this.filteredUsers.findIndex((user) => {
|
||||
if (user.preferredLoginName) {
|
||||
return user.preferredLoginName === value;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (index > -1) {
|
||||
|
||||
Reference in New Issue
Block a user