mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-23 21:28:47 +00:00
fix(console): new colorpicker, remove icons logo font (#1826)
* custom color picker, delete font * delete asset, i18n * escape deep styles * ts, proto * remove fallback img, color clickable, remove font * stylelint * fix spinner * fix deprecated chipinput.input * improve logo on login * fix qr code * always use black on white for qr code * fix header and footer css Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
parent
255139862d
commit
59af02b2f3
+93
-93
@@ -10,113 +10,113 @@ import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-search-roles-autocomplete',
|
||||
templateUrl: './search-roles-autocomplete.component.html',
|
||||
styleUrls: ['./search-roles-autocomplete.component.scss'],
|
||||
selector: 'app-search-roles-autocomplete',
|
||||
templateUrl: './search-roles-autocomplete.component.html',
|
||||
styleUrls: ['./search-roles-autocomplete.component.scss'],
|
||||
})
|
||||
export class SearchRolesAutocompleteComponent implements OnDestroy {
|
||||
public selectable: boolean = true;
|
||||
public removable: boolean = true;
|
||||
public addOnBlur: boolean = true;
|
||||
public separatorKeysCodes: number[] = [ENTER, COMMA];
|
||||
public myControl: FormControl = new FormControl();
|
||||
public names: string[] = [];
|
||||
public roles: Array<Role.AsObject> = [];
|
||||
public filteredRoles: Array<Role.AsObject> = [];
|
||||
public isLoading: boolean = false;
|
||||
@ViewChild('nameInput') public nameInput!: ElementRef<HTMLInputElement>;
|
||||
@ViewChild('auto') public matAutocomplete!: MatAutocomplete;
|
||||
@Input() public projectId: string = '';
|
||||
@Input() public singleOutput: boolean = false;
|
||||
@Output() public selectionChanged: EventEmitter<Role.AsObject[] | Role.AsObject> = new EventEmitter();
|
||||
public selectable: boolean = true;
|
||||
public removable: boolean = true;
|
||||
public addOnBlur: boolean = true;
|
||||
public separatorKeysCodes: number[] = [ENTER, COMMA];
|
||||
public myControl: FormControl = new FormControl();
|
||||
public names: string[] = [];
|
||||
public roles: Array<Role.AsObject> = [];
|
||||
public filteredRoles: Array<Role.AsObject> = [];
|
||||
public isLoading: boolean = false;
|
||||
@ViewChild('nameInput') public nameInput!: ElementRef<HTMLInputElement>;
|
||||
@ViewChild('auto') public matAutocomplete!: MatAutocomplete;
|
||||
@Input() public projectId: string = '';
|
||||
@Input() public singleOutput: boolean = false;
|
||||
@Output() public selectionChanged: EventEmitter<Role.AsObject[] | Role.AsObject> = new EventEmitter();
|
||||
|
||||
private unsubscribed$: Subject<void> = new Subject();
|
||||
constructor(private mgmtService: ManagementService) {
|
||||
this.myControl.valueChanges
|
||||
.pipe(
|
||||
takeUntil(this.unsubscribed$),
|
||||
debounceTime(200),
|
||||
tap(() => this.isLoading = true),
|
||||
switchMap(value => {
|
||||
const query = new RoleQuery();
|
||||
private unsubscribed$: Subject<void> = new Subject();
|
||||
constructor(private mgmtService: ManagementService) {
|
||||
this.myControl.valueChanges
|
||||
.pipe(
|
||||
takeUntil(this.unsubscribed$),
|
||||
debounceTime(200),
|
||||
tap(() => this.isLoading = true),
|
||||
switchMap(value => {
|
||||
const query = new RoleQuery();
|
||||
|
||||
// const key = new RoleKeyQuery();
|
||||
// key.setKey(key)
|
||||
// query.setKey(key)
|
||||
// const key = new RoleKeyQuery();
|
||||
// key.setKey(key)
|
||||
// query.setKey(key)
|
||||
|
||||
const dQuery = new RoleDisplayNameQuery();
|
||||
dQuery.setDisplayName(value);
|
||||
query.setDisplayNameQuery(dQuery);
|
||||
const dQuery = new RoleDisplayNameQuery();
|
||||
dQuery.setDisplayName(value);
|
||||
query.setDisplayNameQuery(dQuery);
|
||||
|
||||
return from(this.mgmtService.listProjectRoles(this.projectId, 10, 0, [query]));
|
||||
}),
|
||||
).subscribe((resp) => {
|
||||
this.isLoading = false;
|
||||
this.filteredRoles = resp.resultList;
|
||||
}, error => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
}
|
||||
return from(this.mgmtService.listProjectRoles(this.projectId, 10, 0, [query]));
|
||||
}),
|
||||
).subscribe((resp) => {
|
||||
this.isLoading = false;
|
||||
this.filteredRoles = resp.resultList;
|
||||
}, error => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
public ngOnDestroy(): void {
|
||||
this.unsubscribed$.next();
|
||||
}
|
||||
public ngOnDestroy(): void {
|
||||
this.unsubscribed$.next();
|
||||
}
|
||||
|
||||
public displayFn(project?: Role.AsObject): string | undefined {
|
||||
return project ? `${project.displayName}` : undefined;
|
||||
}
|
||||
public displayFn(project?: Role.AsObject): string | undefined {
|
||||
return project ? `${project.displayName}` : undefined;
|
||||
}
|
||||
|
||||
public add(event: MatChipInputEvent): void {
|
||||
if (!this.matAutocomplete.isOpen) {
|
||||
const input = event.input;
|
||||
const value = event.value;
|
||||
public add(event: MatChipInputEvent): void {
|
||||
if (!this.matAutocomplete.isOpen) {
|
||||
const input = event.chipInput?.inputElement;
|
||||
const value = event.value;
|
||||
|
||||
if ((value || '').trim()) {
|
||||
const index = this.filteredRoles.findIndex((role) => {
|
||||
if (role.key) {
|
||||
return role.key === value;
|
||||
}
|
||||
});
|
||||
if (index > -1) {
|
||||
if (this.roles && this.roles.length > 0) {
|
||||
this.roles.push(this.filteredRoles[index]);
|
||||
} else {
|
||||
this.roles = [this.filteredRoles[index]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
if ((value || '').trim()) {
|
||||
const index = this.filteredRoles.findIndex((role) => {
|
||||
if (role.key) {
|
||||
return role.key === value;
|
||||
}
|
||||
});
|
||||
if (index > -1) {
|
||||
if (this.roles && this.roles.length > 0) {
|
||||
this.roles.push(this.filteredRoles[index]);
|
||||
} else {
|
||||
this.roles = [this.filteredRoles[index]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public remove(role: Role.AsObject): void {
|
||||
const index = this.roles.indexOf(role);
|
||||
|
||||
if (index >= 0) {
|
||||
this.roles.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public selected(event: MatAutocompleteSelectedEvent): void {
|
||||
const index = this.filteredRoles.findIndex((role) => role.key === event.option.value);
|
||||
if (index !== -1) {
|
||||
if (this.singleOutput) {
|
||||
this.selectionChanged.emit(this.filteredRoles[index]);
|
||||
} else {
|
||||
if (this.roles && this.roles.length > 0) {
|
||||
this.roles.push(this.filteredRoles[index]);
|
||||
} else {
|
||||
this.roles = [this.filteredRoles[index]];
|
||||
}
|
||||
this.selectionChanged.emit(this.roles);
|
||||
|
||||
this.nameInput.nativeElement.value = '';
|
||||
this.myControl.setValue(null);
|
||||
}
|
||||
public remove(role: Role.AsObject): void {
|
||||
const index = this.roles.indexOf(role);
|
||||
|
||||
if (index >= 0) {
|
||||
this.roles.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public selected(event: MatAutocompleteSelectedEvent): void {
|
||||
const index = this.filteredRoles.findIndex((role) => role.key === event.option.value);
|
||||
if (index !== -1) {
|
||||
if (this.singleOutput) {
|
||||
this.selectionChanged.emit(this.filteredRoles[index]);
|
||||
} else {
|
||||
if (this.roles && this.roles.length > 0) {
|
||||
this.roles.push(this.filteredRoles[index]);
|
||||
} else {
|
||||
this.roles = [this.filteredRoles[index]];
|
||||
}
|
||||
this.selectionChanged.emit(this.roles);
|
||||
|
||||
this.nameInput.nativeElement.value = '';
|
||||
this.myControl.setValue(null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user