mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-04 09:58:49 +00:00
* idp list, idp create route * idp modules, lazy import, i18n, routing * generic service, i18n * seperate lockout, age policy component * seperate component modules * routing * enum class * login policy * iam policy grid * login policy providers * idps login policy * add idp dialog component * add idp to loginpolicy * delete idp config, iam policy grid * remove idp from loginpolicy * idp detail component, generic idp create * lint * idp detail clientid-secrets, issuer, scopes * hide clientsecret on update * rm background style, idp config * app tooltip fix * lint * dont refresh on idp select * Update console/src/app/modules/idp-create/idp-create.component.html Co-authored-by: Fabiennne <[email protected]> Co-authored-by: Fabi <[email protected]>
85 lines
2.9 KiB
TypeScript
85 lines
2.9 KiB
TypeScript
import { Component, Inject } from '@angular/core';
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
import { IdpView as AdminIdpView } from 'src/app/proto/generated/admin_pb';
|
|
import {
|
|
Idp,
|
|
IdpProviderType,
|
|
IdpSearchKey,
|
|
IdpSearchQuery,
|
|
IdpView as MgmtIdpView,
|
|
SearchMethod,
|
|
} from 'src/app/proto/generated/management_pb';
|
|
import { AdminService } from 'src/app/services/admin.service';
|
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
|
|
|
import { PolicyComponentServiceType } from '../../policy-component-types.enum';
|
|
|
|
@Component({
|
|
selector: 'app-add-idp-dialog',
|
|
templateUrl: './add-idp-dialog.component.html',
|
|
styleUrls: ['./add-idp-dialog.component.scss'],
|
|
})
|
|
export class AddIdpDialogComponent {
|
|
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
|
public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;
|
|
|
|
public idpType!: IdpProviderType;
|
|
public idpTypes: IdpProviderType[] = [
|
|
IdpProviderType.IDPPROVIDERTYPE_SYSTEM,
|
|
IdpProviderType.IDPPROVIDERTYPE_ORG,
|
|
];
|
|
|
|
public idp: Idp.AsObject | undefined = undefined;
|
|
public availableIdps: Array<AdminIdpView.AsObject | MgmtIdpView.AsObject> | string[] = [];
|
|
public IdpProviderType: any = IdpProviderType;
|
|
|
|
constructor(
|
|
private mgmtService: ManagementService,
|
|
private adminService: AdminService,
|
|
public dialogRef: MatDialogRef<AddIdpDialogComponent>,
|
|
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
) {
|
|
if (data.serviceType) {
|
|
this.serviceType = data.serviceType;
|
|
switch (this.serviceType) {
|
|
case PolicyComponentServiceType.MGMT:
|
|
this.idpType = IdpProviderType.IDPPROVIDERTYPE_ORG;
|
|
break;
|
|
case PolicyComponentServiceType.ADMIN:
|
|
this.idpType = IdpProviderType.IDPPROVIDERTYPE_SYSTEM;
|
|
break;
|
|
}
|
|
}
|
|
|
|
this.loadIdps();
|
|
}
|
|
|
|
public loadIdps(): void {
|
|
this.idp = undefined;
|
|
if (this.serviceType === PolicyComponentServiceType.MGMT) {
|
|
const query: IdpSearchQuery = new IdpSearchQuery();
|
|
query.setKey(IdpSearchKey.IDPSEARCHKEY_PROVIDER_TYPE);
|
|
query.setMethod(SearchMethod.SEARCHMETHOD_EQUALS);
|
|
query.setValue(this.idpType.toString());
|
|
this.mgmtService.SearchIdps().then(idps => {
|
|
this.availableIdps = idps.toObject().resultList;
|
|
});
|
|
} else if (this.serviceType === PolicyComponentServiceType.ADMIN) {
|
|
this.adminService.SearchIdps().then(idps => {
|
|
this.availableIdps = idps.toObject().resultList;
|
|
});
|
|
}
|
|
}
|
|
|
|
public closeDialog(): void {
|
|
this.dialogRef.close(false);
|
|
}
|
|
|
|
public closeDialogWithSuccess(): void {
|
|
this.dialogRef.close({
|
|
idp: this.idp,
|
|
type: this.idpType,
|
|
});
|
|
}
|
|
}
|