Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JN-1087] Allow proxies to join the study after the fact #897

Merged
merged 5 commits into from
May 21, 2024

Conversation

connorlbark
Copy link
Collaborator

@connorlbark connorlbark commented May 17, 2024

DESCRIPTION (include screenshots, and mobile screenshots for participant UX)

Viewing your hub page as a proxy:

image

Pre-fills proxy and name questions when you click:

image

Mobile

image

Also, disables hub page messages if you are not a subject.

TO TEST: (simple manual steps for confirming core behavior -- used for pre-release checks)

  • Repopulate demo
  • Enroll as a proxy of another user
  • Enroll yourself as a subject
  • Verify you can find yourself in the participant list
  • Verify in the admin tool that your most recent pre-enroll responses are attached

Copy link

sonarcloud bot commented May 17, 2024

@connorlbark connorlbark marked this pull request as ready for review May 17, 2024 16:37
Copy link
Collaborator

@devonbush devonbush left a comment

Choose a reason for hiding this comment

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

nice, one variable rename and some extra tests and this will be good to go

private Enrollee findOrCreateEnrolleeForEnrollment(ParticipantUser user, PortalParticipantUser ppUser, StudyEnvironment studyEnv, String studyShortcode, UUID preEnrollResponseId, boolean isSubjectEnrollment) {
return enrolleeService
.findByParticipantUserIdAndStudyEnv(user.getId(), studyShortcode, studyEnv.getEnvironmentName())
.filter(e -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's find a better name for this variable than "e" since that usual is used for "error". any reason this can't be 'enrollee'?

Enrollee proxyAfterSubjectEnroll = enrolleeService.find(proxy.getId()).orElseThrow();
assertThat(proxyAfterSubjectEnroll.isSubject(), equalTo(true));
assertThat(proxyAfterSubjectEnroll.getPreEnrollmentResponseId(), equalTo(savedResponse.getId()));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice, seems like we could use a couple of tests (or addenda to tests above) confirming that an enrollee can't enroll twice

Copy link
Member

@MatthewBemis MatthewBemis left a comment

Choose a reason for hiding this comment

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

Looks great!

@devonbush devonbush added this pull request to the merge queue May 21, 2024
Merged via the queue into development with commit 25cd846 May 21, 2024
15 checks passed
@devonbush devonbush deleted the cb-proxy-join-after-the-fact branch May 21, 2024 14:07
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.

None yet

3 participants