mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
fix(console): authz creation from user, add org settings keyboardshortcut (#4135)
* fix(console): create user grant from user * add org settings to keyboard shortcuts Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -141,13 +141,20 @@ export class UserGrantCreateComponent implements OnDestroy {
|
||||
break;
|
||||
case UserGrantContext.USER:
|
||||
let grantId: string = '';
|
||||
let grantedProjectId: string = '';
|
||||
|
||||
if (this.grantedProject?.grantId) {
|
||||
grantId = this.grantedProject.grantId;
|
||||
grantedProjectId = this.grantedProject.projectId;
|
||||
}
|
||||
|
||||
const promu = this.userIds.map((id) =>
|
||||
this.userService.addUserGrant(id, this.rolesList, (this.project as Project.AsObject).id, grantId),
|
||||
this.userService.addUserGrant(
|
||||
id,
|
||||
this.rolesList,
|
||||
this.project?.id ? this.project.id : grantedProjectId ? grantedProjectId : '',
|
||||
grantId,
|
||||
),
|
||||
);
|
||||
Promise.all(promu)
|
||||
.then(() => {
|
||||
|
@@ -6,16 +6,17 @@ import { BehaviorSubject, Observable, of, pairwise, Subject, takeUntil } from 'r
|
||||
import { KeyboardShortcutsComponent } from '../../modules/keyboard-shortcuts/keyboard-shortcuts.component';
|
||||
import { GrpcAuthService } from '../grpc-auth.service';
|
||||
import {
|
||||
ACTIONS,
|
||||
DOMAINS,
|
||||
HOME,
|
||||
INSTANCE,
|
||||
KeyboardShortcut,
|
||||
ME,
|
||||
ORG,
|
||||
PROJECTS,
|
||||
USERGRANTS,
|
||||
USERS,
|
||||
ACTIONS,
|
||||
DOMAINS,
|
||||
HOME,
|
||||
INSTANCE,
|
||||
KeyboardShortcut,
|
||||
ME,
|
||||
ORG,
|
||||
ORGSETTINGS,
|
||||
PROJECTS,
|
||||
USERGRANTS,
|
||||
USERS,
|
||||
} from './keyboard-shortcuts';
|
||||
|
||||
@Injectable({
|
||||
@@ -58,7 +59,7 @@ export class KeyboardShortcutsService implements OnDestroy {
|
||||
this.router.navigate(HOME.link);
|
||||
}
|
||||
}
|
||||
if (firstKey.code === 'KeyG' && secondKey.code === 'KeyS') {
|
||||
if (firstKey.code === 'KeyG' && secondKey.code === 'KeyI') {
|
||||
if (this.hasPermission(INSTANCE)) {
|
||||
this.router.navigate(INSTANCE.link);
|
||||
}
|
||||
@@ -98,6 +99,11 @@ export class KeyboardShortcutsService implements OnDestroy {
|
||||
this.router.navigate(DOMAINS.link);
|
||||
}
|
||||
}
|
||||
if (firstKey.code === 'KeyG' && secondKey.code === 'KeyS') {
|
||||
if (this.hasPermission(ORGSETTINGS)) {
|
||||
this.router.navigate(ORGSETTINGS.link);
|
||||
}
|
||||
}
|
||||
} else if (secondKey && exclude.indexOf(secondTagname?.toLowerCase()) === -1) {
|
||||
if (secondKey.key === '?') {
|
||||
this.openOverviewDialog();
|
||||
|
@@ -12,9 +12,9 @@ export const HOME: KeyboardShortcut = {
|
||||
};
|
||||
|
||||
export const INSTANCE: KeyboardShortcut = {
|
||||
i18nKey: 'KEYBOARDSHORTCUTS.SHORTCUTS.SYSTEM',
|
||||
i18nKey: 'KEYBOARDSHORTCUTS.SHORTCUTS.INSTANCE',
|
||||
link: ['/instance'],
|
||||
keyboardKeys: ['g', 's'],
|
||||
keyboardKeys: ['g', 'i'],
|
||||
permissions: ['iam.read'],
|
||||
};
|
||||
|
||||
@@ -66,7 +66,14 @@ export const DOMAINS: KeyboardShortcut = {
|
||||
permissions: ['org.read'],
|
||||
};
|
||||
|
||||
export const SIDEWIDESHORTCUTS = [ME, HOME, INSTANCE, ORG, PROJECTS, USERS, USERGRANTS, ACTIONS, DOMAINS];
|
||||
export const ORGSETTINGS: KeyboardShortcut = {
|
||||
i18nKey: 'KEYBOARDSHORTCUTS.SHORTCUTS.ORGSETTINGS',
|
||||
link: ['/org-settings'],
|
||||
keyboardKeys: ['g', 's'],
|
||||
permissions: ['org.read'],
|
||||
};
|
||||
|
||||
export const SIDEWIDESHORTCUTS = [ME, HOME, INSTANCE, ORG, PROJECTS, USERS, USERGRANTS, ACTIONS, DOMAINS, ORGSETTINGS];
|
||||
|
||||
export const ORGSWITCHER: KeyboardShortcut = {
|
||||
i18nKey: 'KEYBOARDSHORTCUTS.SHORTCUTS.ORGSWITCHER',
|
||||
|
@@ -182,8 +182,9 @@
|
||||
"SIDEWIDE": "Seitenübergreifende Tastaturkürzel",
|
||||
"SHORTCUTS": {
|
||||
"HOME": "Zur Startseite",
|
||||
"SYSTEM": "Zum <strong>S</strong>ystem",
|
||||
"INSTANCE": "Zur <strong>I</strong>nstanz",
|
||||
"ORG": "Zur <strong>O</strong>rganisation",
|
||||
"ORGSETTINGS": "Zu den Organisationseinstellungen",
|
||||
"ORGSWITCHER": "Organisation wechseln",
|
||||
"ME": "Zum eigenen Profil",
|
||||
"PROJECTS": "Zu den <strong>P</strong>rojekten",
|
||||
|
@@ -182,8 +182,9 @@
|
||||
"SIDEWIDE": "Site-wide shortcuts",
|
||||
"SHORTCUTS": {
|
||||
"HOME": "<strong>G</strong>o to <strong>H</strong>ome",
|
||||
"SYSTEM": "<strong>G</strong>o to <strong>S</strong>ystem",
|
||||
"INSTANCE": "<strong>G</strong>o to <strong>I</strong>instance",
|
||||
"ORG": "<strong>G</strong>o to <strong>O</strong>rganization",
|
||||
"ORGSETTINGS": "<strong>G</strong>o to Organization <strong>S</strong>ettings",
|
||||
"ORGSWITCHER": "Change Organization",
|
||||
"ME": "Go To own profile",
|
||||
"PROJECTS": "<strong>G</strong>o to <strong>P</strong>rojects",
|
||||
|
@@ -181,16 +181,17 @@
|
||||
"UNDERORGCONTEXT": "Dans les pages de l'organisation",
|
||||
"SIDEWIDE": "Raccourcis pour l'ensemble du site",
|
||||
"SHORTCUTS": {
|
||||
"HOME": "<strong>A</strong>ller à <strong>A</strong>ccueil",
|
||||
"SYSTEM": "<strong>A</strong>ller à <strong>S</strong>ystème",
|
||||
"ORG": "<strong>A</strong>ller à <strong>O</strong>rganisation",
|
||||
"HOME": "Aller à Accueil",
|
||||
"INSTANCE": "Vers l'aperçu des instances",
|
||||
"ORG": "Aller à Organisation",
|
||||
"ORGSETTINGS": "Vers les paramètres de l'organisation",
|
||||
"ORGSWITCHER": "Modifier l'organisation",
|
||||
"ME": "Aller à son propre profil",
|
||||
"PROJECTS": "<strong>A</strong>ller à <strong>P</strong>rojets",
|
||||
"USERS": "<strong>A</strong>ller à <strong>U</strong>tilisateurs",
|
||||
"USERGRANTS": "<strong>A</strong>ller à<strong>A</strong>utorisations",
|
||||
"ACTIONS": "<strong>A</strong>ller à Actions et <strong>F</strong>lux",
|
||||
"DOMAINS": "<strong>A</strong>ller à <strong>D</strong>omaines"
|
||||
"PROJECTS": "Aller à Projets",
|
||||
"USERS": "Aller à Utilisateurs",
|
||||
"USERGRANTS": "Aller à Autorisations",
|
||||
"ACTIONS": "Aller à Actions et Flux",
|
||||
"DOMAINS": "Aller à Domaines"
|
||||
}
|
||||
},
|
||||
"RESOURCEID": "Id de la ressource",
|
||||
|
@@ -182,8 +182,9 @@
|
||||
"SIDEWIDE": "Tasti rapidi globali",
|
||||
"SHORTCUTS": {
|
||||
"HOME": "Vai alla panoramica",
|
||||
"SYSTEM": "Vai al pagina di sistema",
|
||||
"INSTANCE": "Vai alla pagina dell' istanza",
|
||||
"ORG": "Vai all'organizzazione",
|
||||
"ORGSETTINGS": "Alle impostazioni dell'organizzazione",
|
||||
"ORGSWITCHER": "Cambia organizzazione",
|
||||
"ME": "Vai al profilo",
|
||||
"PROJECTS": "Vai ai progetti",
|
||||
|
Reference in New Issue
Block a user