diff --git a/frontend/web/components/EditPermissions.tsx b/frontend/web/components/EditPermissions.tsx index 229f6afaa0c3..60ac4455afe7 100644 --- a/frontend/web/components/EditPermissions.tsx +++ b/frontend/web/components/EditPermissions.tsx @@ -804,6 +804,19 @@ const _EditPermissionsModal: FC = withAdminPermissions( }) } + const getEditText = () => { + if (isGroup) { + return `the ${group?.name || ''} group` + } + if (user) { + return `${user.first_name || ''} ${user.last_name || ''}` + } + if (role) { + return role.name + } + return name + } + const rolesAdded = getRoles(roles, rolesSelected || []) const isAdmin = admin() @@ -917,20 +930,7 @@ const _EditPermissionsModal: FC = withAdminPermissions(

This will edit the permissions for{' '} - - {isGroup ? ( - `the ${group?.name || ''} group` - ) : user ? ( - <> - {user.first_name || ''} {user.last_name || ''} - - ) : role ? ( - ` ${role.name}` - ) : ( - ` ${name}` - )} - - . + {getEditText()}.

{!!parentWarning && ( diff --git a/frontend/web/components/PermissionsTabs.tsx b/frontend/web/components/PermissionsTabs.tsx index 0749ce796f60..c74e0aaa6ed1 100644 --- a/frontend/web/components/PermissionsTabs.tsx +++ b/frontend/web/components/PermissionsTabs.tsx @@ -173,6 +173,10 @@ const PermissionsTabs: FC = ({ /> )} +

+ This will edit the permissions for{' '} + the {group?.name} group. +

diff --git a/frontend/web/components/RolePermissionsList.tsx b/frontend/web/components/RolePermissionsList.tsx index 04cf7c7ada6b..01191a27039f 100644 --- a/frontend/web/components/RolePermissionsList.tsx +++ b/frontend/web/components/RolePermissionsList.tsx @@ -6,7 +6,7 @@ import { useGetRoleProjectPermissionsQuery, } from 'common/services/useRolePermission' import { PermissionLevel } from 'common/types/requests' -import { Role, User, UserGroup, UserGroupSummary } from 'common/types/responses' +import { Role, User, UserGroupSummary } from 'common/types/responses' import PanelSearch from './PanelSearch' import PermissionsSummaryList from './PermissionsSummaryList' diff --git a/frontend/web/components/modals/CreateRole.tsx b/frontend/web/components/modals/CreateRole.tsx index 579437cfab30..f23d439c5ba5 100644 --- a/frontend/web/components/modals/CreateRole.tsx +++ b/frontend/web/components/modals/CreateRole.tsx @@ -511,6 +511,9 @@ const CreateRole: FC = ({ ))} +

+ This will edit the members for {role?.name}. +