mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-01 16:38:52 +00:00
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:
co-authored by
Livio Amstutz
parent
00f7dbe875
commit
08ae39ae19
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user