fix: console eventstore (#1476)

* fix org switch

* user grants

* fix project grants, user grant update

* fix idp removal, prettier buttons, attribute names
This commit is contained in:
Max Peintner
2021-03-25 15:47:56 +01:00
committed by GitHub
parent 4d10f3e715
commit ae66e40ace
19 changed files with 59 additions and 64 deletions
@@ -8,7 +8,7 @@
<cnsl-label>{{ 'IDP.TYPE' | translate }}</cnsl-label>
<mat-select [(ngModel)]="idpType" (selectionChange)="loadIdps()">
<mat-option *ngFor="let type of idpTypes" [value]="type">
{{ 'IDP.TYPES.'+type | translate}}
{{ 'IDP.OWNERTYPES.'+type | translate}}
</mat-option>
</mat-select>
</cnsl-form-field>
@@ -105,8 +105,9 @@
*ngIf="idp.stylingType == IDPStylingType.STYLING_TYPE_GOOGLE" alt="google" />
<div>
<span class="name">{{idp.name}}</span>
<span class="meta-info">{{ 'IDP.TYPE' | translate }}: {{ 'IDP.TYPES.'+idp.type | translate }}</span>
<span class="meta-info">{{ 'IDP.ID' | translate }}: {{idp.idpConfigId}}</span>
<span class="meta-info">{{ 'IDP.TYPE' | translate }}: {{ 'IDP.OWNERTYPES.'+idp.idpType | translate
}}</span>
<span class="meta-info">{{ 'IDP.ID' | translate }}: {{idp.idpId}}</span>
</div>
</div>
</div>
@@ -9,7 +9,7 @@ import {
UpdateLoginPolicyRequest,
UpdateLoginPolicyResponse,
} from 'src/app/proto/generated/zitadel/admin_pb';
import { IDP, IDPLoginPolicyLink, IDPStylingType } from 'src/app/proto/generated/zitadel/idp_pb';
import { IDP, IDPLoginPolicyLink, IDPOwnerType, IDPStylingType } from 'src/app/proto/generated/zitadel/idp_pb';
import {
AddCustomLoginPolicyRequest,
GetLoginPolicyResponse as MgmtGetLoginPolicyResponse,
@@ -101,6 +101,7 @@ export class LoginPolicyComponent implements OnDestroy {
});
this.getIdps().then(resp => {
this.idps = resp;
console.log(resp);
});
}
@@ -199,7 +200,7 @@ export class LoginPolicyComponent implements OnDestroy {
dialogRef.afterClosed().subscribe(resp => {
if (resp && resp.idp) {
this.addIdp(resp.idp).then(() => {
this.addIdp(resp.idp, resp.type).then(() => {
this.loading = true;
setTimeout(() => {
this.fetchData();
@@ -211,10 +212,12 @@ export class LoginPolicyComponent implements OnDestroy {
});
}
private addIdp(idp: IDP.AsObject | IDP.AsObject): Promise<any> {
private addIdp(idp: IDP.AsObject | IDP.AsObject, ownerType?: IDPOwnerType): Promise<any> {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
return (this.service as ManagementService).addIDPToLoginPolicy(idp.id);
if (ownerType) {
return (this.service as ManagementService).addIDPToLoginPolicy(idp.id, ownerType);
}
case PolicyComponentServiceType.ADMIN:
return (this.service as AdminService).addIDPToLoginPolicy(idp.id);
}
@@ -228,6 +231,8 @@ export class LoginPolicyComponent implements OnDestroy {
if (index > -1) {
this.idps.splice(index, 1);
}
}, error => {
this.toast.showError(error);
});
break;
case PolicyComponentServiceType.ADMIN:
@@ -236,6 +241,8 @@ export class LoginPolicyComponent implements OnDestroy {
if (index > -1) {
this.idps.splice(index, 1);
}
}, error => {
this.toast.showError(error);
});
break;
}