feat: rehauled console (#3525)

* new console

* move npm ci to angular build

* rel path for assets

* local grpc copy

* login policy, rm clear views, features rel path

* lock

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Max Peintner
2022-04-28 10:35:02 +00:00
committed by GitHub
co-authored by Livio Amstutz
parent 00f7dbe875
commit 08ae39ae19
668 changed files with 47746 additions and 19117 deletions
+9 -6
View File
@@ -11,7 +11,7 @@ export class ToastService {
constructor(
private snackBar: MatSnackBar,
private translate: TranslateService,
) { }
) {}
public showInfo(message: string, i18nkey: boolean = false): void {
if (i18nkey) {
@@ -19,12 +19,12 @@ export class ToastService {
.get(message)
.subscribe(data => {
this.translate.get('ACTIONS.CLOSE').pipe(take(1)).subscribe(value => {
this.showMessage(data, value);
this.showMessage(data, value, true);
});
});
} else {
this.translate.get('ACTIONS.CLOSE').pipe(take(1)).subscribe(value => {
this.showMessage(message, value);
this.showMessage(message, value, true);
});
}
}
@@ -33,13 +33,16 @@ export class ToastService {
const { message, code, metadata } = grpcError;
if (code !== 16) {
this.translate.get('ACTIONS.CLOSE').pipe(take(1)).subscribe(value => {
this.showMessage(decodeURI(message), value);
this.showMessage(decodeURI(message), value, false);
});
}
}
private showMessage(message: string, action: string): Observable<void> {
const ref = this.snackBar.open(message, action, { duration: 4000 });
private showMessage(message: string, action: string, success: boolean): Observable<void> {
const ref = this.snackBar.open(message, action, {
duration: 4000,
panelClass: success ? "data-e2e-success" : "data-e2e-failure"
});
return ref.onAction();
}