Skip to content

feat(admin-settings): search users by user name and email as well - #3517

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/admin-settings-users-search-username-and-mail
Oct 1, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/admin-settings-users-search-username-and-mail

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Description

The user search of the admin settings only searched the display name: it sent $filter=contains(displayName,'…'), so searching for a user name or an email address returned no users (e.g. the user alex with the display name "dragan").

The Graph API of OpenCloud supports $search for users, which matches the display name, the user name and the email (substrings, case-insensitive). The search now uses it, like the user search of the share dialog in the files app (useCollaboratorSearch) already does:

What changed Why
The search term is sent as $search="…" instead of contains(displayName,'…') in $filter; the group and role filters stay in $filter Finds users by display name, user name and email. $search and $filter can be combined
The term is quoted and double quotes are removed from it Unquoted, terms with spaces, dashes or dots (Alice Han, alice-1db, web.de) are rejected with a 400; a double quote can't be escaped inside the quoted term
The search term is highlighted in the user name and email columns too, not only in the display name The matches can now be in any of these columns
Renamed the internal "display name filter" variables to "search term" They don't filter by the display name anymore. The route query stays q_displayName, so existing links keep working

#3516 moves the avatar into the user name column as well; whichever PR is merged second needs a small rebase of that cell.

Screenshots

Searching for the user name alex (display name "dragan"):

Before After
Search for alex before: no users found Search for alex after: the user is found, the term is highlighted in the user name and email

Related Issue

  • No related issue

How Has This Been Tested?

  • test environment: local pnpm vite dev server against the docker-compose backend, Playwright, unit tests with Vitest
  • test case 1: Graph API directly (read-only): $search finds users by display name, user name, email and substrings, case-insensitive, also combined with a memberOf filter; contains() on onPremisesSamAccountName or mail and or combinations return no users
  • test case 2: admin settings users search in the browser: alex (user name), drag (display name), web.de (email), Alice Han (space) and alice-1db (dash) find the expected users, the term is highlighted in the matching column
  • test case 3: new unit tests for the search request (quoted term, combined with the group filter, double quotes removed) and the highlight in all three columns; unit tests of web-app-admin-settings, pnpm check:types, lint and format pass

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear AlexAndBear self-assigned this Oct 1, 2026
@AlexAndBear AlexAndBear changed the title fix(admin-settings): search users by user name and email as well feat(admin-settings): search users by user name and email as well Oct 1, 2026
@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Oct 1, 2026
@AlexAndBear
AlexAndBear force-pushed the fix/admin-settings-users-search-username-and-mail branch from ed1eea0 to 44bc58f Compare October 1, 2026 07:45
@AlexAndBear
AlexAndBear changed the base branch from fix/admin-settings-avatar-in-name-column to main October 1, 2026 07:45
@AlexAndBear

Copy link
Copy Markdown
Member Author

wait until #3516 is merged

@AlexAndBear
AlexAndBear force-pushed the fix/admin-settings-users-search-username-and-mail branch from 44bc58f to b2cb7b4 Compare October 1, 2026 12:18
@AlexAndBear

Copy link
Copy Markdown
Member Author

wait until #3516 is merged

resolved ✅

@AlexAndBear
AlexAndBear merged commit ea72e31 into main Oct 1, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the fix/admin-settings-users-search-username-and-mail branch October 1, 2026 12:48
@openclouders openclouders mentioned this pull request Oct 1, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants