Enhance role selection functionality in ListSelectableRolesQueryHandler and update frontend role display
CI / Backend (build + test) (push) Successful in 1m22s
CI / Frontend (lint + typecheck + build) (push) Successful in 44s

- Updated ListSelectableRolesQueryHandler to include IIdentityService and ICurrentUser for user authorization and profile retrieval.
- Added logic to filter out the current user's role and admin roles from the selectable roles list.
- Enhanced CreateRoleRequestDialog to display role options with additional information, including max configs and IP limits, using localization support.
- Updated i18n resources to include new role option formatting for both Russian and English.
This commit is contained in:
Leonid Pershin
2026-07-14 23:31:56 +03:00
parent 8f6807a456
commit b6bffcc302
4 changed files with 114 additions and 3 deletions
@@ -107,7 +107,11 @@ export function CreateRoleRequestDialog() {
<SelectContent>
{rolesQuery.data?.map((role) => (
<SelectItem key={role.id} value={role.id}>
{role.name}
{t('support.roleOption', {
name: role.name,
configs: role.maxConfigs < 0 ? t('unlimited') : role.maxConfigs,
ip: role.maxIpLimit < 0 ? t('unlimited') : role.maxIpLimit,
})}
</SelectItem>
))}
</SelectContent>
+2
View File
@@ -131,6 +131,7 @@ const resources = {
existingRole: 'Существующая роль',
newRole: 'Новая роль',
selectRole: 'Выберите роль',
roleOption: '{{name}} — конфигов: {{configs}}, IP: {{ip}}',
newRoleName: 'Название роли',
newRoleMaxConfigs: 'Количество конфигов (-1 — без лимита)',
newRoleMaxIpLimit: 'Количество IP (-1 — без лимита)',
@@ -548,6 +549,7 @@ const resources = {
existingRole: 'Existing role',
newRole: 'New role',
selectRole: 'Select a role',
roleOption: '{{name}} — configs: {{configs}}, IP: {{ip}}',
newRoleName: 'Role name',
newRoleMaxConfigs: 'Max configs (-1 = unlimited)',
newRoleMaxIpLimit: 'Max IPs (-1 = unlimited)',