Skip to content

Add user picker for 'Assign to user' option in Guacamole Windows and Linux VM create forms - #5053

Closed
Jonny Rylands (jonnyry) wants to merge 1 commit into
microsoft:mainfrom
jonnyry:feature/user-picker
Closed

Add user picker for 'Assign to user' option in Guacamole Windows and Linux VM create forms#5053
Jonny Rylands (jonnyry) wants to merge 1 commit into
microsoft:mainfrom
jonnyry:feature/user-picker

Conversation

@jonnyry

Copy link
Copy Markdown
Collaborator

This pull request introduces a user-friendly user picker for the "Assign to user" option in the Guacamole Windows and Linux VM creation forms. The main enhancement is the addition of a WorkspaceUserPicker widget, which allows users to select from a list of workspace users instead of manually entering a user ID. This improves usability and reduces errors when assigning VMs.

User Assignment Improvements:

  • Added a WorkspaceUserPicker widget to the Guacamole Windows and Linux VM resource forms, allowing users to select a workspace user from a dropdown instead of entering an Object ID. (ui/app/src/components/shared/create-update-resource/WorkspaceUserPickerWidget.tsx, templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/template_schema.json, templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/template_schema.json, [1] [2] [3]
  • Updated the owner_id property in the VM templates to use the new user picker, including schema and UI changes for better validation and display. (templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/template_schema.json, templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/template_schema.json, [1] [2]

UI and Integration Updates:

  • Passed necessary context (workspaceId, workspaceApplicationIdURI) through form components to support the user picker widget. (ui/app/src/components/shared/create-update-resource/CreateUpdateResource.tsx, ui/app/src/components/shared/create-update-resource/ResourceForm.tsx, [1] [2] [3]
  • Registered the new widget with the form library to ensure it is rendered where specified in the UI schema. (ui/app/src/components/shared/create-update-resource/ResourceForm.tsx, ui/app/src/components/shared/create-update-resource/ResourceForm.tsxR13-R17)

Versioning and Documentation:

  • Bumped version numbers for the affected templates and UI package to reflect the changes. (templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/porter.yaml, templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/porter.yaml, ui/app/package.json, ui/app/package-lock.json, [1] [2] [3] [4]
  • Updated the changelog to document the new user picker enhancement. (CHANGELOG.md, CHANGELOG.mdR6)

Copilot AI balanced review requested due to automatic review settings August 20, 2026 20:49
@jonnyry
Jonny Rylands (jonnyry) requested a review from a team as a code owner August 20, 2026 20:49
@jonnyry
Jonny Rylands (jonnyry) marked this pull request as draft August 20, 2026 20:50

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

Adds a workspace-user picker to Guacamole VM creation forms, replacing manual owner ID entry.

Changes:

  • Adds and integrates WorkspaceUserPicker.
  • Updates Linux/Windows VM schemas for user selection.
  • Bumps component versions and updates the changelog.

Reviewed changes

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

Show a summary per file
File Description
WorkspaceUserPickerWidget.tsx Adds the workspace-user dropdown.
ResourceForm.tsx Registers the widget and passes workspace context.
CreateUpdateResource.tsx Supplies the workspace ID to forms.
ui/app/package.json Bumps the UI version.
ui/app/package-lock.json Synchronizes the UI lockfile version.
Windows template_schema.json Configures the owner picker.
Windows porter.yaml Bumps the bundle version.
Linux template_schema.json Configures the owner picker.
Linux porter.yaml Bumps the bundle version.
CHANGELOG.md Documents the enhancement.
Files not reviewed (1)
  • ui/app/package-lock.json: Generated file

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

userPrincipalName: string;
}

export const WorkspaceUserPickerWidget: React.FunctionComponent<WidgetProps> = (props) => {
schemaVersion: 1.0.0
name: tre-service-guacamole-linuxvm
version: 1.4.5
version: 1.4.6
schemaVersion: 1.0.0
name: tre-service-guacamole-windowsvm
version: 3.0.2
version: 3.0.3
Comment thread ui/app/package.json
{
"name": "tre-ui",
"version": "0.8.31",
"version": "0.8.32",
@github-actions

Copy link
Copy Markdown

Unit Test Results

241 tests   241 ✅  16s ⏱️
 27 suites    0 💤
  1 files      0 ❌

Results for commit 9333d0c.

@marrobi

Copy link
Copy Markdown
Member

Jonny Rylands (@jonnyry)


This repo already has an established pattern for user selection that scales well — see WorkspaceUsersAssignNew.tsx, which uses Fluent UI's NormalPeoplePicker with an onResolveSuggestions resolver that queries the server-side filtered assignable-users endpoint (?filter=...&maxResultCount=...).

The new WorkspaceUserPickerWidget here instead loads the full workspaces/{id}/users list into a ComboBox. That works for small workspaces, but with, say, 1000 users it means downloading the whole list up-front, prefix-only client-side filtering, and rendering all options without virtualization — and if that endpoint is paginated, some users would silently be missing.

Could we reuse the NormalPeoplePicker + assignable-users approach for consistency and scalability?

One thing to confirm: assignable-users is on the TRE-admin router while users is on the shared (owner/researcher/airlock manager/admin) router — so if this widget needs to work for non-admin roles, that permissions difference may be why users was chosen. Worth clarifying the intended audience for this form.

@jonnyry

Copy link
Copy Markdown
Collaborator Author

Jonny Rylands (Jonny Rylands (@jonnyry))

This repo already has an established pattern for user selection that scales well — see WorkspaceUsersAssignNew.tsx, which uses Fluent UI's NormalPeoplePicker with an onResolveSuggestions resolver that queries the server-side filtered assignable-users endpoint (?filter=...&maxResultCount=...).

The new WorkspaceUserPickerWidget here instead loads the full workspaces/{id}/users list into a ComboBox. That works for small workspaces, but with, say, 1000 users it means downloading the whole list up-front, prefix-only client-side filtering, and rendering all options without virtualization — and if that endpoint is paginated, some users would silently be missing.

Could we reuse the NormalPeoplePicker + assignable-users approach for consistency and scalability?

One thing to confirm: assignable-users is on the TRE-admin router while users is on the shared (owner/researcher/airlock manager/admin) router — so if this widget needs to work for non-admin roles, that permissions difference may be why users was chosen. Worth clarifying the intended audience for this form.

Hi Marcus

sure, no problem - I'll take it away and have another go. Not modded the UI in this project before so I don't (yet) know all the norms!

I'll close this PR for now and reopen a new one later.

cheers
Jonny

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.

3 participants