diff --git a/backend/src/database/repositories/userRepository.ts b/backend/src/database/repositories/userRepository.ts index 2b6adedc5..940b70ebd 100644 --- a/backend/src/database/repositories/userRepository.ts +++ b/backend/src/database/repositories/userRepository.ts @@ -384,6 +384,7 @@ export default class UserRepository { as: 'tenants', where: { tenantId: currentTenant.id, + status: 'active', }, }) } @@ -410,6 +411,15 @@ export default class UserRepository { whereAnd.push(SequelizeFilterUtils.ilikeIncludes('user', 'email', filter.email)) } + if (filter.query) { + whereAnd.push({ + [Op.or]: [ + SequelizeFilterUtils.ilikeIncludes('user', 'fullName', filter.query), + SequelizeFilterUtils.ilikeIncludes('user', 'email', filter.query), + ], + }) + } + if (filter.role) { const innerWhereAnd: Array = [] diff --git a/frontend/src/modules/admin/models/User.model.ts b/frontend/src/modules/admin/models/User.model.ts new file mode 100644 index 000000000..2c03542db --- /dev/null +++ b/frontend/src/modules/admin/models/User.model.ts @@ -0,0 +1,6 @@ +export interface UserModel { + id: string; + email: string; + fullName: string; + roles: string[]; +} diff --git a/frontend/src/modules/admin/pages/users.page.vue b/frontend/src/modules/admin/pages/users.page.vue new file mode 100644 index 000000000..be658883c --- /dev/null +++ b/frontend/src/modules/admin/pages/users.page.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/frontend/src/modules/admin/services/users.service.ts b/frontend/src/modules/admin/services/users.service.ts new file mode 100644 index 000000000..c463e0ec6 --- /dev/null +++ b/frontend/src/modules/admin/services/users.service.ts @@ -0,0 +1,17 @@ +import authAxios from '@/shared/axios/auth-axios'; +import { AuthService } from '@/modules/auth/services/auth.service'; + +export class UsersService { + static async list(query: any) { + const tenantId = AuthService.getTenantId(); + + const response = await authAxios.get( + `/tenant/${tenantId}/user`, + { + params: query, + }, + ); + + return response.data; + } +} diff --git a/frontend/src/modules/lf/segments/pages/lf-admin-panel-page.vue b/frontend/src/modules/lf/segments/pages/lf-admin-panel-page.vue index 279fd1108..ff22814c5 100644 --- a/frontend/src/modules/lf/segments/pages/lf-admin-panel-page.vue +++ b/frontend/src/modules/lf/segments/pages/lf-admin-panel-page.vue @@ -32,6 +32,9 @@ v-if="activeTab === 'audit-logs'" /> + + + @@ -53,6 +56,7 @@ import AppLfAuditLogsPage from '@/modules/lf/segments/pages/lf-audit-logs-page.v import LfDevmode from '@/modules/lf/segments/components/dev/devmode.vue'; import { LfRole } from '@/shared/modules/permissions/types/Roles'; import AppOrganizationCommonPage from '@/modules/organization/pages/organization-common-page.vue'; +import LfAdminUsers from '@/modules/admin/pages/users.page.vue'; const route = useRoute(); const router = useRouter(); diff --git a/frontend/src/ui-kit/search/Search.vue b/frontend/src/ui-kit/search/Search.vue new file mode 100644 index 000000000..3e74daa0b --- /dev/null +++ b/frontend/src/ui-kit/search/Search.vue @@ -0,0 +1,46 @@ + + + + +