Skip to content

feat: allow inviting Data Access Users to Proposal with email#1615

Open
shivoomiess wants to merge 18 commits into
developfrom
SWAP-5408-invite-DAU
Open

feat: allow inviting Data Access Users to Proposal with email#1615
shivoomiess wants to merge 18 commits into
developfrom
SWAP-5408-invite-DAU

Conversation

@shivoomiess

@shivoomiess shivoomiess commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR introduces the capability to invite data access users to a proposal by creating a new data access claim.

Motivation and Context

This change is required to allow data access users to be linked directly to proposals, enabling them to view and manipulate data related to the proposal they are invited to. This enhances collaboration and data management in the project.

Changes

  1. A new table 'data_access_claims' is created in the database to store the data access user claims.
  2. The 'DataAccessClaimDataSource' token is added to various configuration files to enable the data access claim functionality across different environments.
  3. The 'DataAccessClaimDataSource' is mapped to 'PostgresDataAccessClaimDataSource' in the dependency configuration files to tie the functionality with the PostgreSQL database.
  4. GraphQL queries and mutations have been added on the frontend and backend for getting / setting DAU email invites.
  5. The read/write path for creating invites has been mirrored from the existing code for Co Proposer Invites and corresponding mutations have been added.
  6. On the frontend Proposal Summary page, we now see invited emails inline for both Co-Proposers and Data Access Users instead of a separate row for only co-proposers.

How Has This Been Tested?

Fixes Jira Issue

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

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 June 30, 2026 14:37
@shivoomiess shivoomiess requested review from simonfernandes and removed request for a team June 30, 2026 14:37
@shivoomiess shivoomiess changed the title feat: Invite Data Access Users to Proposal feat: allow inviting Data Access Users to Proposal with email Jun 30, 2026

@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 Kindly attach relevant video or screenshot

Comment thread apps/backend/src/datasources/postgres/records.ts Outdated
Comment thread apps/backend/src/datasources/postgres/DataAccessUsersDataSource.ts Outdated
user_id: userId,
};

await trx('data_access_user_has_proposal')

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.

Recommend to test

Comment thread apps/backend/src/datasources/DataAccessUsersDataSource.ts

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

  1. kindly test all pieces of change
  2. Attach video or pic if possible
  3. Pls have clean diff

Comment thread apps/backend/src/eventHandlers/logging.ts
Comment thread apps/backend/src/eventHandlers/email/essEmailHandler.ts
Comment thread apps/backend/src/mutations/InviteMutations.ts

@jekabs-karklins jekabs-karklins 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.

Over all looks very good :raisedhands:
As this is a bigger PR I think you will get a bit more comments :).

I have checked the PR and left some comments, and Happy to chat if any help or clarification needed.

Comment thread apps/backend/src/queries/InviteQueries.ts Outdated
Comment thread apps/backend/src/eventHandlers/email/essEmailHandler.ts Outdated
);
// already a data access user
if (isDataAccessUser) {
return;

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: although not a real world use case for now, can we have a continue here? If at some point there are two data access claims attached to the invite and for the first claim isDataAccessUser is already true, the second will not be avaluated

@shivoomiess shivoomiess left a comment

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.

incorporated feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants