Browse Source

fix(user-management): show user name if present else email #2112

pull/7413/head
Ramesh Mane 11 months ago
parent
commit
c6a4bdc9de
  1. 2
      packages/nc-gui/components/account/UserList.vue
  2. 9
      packages/nc-gui/components/project/AccessSettings.vue
  3. 8
      packages/nc-gui/components/workspace/CollaboratorsList.vue
  4. 1
      packages/nocodb/src/models/User.ts

2
packages/nc-gui/components/account/UserList.vue

@ -236,7 +236,7 @@ const openDeleteModal = (user: UserType) => {
> >
<div class="text-3.5 text-start w-2/3 pl-5 flex items-center"> <div class="text-3.5 text-start w-2/3 pl-5 flex items-center">
<GeneralTruncateText length="29"> <GeneralTruncateText length="29">
{{ el.email }} {{ el.display_name || el.email }}
</GeneralTruncateText> </GeneralTruncateText>
</div> </div>
<div class="text-3.5 text-start w-1/3"> <div class="text-3.5 text-start w-1/3">

9
packages/nc-gui/components/project/AccessSettings.vue

@ -30,6 +30,7 @@ interface Collaborators {
base_roles: Roles base_roles: Roles
workspace_roles: WorkspaceUserRoles workspace_roles: WorkspaceUserRoles
created_at: string created_at: string
display_name: string | null
} }
const collaborators = ref<Collaborators[]>([]) const collaborators = ref<Collaborators[]>([])
const totalCollaborators = ref(0) const totalCollaborators = ref(0)
@ -40,7 +41,11 @@ const isSearching = ref(false)
const accessibleRoles = ref<(typeof ProjectRoles)[keyof typeof ProjectRoles][]>([]) const accessibleRoles = ref<(typeof ProjectRoles)[keyof typeof ProjectRoles][]>([])
const filteredCollaborators = computed(() => const filteredCollaborators = computed(() =>
collaborators.value.filter((collab) => collab.email.toLowerCase().includes(userSearchText.value.toLowerCase())), collaborators.value.filter((collab) =>
collab.display_name
? collab.display_name.toLowerCase().includes(userSearchText.value.toLowerCase())
: collab.email.toLowerCase().includes(userSearchText.value.toLowerCase()),
),
) )
const sortedCollaborators = computed(() => { const sortedCollaborators = computed(() => {
@ -183,7 +188,7 @@ onMounted(async () => {
<div class="flex gap-3 items-center users-email-grid"> <div class="flex gap-3 items-center users-email-grid">
<GeneralUserIcon size="base" :email="collab.email" /> <GeneralUserIcon size="base" :email="collab.email" />
<span class="truncate"> <span class="truncate">
{{ collab.email }} {{ collab.display_name || collab.email }}
</span> </span>
</div> </div>
<div class="user-access-grid"> <div class="user-access-grid">

8
packages/nc-gui/components/workspace/CollaboratorsList.vue

@ -19,7 +19,11 @@ const filterCollaborators = computed(() => {
if (!collaborators.value) return [] if (!collaborators.value) return []
return collaborators.value.filter((collab) => collab.email!.includes(userSearchText.value)) return collaborators.value.filter((collab) =>
collab.display_name
? collab.display_name.toLowerCase().includes(userSearchText.value.toLowerCase())
: collab.email.toLowerCase().includes(userSearchText.value.toLowerCase()),
)
}) })
const sortedCollaborators = computed(() => { const sortedCollaborators = computed(() => {
@ -97,7 +101,7 @@ onMounted(async () => {
<div class="flex gap-3 items-center users-email-grid w-3/8 ml-10"> <div class="flex gap-3 items-center users-email-grid w-3/8 ml-10">
<GeneralUserIcon size="base" :name="collab.email" :email="collab.email" /> <GeneralUserIcon size="base" :name="collab.email" :email="collab.email" />
<span class="truncate"> <span class="truncate">
{{ collab.email }} {{ collab.display_name || collab.email }}
</span> </span>
</div> </div>
<div class="user-access-grid w-2/8"> <div class="user-access-grid w-2/8">

1
packages/nocodb/src/models/User.ts

@ -217,6 +217,7 @@ export default class User implements UserType {
`${MetaTable.USERS}.created_at`, `${MetaTable.USERS}.created_at`,
`${MetaTable.USERS}.updated_at`, `${MetaTable.USERS}.updated_at`,
`${MetaTable.USERS}.roles`, `${MetaTable.USERS}.roles`,
`${MetaTable.USERS}.display_name`,
) )
.select( .select(
ncMeta ncMeta

Loading…
Cancel
Save