Add empty state message for role assignment
- Display helpful message when no custom roles available - Clarify that system roles are auto-assigned - Add noCustomRolesToAssign translation in English and Chinese
This commit is contained in:
@@ -1887,6 +1887,7 @@
|
||||
"failedToRemoveRole": "Failed to remove role",
|
||||
"cannotRemoveSystemRole": "Cannot remove system role",
|
||||
"cannotShareWithSelf": "Cannot share host with yourself",
|
||||
"noCustomRolesToAssign": "No custom roles available. System roles are auto-assigned.",
|
||||
"auditLogs": "Audit Logs",
|
||||
"viewAuditLogs": "View Audit Logs",
|
||||
"action": "Action",
|
||||
|
||||
@@ -1748,6 +1748,7 @@
|
||||
"failedToRemoveRole": "移除角色失败",
|
||||
"cannotRemoveSystemRole": "无法移除系统角色",
|
||||
"cannotShareWithSelf": "不能与自己共享主机",
|
||||
"noCustomRolesToAssign": "没有可用的自定义角色。系统角色已自动分配。",
|
||||
"auditLogs": "审计日志",
|
||||
"viewAuditLogs": "查看审计日志",
|
||||
"action": "操作",
|
||||
|
||||
@@ -1787,6 +1787,15 @@ export function AdminSettings({
|
||||
{t(role.displayName)}
|
||||
</Button>
|
||||
))}
|
||||
{availableRoles.filter(
|
||||
(role) =>
|
||||
!role.isSystem &&
|
||||
!userRoles.some((ur) => ur.roleId === role.id),
|
||||
).length === 0 && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("rbac.noCustomRolesToAssign")}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user