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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG-12829: add conditional links for selfie help center articles #10415

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

amirbey
Copy link
Contributor

@amirbey amirbey commented Apr 11, 2024

馃帿 Ticket

Link to the relevant ticket:
LG-12829

馃洜 Summary of changes

Add a link to the error message that directs the user to the help center when selfie match fails.

馃摐 Testing Plan

  • Fail doc auth with selfie due to a liveness failure in the portrait match and observe the link routes to the Doc Auth content in the help center and the destination link contains the anchor (Note: the anchored content will not be deployed to login.gov help center until selfie go live)
  • Fail doc auth with selfie due to a portrait match failure and observe the link routes to the Doc Auth content in the help center

馃憖 Screenshots

Liveness: LG-12903-liveness-en LG-12903-liveness-es LG-12903-liveness-fr
FaceMatch: LG-12903-pm-fail-en LG-12903-pm-fail-es LG-12903-pm-fail-fr

@amirbey amirbey self-assigned this Apr 11, 2024
let selfieHelpCenterLink = helpCenterLink;
let selfieHelpCenterLinkText = t('doc_auth.errors.general.selfie_failure_help_link_text');
if (isFailedSelfieLivenessOrQuality) {
selfieHelpCenterLink += '#anchor'
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT of using a URL object to parse + manipulate this?

Suggested change
selfieHelpCenterLink += '#anchor'
const helpCenterURL = new URL(helpCenterLink)
helpCenterURL.hash = 'anchor';
selfieHelpCenterLink = helpCenterURL.toString();

Copy link
Member

Choose a reason for hiding this comment

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

We also have a similar abstraction addSearchParams. I could imagine abstracting a similar addHashAnchor or generalized addParams if we wanted to have a simple one-liner tool available, if we think this is a common pattern.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another thought, having this URL be an anchor is maybe just an implementation detail? What if both URLs were passed from the server as configs? Simplifies the frontend logic

@amirbey amirbey requested review from a team, charleyf and dawei-nava and removed request for a team April 13, 2024 01:35
@amirbey amirbey changed the title add conditional links for selfie help center articles LG-12829: add conditional links for selfie help center articles Apr 13, 2024
@amirbey amirbey marked this pull request as ready for review April 13, 2024 01:41
Copy link
Contributor

@dawei-nava dawei-nava left a comment

Choose a reason for hiding this comment

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

LGTM

@amirbey amirbey force-pushed the amirbey/LG-12829-selfie-help-center-articles branch from eb3705e to 70f69b1 Compare April 15, 2024 19:01
@amirbey amirbey merged commit 8074c00 into main Apr 15, 2024
2 checks passed
@amirbey amirbey deleted the amirbey/LG-12829-selfie-help-center-articles branch April 15, 2024 19:42
@mitchellhenke mitchellhenke mentioned this pull request Apr 16, 2024
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

4 participants