fix(console): update eslint, redirect user without roles, private labeling save and icon (#4459)

* header check

* eslint, header link

* labelpolicy promise

* set isdefault of branding to false on add

* icon

* branding toggles
This commit is contained in:
Max Peintner
2022-09-29 05:25:57 +00:00
committed by GitHub
parent f40931e81e
commit c6bb797d58
16 changed files with 283 additions and 1337 deletions
@@ -132,7 +132,7 @@ export class GrpcAuthService {
),
),
);
private zitadelPermissions: BehaviorSubject<string[]> = new BehaviorSubject<string[]>([]);
public zitadelPermissions: BehaviorSubject<string[]> = new BehaviorSubject<string[]>([]);
public readonly fetchedZitadelPermissions: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
private cachedOrgs: Org.AsObject[] = [];
+11 -2
View File
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { LabelPolicy } from '../proto/generated/zitadel/policy_pb';
import { GrpcAuthService } from './grpc-auth.service';
@@ -140,14 +141,15 @@ export class ThemeService {
this.saveTextColor(lightText, false);
};
public loadPrivateLabelling(forceDefault: boolean = false): void {
public loadPrivateLabelling(forceDefault: boolean = false): Promise<LabelPolicy.AsObject | undefined> {
if (forceDefault) {
this.setDefaultColors();
return Promise.resolve(undefined);
} else {
const isDark = (color: string) => this.isDark(color);
const isLight = (color: string) => this.isLight(color);
this.authService
return this.authService
.getMyLabelPolicy()
.then((lpresp) => {
const labelpolicy = lpresp.policy;
@@ -201,10 +203,17 @@ export class ThemeService {
lightText = '#000000';
}
this.saveTextColor(lightText || '#000000', false);
if (labelpolicy) {
return labelpolicy;
} else {
return Promise.reject();
}
})
.catch((error) => {
console.error('could not load private labelling policy!', error);
this.setDefaultColors();
return Promise.reject();
});
}
}