Skip to content

TK-66: Search the Active Directory for the ISA Manager Contact - #69

Merged
burkkyy merged 2 commits into
mainfrom
tk-66/show-users-from-directory-when-searching-for-manager-while-creating-an-isa
Sep 5, 2026
Merged

TK-66: Search the Active Directory for the ISA Manager Contact#69
burkkyy merged 2 commits into
mainfrom
tk-66/show-users-from-directory-when-searching-for-manager-while-creating-an-isa

Conversation

@burkkyy

@burkkyy burkkyy commented Sep 5, 2026

Copy link
Copy Markdown
Member

Fixes https://yg-hpw.atlassian.net/browse/TK-66

Context

When creating or editing an Information Sharing Agreement, the Manager contact must be searchable from the Active Directory so any Yukon Government employee can be named on the agreement — without being granted access to the agreement's group.

Previously the Manager field only searched existing app users, so employees who had never signed in could not be selected.

Implementation

  1. Search the full Active Directory when naming the YG Manager contact on an Information Sharing Agreement, on both the create and edit forms.
  2. Prefill the Manager field with the current contact when editing an existing agreement.
  3. Resolve the selected Manager to an internal user record before saving — reusing the existing user when one already exists and creating one from the directory otherwise — and store the agreement against that user id.
  4. Keep the Manager out of the agreement's group, so naming someone as Manager never grants them access to the agreement.

The agreement endpoints stay id-based; the client resolves the chosen directory email to a user through a dedicated directory-user endpoint, keeping the resolution out of the agreement controller.

Screenshots

2026-09-04_14-52

Testing Instructions

  1. Run the test suite via dev test.
  2. Boot the app via dev up.
  3. Log in to the app at http://localhost:3000.
  4. Navigate to Information Sharing Agreements and start a new agreement.
  5. In the Yukon Government (YG) Manager Contact Name field, search for a Yukon Government employee and select them. Verify the field accepts a directory result, not only existing app users.
  6. Complete the remaining required fields and save. Verify the agreement is created and the selected Manager is not added to the agreement's group.
  7. Open the agreement's basic information for editing. Verify the Yukon Government (YG) Manager Contact Name field prefills with the previously selected Manager.

The ISA Manager (secondary contact) field now searches the Yukon
Government directory instead of existing app users, so any employee can
be named on the contract. The client submits the selected email; the
controller resolves it to an internal user (creating one from the
directory when missing) and stores its id. Group creation already
excludes this contact, so the Manager never gains group admin or
membership. See TK-66.

See https://yg-hpw.atlassian.net/browse/TK-66
@burkkyy burkkyy self-assigned this Sep 5, 2026
@burkkyy burkkyy changed the title TK-66: Search the Active Directory for the ISA Manager contact TK-66: Search the Active Directory for the ISA Manager Contact Sep 5, 2026
Why? The internalGroupSecondaryContactEmail write-side field spread directory
resolution across the ISA controller, policy, and serializer for a value that is
not a real column.

The ISA endpoints accept internalGroupSecondaryContactId again. The client
resolves the selected directory email to an internal user through the new
POST /api/users/directory-users endpoint before saving, and prefills the edit
form by looking the contact up by id. External users cannot reach the new
endpoint, matching who may author an agreement.

See https://yg-hpw.atlassian.net/browse/TK-66
@burkkyy burkkyy added the enhancement New feature or request label Sep 5, 2026
@burkkyy
burkkyy marked this pull request as ready for review September 5, 2026 03:28
@burkkyy
burkkyy merged commit ec849bf into main Sep 5, 2026
3 checks passed
@burkkyy
burkkyy deleted the tk-66/show-users-from-directory-when-searching-for-manager-while-creating-an-isa branch September 5, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant