Browse Source

fix: review changes

pull/7413/head
Ramesh Mane 10 months ago
parent
commit
8ef48356d0
  1. 4
      packages/nc-gui/components/project/AccessSettings.vue
  2. 4
      packages/nc-gui/components/workspace/CollaboratorsList.vue
  3. 20
      packages/nocodb/src/models/User.ts

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

@ -42,9 +42,7 @@ const accessibleRoles = ref<(typeof ProjectRoles)[keyof typeof ProjectRoles][]>(
const filteredCollaborators = computed(() => const filteredCollaborators = computed(() =>
collaborators.value.filter((collab) => collaborators.value.filter((collab) =>
collab.display_name (collab.display_name || collab.email).toLowerCase().includes(userSearchText.value.toLowerCase()),
? collab.display_name.toLowerCase().includes(userSearchText.value.toLowerCase())
: collab.email.toLowerCase().includes(userSearchText.value.toLowerCase()),
), ),
) )

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

@ -20,9 +20,7 @@ const filterCollaborators = computed(() => {
if (!collaborators.value) return [] if (!collaborators.value) return []
return collaborators.value.filter((collab) => return collaborators.value.filter((collab) =>
collab.display_name (collab.display_name || collab.email).toLowerCase().includes(userSearchText.value.toLowerCase()),
? collab.display_name.toLowerCase().includes(userSearchText.value.toLowerCase())
: collab.email.toLowerCase().includes(userSearchText.value.toLowerCase()),
) )
}) })

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

@ -194,7 +194,7 @@ export default class User implements UserType {
{ {
limit, limit,
offset, offset,
query, query = '',
}: { }: {
limit?: number | undefined; limit?: number | undefined;
offset?: number | undefined; offset?: number | undefined;
@ -229,23 +229,15 @@ export default class User implements UserType {
.as('projectsCount'), .as('projectsCount'),
); );
if (query) { if (query) {
queryBuilder queryBuilder.where(function () {
.where(function () {
this.where('email', 'like', `%${query.toLowerCase?.()}%`).orWhere(
'display_name',
'like',
`%${query.toLowerCase?.()}%`,
);
})
.where(function () {
this.where(function () { this.where(function () {
this.whereNotNull('display_name') this.whereNotNull('display_name')
.andWhereNot('display_name', '') .andWhereNot('display_name', '')
.andWhere('display_name', 'like', `%${query.toLowerCase?.()}%`); .andWhere('display_name', 'like', `%${query.toLowerCase()}%`);
}).orWhere(function () { }).orWhere(function () {
this.whereNull('display_name') this.where(function () {
.orWhere('display_name', '') this.whereNull('display_name').orWhere('display_name', '');
.andWhere('email', 'like', `%${query.toLowerCase?.()}%`); }).andWhere('email', 'like', `%${query.toLowerCase()}%`);
}); });
}); });
} }

Loading…
Cancel
Save