Skip to content

Fix creating a batch of agents across divisions with the QueryComboBox#7802

Merged
acwhite211 merged 7 commits intomainfrom
issue-2405-new
Mar 18, 2026
Merged

Fix creating a batch of agents across divisions with the QueryComboBox#7802
acwhite211 merged 7 commits intomainfrom
issue-2405-new

Conversation

@acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Mar 12, 2026

Fixes #2405

Fixed a few issues found when creating a batch of agents across divisions with the QueryComboBox.

Fixed cross-division Agent creation from the QueryComboBox. New resources were defaulting to the logged-in collection’s scope, which caused agents created in the popup to land in the wrong division. When forceCollection is set, new Agent records are explicitly scoped to that target collection’s division.

Use scoped creation for both “+” and typed-create paths. Search was correctly using forceCollection, but creation path wasn’t. Create behavior now matches search scoping.

The agent already set in the new Specify user form was blank when opening the “Set User Agents” dialog box opened. I made a change to ensure that the division that the user was set to, via the collection it was assigned to, defaults to that value in the QueryComboBox.

Lastly, I went through to find where in both the front-end and back-end where a user was assumed to just have one agent. Where those instances were found, a solution of considering the user having multiple agents was addressed. In addition to this, the security of a user having permission to add/access agents in different divisions was also validated.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list

Testing instructions

  • Use a database with multiple divisions.
  • Go to the "Security and Accounts Page".
  • Create a new Specify user in the institution.
  • Choose a collection that resides in a different division than the division of the currently logged-in collection.
  • Select "Institution Admin".
  • Create a new Agent.
  • Set the "User Group" to "Manager".
  • Click the "Save" button.
  • See that the "Set User Agents" window appears, and the QueryComboBox for the division of the collection set for the user is already defaulted to the new agent.
  • Add new agents using the QueryComboBox for each division.
  • Click the "Save" button for the "Set User Agents" window.
  • Click the "Save" button to create the new Specify user.
  • Check the database to see all the new agents got created for each of the divisions.
SCR-20260311-nukq SCR-20260311-nvhp SCR-20260311-nvts SCR-20260311-nxjv SCR-20260311-nxrc SCR-20260311-nxvg SCR-20260311-nyfw

@grantfitzsimmons grantfitzsimmons added this to the 7.12.1 milestone Mar 17, 2026
Triggered by bf832ab on branch refs/heads/issue-2405-new
@acwhite211 acwhite211 marked this pull request as ready for review March 17, 2026 21:51
@acwhite211 acwhite211 requested review from a team and grantfitzsimmons March 17, 2026 21:51
Copy link
Contributor

@alesan99 alesan99 left a comment

Choose a reason for hiding this comment

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

  • See that the "Set User Agents" window appears, and the QueryComboBox for the division of the collection set for the user is already defaulted to the new agent.
  • Check the database to see all the new agents got created for each of the divisions.

Works as expected 👍👍
I was able to successfully log in the the new collection in a different division too. QCBXs also work as normal in other contexts as well.

Image Image Image

@alesan99 alesan99 requested a review from a team March 18, 2026 14:09
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • See that the "Set User Agents" window appears, and the QueryComboBox for the division of the collection set for the user is already defaulted to the new agent.
  • Check the database to see all the new agents got created for each of the divisions.

Looks good, I was able to log into the new user in every division.

@CarolineDenis CarolineDenis removed the request for review from grantfitzsimmons March 18, 2026 19:49
@Iwantexpresso Iwantexpresso self-requested a review March 18, 2026 19:51
Copy link
Contributor

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

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

  • See that the "Set User Agents" window appears, and the QueryComboBox for the division of the collection set for the user is already defaulted to the new agent.

  • Check the database to see all the new agents got created for each of the divisions.

nice work!

@acwhite211 acwhite211 merged commit 147d6fd into main Mar 18, 2026
14 checks passed
@acwhite211 acwhite211 deleted the issue-2405-new branch March 18, 2026 21:02
@github-project-automation github-project-automation bot moved this from 📋Back Log to ✅Done in General Tester Board Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Cannot set batch of agents for collection access

6 participants