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

Look for environment-specific UIO landing URLs first #397

Merged
merged 3 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ relates to weekly certification
- CERTIFICATE_DIR: The path to the client certificate (certificate must be in PFX/P12 format)
- PFX_FILE: The name of the client certificate file
- (Optional) PFX_PASSPHRASE: The import passphrase for the client certificate if there is one
- (Optional) URL_UIO_LANDING, URL_UIOMOBILE_LANDING: The environment-specific links to the UIO and UIO Mobile landing pages

For local development:

Expand Down
4 changes: 4 additions & 0 deletions utils/getUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export type UrlType = keyof typeof urls
* Get url from urls.json
*/
export default function getUrl(linkKey: string): string | undefined {
// Optional environment-specific links back to the UIO landing page, used by EDD testing
if (linkKey === 'uio-home-url-desktop' && process.env.URL_UIO_LANDING) return process.env.URL_UIO_LANDING
if (linkKey === 'uio-home-url-mobile' && process.env.URL_UIOMOBILE_LANDING) return process.env.URL_UIOMOBILE_LANDING

// Explicitly cast to one of the allowed keys in urls.json.
// If the key does not exist in urls.json, this function will return undefined.
const key = linkKey as UrlType
Expand Down