-
Notifications
You must be signed in to change notification settings - Fork 4
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
Look for environment-specific UIO landing URLs first #397
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,11 @@ export interface TransLineProps extends TransLineContent { | |
function resolveUrl(link: I18nString, userArrivedFromUioMobile: boolean) { | ||
// Special case for UIO homepage links. | ||
if (link === 'uio-home') { | ||
const uioHomeLink = userArrivedFromUioMobile ? getUrl('uio-home-url-mobile') : getUrl('uio-home-url-desktop') | ||
// Optional environment-specific links back to the UIO landing page, used by EDD testing | ||
const uioLandingUrl = process.env.URL_UIO_LANDING ?? getUrl('uio-home-url-desktop') | ||
const uioMobileLandingUrl = process.env.URL_UIOMOBILE_LANDING ?? getUrl('uio-home-url-mobile') | ||
|
||
const uioHomeLink = userArrivedFromUioMobile ? uioMobileLandingUrl : uioLandingUrl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Not necessary for launch, but I think this is enough logic to put it somewhere else (like in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yeah, I should have put it there. Moved! |
||
if (uioHomeLink) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rocketnova I don't understand this if statement-- is it to protect against the possibility of uio-home-url-desktop/mobile, not existing as a string? If they do exist, then uioHomeLink will always be true right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typescript will yell if we don't narrow here, because the code doesn't know those json strings definitely exist - we have a ticket to see if there's some way to assert the json strings do exist #338 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Agreed that we should know at build time, but I think the check is important in case something horrible and unexpected happens at runtime There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha, this all makes sense. Thanks! |
||
// If the link is for UIO homepage, do a direct getUrl() lookup. | ||
// Do not pass the looked up url through t() because t() will mangle the url. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.