fix(console): policy reset for custom, header org filter, idp add dialog (#865)

* remove reset button if not default, rem load

* dirty focus fix

* use idptype in dialog

* remove logs

* lint

* revert idp add changes

* log error

* lint
This commit is contained in:
Max Peintner
2020-10-16 16:42:22 +02:00
committed by GitHub
parent ef3b7482cd
commit 40b8d3ffa4
9 changed files with 68 additions and 46 deletions
@@ -1,8 +1,8 @@
<app-detail-layout [backRouterLink]="[ serviceType === PolicyComponentServiceType.ADMIN ? '/iam' : '/org']"
[title]="'ORG.POLICY.PWD_AGE.TITLE' | translate" [description]="'ORG.POLICY.PWD_AGE.DESCRIPTION' | translate">
<ng-template appHasRole [appHasRole]="['policy.delete']">
<button *ngIf="serviceType === PolicyComponentServiceType.MGMT" matTooltip="{{'ORG.POLICY.RESET' | translate}}"
color="warn" (click)="removePolicy()" mat-stroked-button>
<button *ngIf="serviceType === PolicyComponentServiceType.MGMT && !isDefault"
matTooltip="{{'ORG.POLICY.RESET' | translate}}" color="warn" (click)="removePolicy()" mat-stroked-button>
{{'ORG.POLICY.RESET' | translate}}
</button>
</ng-template>
@@ -112,7 +112,6 @@ export class PasswordAgePolicyComponent implements OnDestroy {
this.ageData.expireWarnDays,
).then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.SET', true);
this.getData();
}).catch(error => {
this.toast.showError(error);
});
@@ -122,7 +121,6 @@ export class PasswordAgePolicyComponent implements OnDestroy {
this.ageData.expireWarnDays,
).then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.SET', true);
this.getData();
}).catch(error => {
this.toast.showError(error);
});
@@ -134,12 +132,18 @@ export class PasswordAgePolicyComponent implements OnDestroy {
this.ageData.expireWarnDays,
).then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.SET', true);
this.getData();
}).catch(error => {
this.toast.showError(error);
});
break;
}
}
public get isDefault(): boolean {
if (this.ageData && this.serviceType === PolicyComponentServiceType.MGMT) {
return (this.ageData as PasswordAgePolicyView.AsObject).pb_default;
} else {
return false;
}
}
}