bcgov / MOH-PPPP-Enrolment

Apache License 2.0
1 stars 0 forks source link

Add CSR environment variable #123

Closed stephanieharrison-maximus closed 3 years ago

stephanieharrison-maximus commented 3 years ago

Please check if the PR fulfills these requirements:

Please specify the type of change this PR introduces (Bug fix, feature addition, content update, chore, etc.):

--Add CSR environment variable checks to code --Add new route to properly redirect pages as needed --Fix resulting bugs (eg. properly update page title and consent modal after the page redirect)

Additional Notes:

Due to the size of this PR, I've included a code breakdown below to elaborate on specific changes.

--Add key to header title and consent modal to force re-render on page redirect --change this.pageTitle() and isConsentModalOpen() to be functions instead of computed values, since the computed values' caching causes bugs otherwise --add new route, commonRoutes.SPECIFIC_PAGE_NOT_FOUND to send pages instead of routing to the catch-all (I needed a specific route to check requests against in order to send them to the PageNotFound page. That way I'm not trying to intercept all routes matching /* hahaha) --change global route guard to send all requests for SPECIFIC_PAGE_NOT_FOUND directly to their destination (eg. without checking for a pay patient base URL or anything like that) --add SPA_ENV_PPPP_IS_CSR_ENABLED to spa-env-service --add checks for CSR, spa env variables to ClaimCountPage page load, redirect to SPECIFIC_PAGE_NOT_FOUND if needed

stephanieharrison-maximus commented 3 years ago

Right after I opened this, the thought occurred to me that the ClaimCountPage created() functions for Pay Patient and Pay Prac could probably use more unit tests (right now it only checks for logService being called). I can work on that more tomorrow, but please let me know if there's anything else I need to fix before I can deploy this, since the testing team would appreciate this getting out the door as soon as possible