Skip to content

[JN-1665 & JN-1668] fix invitation process for proxies and non-english enrollees #1597

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

Merged
merged 5 commits into from
Apr 24, 2025

Conversation

connorlbark
Copy link
Collaborator

@connorlbark connorlbark commented Apr 18, 2025

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

Now, invitations will prefill properly for proxies. Also, preferredLanguage will propagate to the proxy, which will now also be maintained across the import/invitation process.

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

  • import this spanish enrollee with proxy:
    2025-04-18-enrollees.tsv.zip
    (if on demo server search and replace [email protected] with your email)
  • send invitation email to imported governed user
  • observe that it prefills with the correct email (no -prox-ASDF) and in the correct language
  • observe upon landing that it shows the correct language

Comment on lines +34 to +40
useEffect(() => {
if (profile && profile.preferredLanguage && selectedLanguage !== profile.preferredLanguage) {
changeLanguage(profile.preferredLanguage)
reloadPortal()
}
}, [profile?.preferredLanguage, selectedLanguage, changeLanguage])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So, if you logged into a user who has never been to Juniper before, they won't have the right preferred language in session storage. It takes a full refresh for it to populate - for some reason. Everything related to managing language state seems to be a can of worms, so this was my perhaps hamfisted solution to make sure it is synced on initial load.

@connorlbark connorlbark marked this pull request as ready for review April 18, 2025 19:01

private String removeProxySuffix(String email) {
// if the email ends with -prox-XXXX, remove it
Pattern proxySuffix = Pattern.compile("-prox-[A-Z]{4}$");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about getting the email from the main account... but it made EnrolleeContext more complicated and it's already gotten really big.

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 put this method in RegistrationService so that the correlation between it and getGovernedUsername is more overt. (or consider moving both to a ProxyUsernameUtils or somesuch)

@connorlbark connorlbark merged commit cd98392 into development Apr 24, 2025
18 checks passed
@connorlbark connorlbark deleted the cb-proxy-invitations branch April 24, 2025 17:35
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