From 8b6e8ecfd7e3e2a75c214c23fcae7f47f701f11c Mon Sep 17 00:00:00 2001 From: "marcel.kocisek" Date: Fri, 8 Nov 2024 16:27:30 +0100 Subject: [PATCH 1/3] Allow searching users based on first name and last name --- server/mergin/auth/controller.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/mergin/auth/controller.py b/server/mergin/auth/controller.py index 42d84714..cd686203 100644 --- a/server/mergin/auth/controller.py +++ b/server/mergin/auth/controller.py @@ -23,7 +23,7 @@ user_account_closed, ) from .bearer import encode_token -from .models import User, LoginHistory +from .models import User, LoginHistory, UserProfile from .schemas import UserSchema, UserSearchSchema, UserProfileSchema, UserInfoSchema from .forms import ( LoginForm, @@ -449,13 +449,16 @@ def get_paginated_users( :rtype: Dict[str: List[User], str: Integer] """ - users = User.query.filter( + users = User.query.join(UserProfile).filter( is_(User.username.ilike("deleted_%"), False) | is_(User.active, True) ) if like: users = users.filter( - User.username.ilike(f"%{like}%") | User.email.ilike(f"%{like}%") + User.username.ilike(f"%{like}%") + | User.email.ilike(f"%{like}%") + | UserProfile.first_name.ilike(f"%{like}%") + | UserProfile.last_name.ilike(f"%{like}%") ) if descending and order_by: From f091e7393f23996dd2984bb61d2dac458c427d43 Mon Sep 17 00:00:00 2001 From: "marcel.kocisek" Date: Fri, 8 Nov 2024 16:27:57 +0100 Subject: [PATCH 2/3] Addressing comments for admin redesign @tomasMizera --- web-app/packages/admin-app/index.html | 2 +- .../src/modules/layout/components/Sidebar.vue | 2 +- .../admin-lib/src/modules/admin/adminApi.ts | 5 +- .../admin/components/AccountsTable.vue | 6 +- .../admin/components/AdminProjectsTable.vue | 65 +++++++++++---- .../admin-lib/src/modules/admin/store.ts | 7 +- .../modules/admin/views/AccountDetailView.vue | 82 +++++++++++++++---- .../admin/views/ProjectSettingsView.vue | 3 +- .../admin/views/ProjectVersionView.vue | 14 +++- .../src/modules/admin/views/ProjectView.vue | 30 ++++++- .../src/modules/admin/views/SettingsView.vue | 7 +- .../lib/src/assets/warning-dialog.svg | 27 ++++++ .../dialog/components/ConfirmDialog.vue | 7 +- .../packages/lib/src/modules/dialog/types.ts | 2 +- .../layout/components/AppHeaderTemplate.vue | 6 +- 15 files changed, 213 insertions(+), 52 deletions(-) create mode 100644 web-app/packages/lib/src/assets/warning-dialog.svg diff --git a/web-app/packages/admin-app/index.html b/web-app/packages/admin-app/index.html index e4efe3b2..afdb9b39 100644 --- a/web-app/packages/admin-app/index.html +++ b/web-app/packages/admin-app/index.html @@ -11,7 +11,7 @@ - Mergin Maps + Mergin Maps Admin Panel