Skip to content

Also query profiles in people autocomplete#1334

Merged
fbacall merged 4 commits into
masterfrom
fix-person-autocomplete
Jul 8, 2026
Merged

Also query profiles in people autocomplete#1334
fbacall merged 4 commits into
masterfrom
fix-person-autocomplete

Conversation

@fbacall

@fbacall fbacall commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary of changes

  • When showing autocomplete suggestions for people, instead of just querying existing authors/contributors, perform a second query against TeSS profiles with authenticated ORCIDs

Motivation and context

#1294

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the people autocomplete endpoint to include results from Profile records (in addition to Person author/contributor records), to surface ORCIDs stored on TeSS profiles as requested in #1294.

Changes:

  • Add Profile.visible, Profile.starting_with, and Profile.query to support profile-backed autocomplete lookups.
  • Update AutocompleteController#people_suggestions to query both Person and Profile and merge results.
  • Add/adjust tests for profile query behavior and updated people autocomplete expectations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
app/controllers/autocomplete_controller.rb Adds a second query against Profile and merges results into the people autocomplete response.
app/models/profile.rb Introduces query helpers/scopes used by profile-backed autocomplete.
test/controllers/autocomplete_controller_test.rb Updates expected autocomplete output to account for profile-backed suggestions.
test/models/profile_test.rb Adds tests covering the new Profile.visible, starting_with, and query behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/controllers/autocomplete_controller.rb
Comment thread test/models/profile_test.rb
@fbacall
fbacall force-pushed the fix-person-autocomplete branch from 27c7256 to 7de4197 Compare July 2, 2026 12:46
@fbacall
fbacall merged commit 944c4ec into master Jul 8, 2026
11 checks passed
@fbacall
fbacall deleted the fix-person-autocomplete branch July 8, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants