mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-17 19:05:13 +00:00
feat(console): integrate app (#7417)
* docs, frameworks view * project select, integrate app page * fix search project autocomplete * framework autocomplete * framwork select component, integrate, mapping to oidc config * param * fix route handler * setname projectid context * app-create page without context * show description of app type, info section * redirects section * updatevalue observable * fix redirect uris section * i18n * setup config * backbutton behavior, cleanup * cleanup * lint * allow other framework jump off * dev mode warning * navigate to project * rm import * i18n, guide link * edit name dialog * show warning for duplicate name
This commit is contained in:
+15
-38
@@ -37,13 +37,19 @@ export class SearchProjectAutocompleteComponent implements OnInit, OnDestroy {
|
||||
@Output() public selectionChanged: EventEmitter<{
|
||||
project: Project.AsObject | GrantedProject.AsObject;
|
||||
type: ProjectType;
|
||||
name: string;
|
||||
}> = new EventEmitter();
|
||||
@Output() public valueChanged: EventEmitter<string> = new EventEmitter();
|
||||
|
||||
private unsubscribed$: Subject<void> = new Subject();
|
||||
constructor(private mgmtService: ManagementService) {
|
||||
this.myControl.valueChanges
|
||||
.pipe(
|
||||
takeUntil(this.unsubscribed$),
|
||||
tap((value) => {
|
||||
const name = typeof value === 'string' ? value : value.name ? value.name : '';
|
||||
this.valueChanged.emit(name);
|
||||
}),
|
||||
debounceTime(200),
|
||||
tap(() => (this.isLoading = true)),
|
||||
switchMap((value) => {
|
||||
@@ -124,44 +130,6 @@ export class SearchProjectAutocompleteComponent implements OnInit, OnDestroy {
|
||||
return project && project.projectName ? `${project.projectName}` : project && project.name ? `${project.name}` : '';
|
||||
}
|
||||
|
||||
public add(event: MatChipInputEvent): void {
|
||||
if (!this.matAutocomplete.isOpen) {
|
||||
const input = event.chipInput?.inputElement;
|
||||
const value = event.value;
|
||||
|
||||
if ((value || '').trim()) {
|
||||
const index = this.filteredProjects.findIndex((project) => {
|
||||
if (project?.projectName) {
|
||||
return project.projectName === value;
|
||||
} else if (project?.name) {
|
||||
return project.name === value;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (index > -1) {
|
||||
if (this.projects && this.projects.length > 0) {
|
||||
this.projects.push(this.filteredProjects[index]);
|
||||
} else {
|
||||
this.projects = [this.filteredProjects[index]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public remove(project: GrantedProject.AsObject): void {
|
||||
const index = this.projects.indexOf(project);
|
||||
|
||||
if (index >= 0) {
|
||||
this.projects.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public selected(event: MatAutocompleteSelectedEvent): void {
|
||||
const p: Project.AsObject | GrantedProject.AsObject = event.option.value;
|
||||
const type = (p as Project.AsObject).id
|
||||
@@ -170,8 +138,17 @@ export class SearchProjectAutocompleteComponent implements OnInit, OnDestroy {
|
||||
? ProjectType.PROJECTTYPE_GRANTED
|
||||
: ProjectType.PROJECTTYPE_OWNED;
|
||||
|
||||
const name = (p as Project.AsObject).name
|
||||
? (p as Project.AsObject).name
|
||||
: (p as GrantedProject.AsObject).projectName
|
||||
? (p as GrantedProject.AsObject).projectName
|
||||
: '';
|
||||
|
||||
console.log(name);
|
||||
|
||||
this.selectionChanged.emit({
|
||||
project: p,
|
||||
name,
|
||||
type: type,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user