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">
<GeneralTruncateText length="29">
{{ el.email }}
{{ el.display_name || el.email }}
</GeneralTruncateText>
</div>
<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
workspace_roles: WorkspaceUserRoles
created_at: string
display_name: string | null
}
const collaborators = ref<Collaborators[]>([])
const totalCollaborators = ref(0)
@ -40,7 +41,11 @@ const isSearching = ref(false)
const accessibleRoles = ref<(typeof ProjectRoles)[keyof typeof ProjectRoles][]>([])
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(() => {
@ -183,7 +188,7 @@ onMounted(async () => {
<div class="flex gap-3 items-center users-email-grid">
<GeneralUserIcon size="base" :email="collab.email" />
<span class="truncate">
{{ collab.email }}
{{ collab.display_name || collab.email }}
</span>
</div>
<div class="user-access-grid">

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

@ -19,7 +19,11 @@ const filterCollaborators = computed(() => {
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(() => {
@ -97,7 +101,7 @@ onMounted(async () => {
<div class="flex gap-3 items-center users-email-grid w-3/8 ml-10">
<GeneralUserIcon size="base" :name="collab.email" :email="collab.email" />
<span class="truncate">
{{ collab.email }}
{{ collab.display_name || collab.email }}
</span>
</div>
<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}.updated_at`,
`${MetaTable.USERS}.roles`,
`${MetaTable.USERS}.display_name`,
)
.select(
ncMeta

Loading…
Cancel
Save