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
@@ -45,11 +45,7 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
return this.route.params;
})).subscribe(() => {
this.getData().then(data => {
if (data) {
this.lockoutData = data.toObject() as PasswordLockoutPolicyView.AsObject;
}
});
this.fetchData();
});
}
@@ -57,6 +53,14 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
this.sub.unsubscribe();
}
private fetchData(): void {
this.getData().then(data => {
if (data) {
this.lockoutData = data.toObject() as PasswordLockoutPolicyView.AsObject;
}
});
}
private getData(): Promise<PasswordLockoutPolicyView | DefaultPasswordLockoutPolicyView> {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
@@ -70,9 +74,7 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
if (this.service instanceof ManagementService) {
this.service.RemovePasswordLockoutPolicy().then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.RESETSUCCESS', true);
setTimeout(() => {
this.getData();
}, 1000);
this.fetchData();
}).catch(error => {
this.toast.showError(error);
});
@@ -99,7 +101,6 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
this.lockoutData.showLockoutFailure,
).then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.SET', true);
this.getData();
}).catch(error => {
this.toast.showError(error);
});
@@ -110,7 +111,6 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
this.lockoutData.showLockoutFailure,
).then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.SET', true);
this.getData();
}).catch(error => {
this.toast.showError(error);
});
@@ -120,7 +120,6 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
this.lockoutData.showLockoutFailure,
).then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.SET', true);
this.getData();
}).catch(error => {
this.toast.showError(error);
});