feat(console): seo metatags, fix policy bugs, project options (#844)

* add seo service, index meta info

* fix policy buttons, refresh

* refresh after timeout

* loading spinner for login policy, complexity

* fix user form, add project role options

* authtoken options

* seo service lint

* style lint

* remove duplicate authmethod

* en i18n

* Update console/src/assets/i18n/en.json

Co-authored-by: Fabi <[email protected]>

Co-authored-by: Fabi <[email protected]>
This commit is contained in:
Max Peintner
2020-10-16 13:51:52 +02:00
committed by GitHub
co-authored by Fabi
parent c3b4c3f264
commit b1d61afc8f
30 changed files with 310 additions and 80 deletions
@@ -33,9 +33,11 @@ export class LoginPolicyComponent implements OnDestroy {
private sub: Subscription = new Subscription();
public service!: ManagementService | AdminService;
PolicyComponentServiceType: any = PolicyComponentServiceType;
public PolicyComponentServiceType: any = PolicyComponentServiceType;
public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;
public idps: MgmtIdpProviderView.AsObject[] | AdminIdpProviderView.AsObject[] = [];
public loading: boolean = false;
constructor(
private route: ActivatedRoute,
private toast: ToastService,
@@ -43,7 +45,6 @@ export class LoginPolicyComponent implements OnDestroy {
private injector: Injector,
) {
this.sub = this.route.data.pipe(switchMap(data => {
console.log(data.serviceType);
this.serviceType = data.serviceType;
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
@@ -56,15 +57,19 @@ export class LoginPolicyComponent implements OnDestroy {
return this.route.params;
})).subscribe(() => {
this.getData().then(data => {
if (data) {
this.loginData = data.toObject();
}
});
this.getIdps().then(idps => {
console.log(idps);
this.idps = idps;
});
this.fetchData();
});
}
private fetchData(): void {
this.getData().then(data => {
if (data) {
this.loginData = data.toObject();
this.loading = false;
}
});
this.getIdps().then(idps => {
this.idps = idps;
});
}
@@ -122,6 +127,10 @@ export class LoginPolicyComponent implements OnDestroy {
public savePolicy(): void {
this.updateData().then(() => {
this.toast.showInfo('ORG.POLICY.LOGIN_POLICY.SAVED', true);
this.loading = true;
setTimeout(() => {
this.fetchData();
}, 2000);
}).catch(error => {
this.toast.showError(error);
});
@@ -131,9 +140,10 @@ export class LoginPolicyComponent implements OnDestroy {
if (this.serviceType === PolicyComponentServiceType.MGMT) {
(this.service as ManagementService).RemoveLoginPolicy().then(() => {
this.toast.showInfo('ORG.POLICY.TOAST.RESETSUCCESS', true);
this.loading = true;
setTimeout(() => {
this.getData();
}, 1000);
this.fetchData();
}, 2000);
}).catch(error => {
this.toast.showError(error);
});
@@ -151,7 +161,10 @@ export class LoginPolicyComponent implements OnDestroy {
dialogRef.afterClosed().subscribe(resp => {
if (resp && resp.idp && resp.type) {
this.addIdp(resp.idp, resp.type).then(() => {
this.getData();
this.loading = true;
setTimeout(() => {
this.fetchData();
}, 2000);
});
}
});