mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-15 02:15:14 +00:00
feat(console): authorizations from user context, add grants to auth user view, fix app saving (#895)
* user grant on project * grant in auth user, enable creation, fix inv regex * use autocomplete solutions, section for usre ctx * user grant create for user context * fix edit from table * fix create context * fix authorization to write * grant overview component * fix user grants without context * lint * turn table highlighting off, rm logs * fix app name saving * fix table refresh for project grants * translate toast * i18n * lint * Update console/src/assets/i18n/de.json Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Florian Forster <[email protected]>
This commit is contained in:
co-authored by
Florian Forster
parent
afa38aa2c2
commit
78e5c26015
@@ -1,19 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { take } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ToastService {
|
||||
constructor(private dialog: MatDialog,
|
||||
constructor(
|
||||
private snackBar: MatSnackBar,
|
||||
private translate: TranslateService,
|
||||
private authService: AuthenticationService,
|
||||
) { }
|
||||
|
||||
public showInfo(message: string, i18nkey: boolean = false): void {
|
||||
@@ -21,17 +18,23 @@ export class ToastService {
|
||||
this.translate
|
||||
.get(message)
|
||||
.subscribe(data => {
|
||||
this.showMessage(data, 'close');
|
||||
this.translate.get('ACTIONS.CLOSE').pipe(take(1)).subscribe(value => {
|
||||
this.showMessage(data, value);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.showMessage(message, 'close');
|
||||
this.translate.get('ACTIONS.CLOSE').pipe(take(1)).subscribe(value => {
|
||||
this.showMessage(message, value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public showError(grpcError: any): void {
|
||||
const { message, code, metadata } = grpcError;
|
||||
if (code !== 16) {
|
||||
this.showMessage(decodeURI(message), 'close');
|
||||
this.translate.get('ACTIONS.CLOSE').pipe(take(1)).subscribe(value => {
|
||||
this.showMessage(decodeURI(message), value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user