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