Skip to content

feat: allow Visit Team Lead to Edit Visitor List#1637

Draft
shivoomiess wants to merge 10 commits into
developfrom
SWAP-5660-definevisit-button
Draft

feat: allow Visit Team Lead to Edit Visitor List#1637
shivoomiess wants to merge 10 commits into
developfrom
SWAP-5660-definevisit-button

Conversation

@shivoomiess

@shivoomiess shivoomiess commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR allows the Visit Team Lead to edit the Visitor List.

Motivation and Context

Previously, only the Proposal Investigator (PI) or Co-Proposer had the ability to edit the Visitor List. This change was required to enhance collaboration and efficiency by enabling the Visit Team Lead to also make necessary changes to the Visitor List.

Changes

  • Updated the authorization check in VisitAuthorization.ts to also allow Visit Team Leads to make changes to the Visitor List.
  • Adjusted the conditional check in useActionButtons.tsx to include Visit Team Leads in the list of roles that are allowed to edit the Visitor List.

How Has This Been Tested?

Screen.Recording.2026-07-08.at.17.11.28.mov

Fixes Jira Issue

https://jira.ess.eu//browse/SWAP-5660

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@shivoomiess
shivoomiess requested a review from a team as a code owner July 8, 2026 15:13
@shivoomiess
shivoomiess requested review from jekabs-karklins, simonfernandes and yoganandaness and removed request for a team and simonfernandes July 8, 2026 15:13

@yoganandaness yoganandaness 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.

@shivoomiess Requesting an e2e and unit(if possible).

@zacharyjhankin zacharyjhankin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Diamond is happy with this change

@shivoomiess
shivoomiess requested a review from yoganandaness July 9, 2026 12:25
@shivoomiess

Copy link
Copy Markdown
Collaborator Author

@shivoomiess Requesting an e2e and unit(if possible).

added E2E tests for both Team Lead (who should be able to view) and Regular Visitor (who should NOT be able to view the button)

let stateReason: string | null = null;

if (isPiOrCoProposer(user, event)) {
if (isPiOrCoProposer(user, event) || isTeamlead(user, event)) {

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.

suggestion: If you are TL and assign someone else to be TL you will loose the ability to change back, I wonder if we should warn the user that the aciton is irreversable by him?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

that's true. shall we send a notification popup or ...?

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.

I think you can use withConfirm HOC in the apps/frontend/src/components/proposalBooking/CreateUpdateVisit.tsx and then call confirm if the user is teamlead and not PI or Coproposer.

@zacharyjhankin
zacharyjhankin self-requested a review July 15, 2026 08:50
@yoganandaness
yoganandaness marked this pull request as draft July 20, 2026 09:24
---

Details: PI / Team Lead can read / write the visitor list. Team Lead gets a confirmation if they assign someone else as teamlead. Visitors can view the list but not edit. Co-PI can neither view nor edit the list.
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.

4 participants