Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
dc33d8c
Add the Card and CardGroup components
kris-szlapa Dec 9, 2024
6f51f5c
Add CardStrings and update EpsCard file
kris-szlapa Dec 9, 2024
0bbe22b
Add an address to the EpsCard component
kris-szlapa Dec 9, 2024
1a63585
Add the contentinfo section
kris-szlapa Dec 9, 2024
6009488
Merge branch 'main' into AEA-4651-roles-with-access
anthony-nhs Dec 10, 2024
1a9e344
Merge branch 'main' into AEA-4651-roles-with-access
anthony-nhs Dec 10, 2024
76049ea
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 11, 2024
82ac2b8
Defined a EpsCardProps interface
kris-szlapa Dec 11, 2024
fa62f5d
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 12, 2024
dc16be1
Add roles without access table
wildjames Dec 12, 2024
53746bc
Merge branch 'AEA-4651-roles-with-access' into aea-4653-roles-without…
wildjames Dec 12, 2024
eb4069d
Use @ imports
wildjames Dec 12, 2024
2bc4192
Use string constants for page text
wildjames Dec 12, 2024
590f3ce
Fix tests
wildjames Dec 12, 2024
3d891e7
Fix test
wildjames Dec 12, 2024
be2b18a
Expand coverage
wildjames Dec 12, 2024
b1e9d58
New: [AEA-0000] - Synchronise Jim and Kris (#252)
wildjames Dec 12, 2024
312c551
Exclude tests from duplication checks
wildjames Dec 12, 2024
45fc5ea
Ignore test files when checking code duplication
wildjames Dec 12, 2024
0949e63
Expand test coverage
wildjames Dec 12, 2024
3380a27
Push some minor changes
wildjames Dec 12, 2024
fad2428
Correctly extract TUI data from response
wildjames Dec 13, 2024
9769dff
Add local dev option to use real API backend
wildjames Dec 13, 2024
ec41aca
Remove test data. Document environment variables
wildjames Dec 13, 2024
75750c8
Add test coverage for the new page
wildjames Dec 13, 2024
e3c012b
Add error messages and update nextConfig
kris-szlapa Dec 13, 2024
79666be
Use new regression test branch
wildjames Dec 13, 2024
55a9a71
Prevent the useEffect logic from running when the auth?.isSignedIn va…
kris-szlapa Dec 13, 2024
32087d5
Set the REGRESSION_TESTS_REPO_TAG environment variable to the branch …
kris-szlapa Dec 13, 2024
df95f78
Update cards for roles with access with data from tracker user info
kris-szlapa Dec 13, 2024
14b45be
Amend the card styling
kris-szlapa Dec 14, 2024
fc652ba
Change the header size
kris-szlapa Dec 14, 2024
3935103
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 15, 2024
df74446
Update tests for the selectyourrole page
kris-szlapa Dec 15, 2024
317c164
Rename the module AuthContext to AuthProvider and add tests
kris-szlapa Dec 16, 2024
b0ebd39
Amend paths to the AuthProvider file
kris-szlapa Dec 16, 2024
80d6d8e
Add and reorder tests for the AuthProvider
kris-szlapa Dec 16, 2024
96deba1
Add tests for the selectyourrole page
kris-szlapa Dec 16, 2024
9598e82
Simplyfy tests for selectyorrole page
kris-szlapa Dec 16, 2024
62429d6
Merge branch 'main' into AEA-4651-roles-with-access
kris-szlapa Dec 16, 2024
315b21f
Merge branch 'main' into aea-4653-roles-without-access
wildjames Dec 16, 2024
6e6a514
loading by default
wildjames Dec 16, 2024
f35304a
Merge branch 'aea-4653-roles-without-access' of github.com:NHSDigital…
wildjames Dec 16, 2024
61849e8
loading by default
wildjames Dec 16, 2024
bbff3cd
Merge branch 'aea-4563-aea-4513-combined' into AEA-4651-roles-with-ac…
wildjames Dec 17, 2024
8c665df
These tests still need resolving
wildjames Dec 17, 2024
9a84707
Refactor selectyourrole tests
kris-szlapa Dec 17, 2024
2cd9fff
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 17, 2024
fc86e5d
Update tests
wildjames Dec 17, 2024
bf2f902
Rename the card strings variable to SELECT_YOUR_ROLE_PAGE_TEXT
kris-szlapa Dec 18, 2024
3c9cc19
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 18, 2024
842ff85
Amend the yourselectedrole page link
kris-szlapa Dec 18, 2024
9176b96
Chat with Jess about small changes
wildjames Dec 18, 2024
76e5793
Remove tags
wildjames Dec 18, 2024
fae097b
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 18, 2024
0553e02
Point the REGRESSION_TESTS_REPO_TAG to the main branch
kris-szlapa Dec 18, 2024
bbd80a1
Merge branch 'aea-4563-aea-4513-combined' of https://github.com/NHSDi…
kris-szlapa Dec 18, 2024
eb09ab4
Set the REGRESSION_TESTS_REPO_TAG to v2.2.1
kris-szlapa Dec 18, 2024
c951f00
Add data-testid eps_header_selectYourRole attribute
kris-szlapa Dec 18, 2024
7e603bb
Add span element and nhsuk-title class attribute
kris-szlapa Dec 19, 2024
da2e685
Change the class to className attribute
kris-szlapa Dec 19, 2024
e7017b3
Use absolute import
wildjames Dec 19, 2024
c71332f
Some CSS changes, post review
wildjames Dec 20, 2024
cc08c04
Update tests
wildjames Dec 20, 2024
27a2970
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 20, 2024
3419fa8
Merge branch 'main' of https://github.com/NHSDigital/eps-prescription…
kris-szlapa Dec 20, 2024
3b82e00
Changes based on group review
wildjames Dec 20, 2024
e587993
Update unit tests
wildjames Dec 20, 2024
bf62856
Merge branch 'aea-4563-aea-4513-combined' of github.com:NHSDigital/ep…
wildjames Dec 20, 2024
2cbafa6
Alter wording
wildjames Dec 20, 2024
d0f24c1
Fix wording
wildjames Dec 20, 2024
a381b6c
Fix wording
wildjames Dec 20, 2024
5461a8e
Refactor tests
wildjames Dec 20, 2024
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 .vscode/eps-prescription-tracker-ui.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"venv",
"versionable",
"whens",
"yourselectedrole",
"jwks",
"oidcjwks"
],
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,52 @@ You will now be able to use AWS and CDK CLI commands to access the dev account.

When the token expires, you may need to reauthorise using `make aws-login`

### Local Environment Configuration

To run the CPT UI locally (with mock auth and actual API usage), you can configure your `.envrc` file with a few variables. Below is an example configuration:

```
################
# UPDATE THESE #
################
export SERVICE_NAME=cpt-ui-pr-123
export NEXT_PUBLIC_userPoolClientId="1234567890deadbeef"
export NEXT_PUBLIC_userPoolId="eu-west-2_deadbeef"
export LOCAL_DEV=true

# DON'T TOUCH!
export API_DOMAIN_OVERRIDE=https://${SERVICE_NAME}.dev.eps.national.nhs.uk/

export NEXT_PUBLIC_hostedLoginDomain=${SERVICE_NAME}.auth.eu-west-2.amazoncognito.com
export NEXT_PUBLIC_redirectSignIn=http://localhost:3000/auth_demo/
export NEXT_PUBLIC_redirectSignOut=http://localhost:3000/

export NEXT_PUBLIC_COMMIT_ID="Local Development Server"

export REACT_APP_hostedLoginDomain=$NEXT_PUBLIC_hostedLoginDomain
export REACT_APP_userPoolClientId=$NEXT_PUBLIC_userPoolClientId
export REACT_APP_userPoolId=$NEXT_PUBLIC_userPoolId
export REACT_APP_redirectSignIn=$NEXT_PUBLIC_redirectSignIn
export REACT_APP_redirectSignOut=$NEXT_PUBLIC_redirectSignOut
```

To enable mock auth for the local dev server, we only need the user pool details. To fetch these, you can use the following AWS CLI commands:

```
export SERVICE_NAME=cpt-ui-pr-<PR NUMBER>
userPoolClientId=$(aws cloudformation list-exports --region eu-west-2 --query "Exports[?Name=='${SERVICE_NAME}-stateful-resources:userPoolClient:userPoolClientId'].Value" --output text)
userPoolId=$(aws cloudformation list-exports --region eu-west-2 --query "Exports[?Name=='${SERVICE_NAME}-stateful-resources:userPool:Id'].Value" --output text)
echo $userPoolClientId
echo $userPoolId
```

For me, the aws terminal console installed in the dev container refuses to work. Another approach is to use the browser console, accessed by clicking the terminal icon next to the search bar on the AWS web dashboard.

n.b. Ensure you've properly sourced these variables! Direnv can sometimes miss changes.
```
source .envrc
```

### React app
React/Next.js code resides in app folder. More details to be added as dev progresses, see make section for relevant commands

Expand Down
4 changes: 3 additions & 1 deletion packages/cdk/resources/Cognito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ export class Cognito extends Construct {

const callbackUrls = [
`https://${props.fullCloudfrontDomain}/site/`,
// FIXME: This is temporary, until we get routing fixed
`https://${props.fullCloudfrontDomain}/site/auth_demo.html`,
`https://${props.fullCloudfrontDomain}/auth_demo/`
`https://${props.fullCloudfrontDomain}/auth_demo/`,
`https://${props.fullCloudfrontDomain}/oauth2/idpresponse`
]

const logoutUrls = [
Expand Down
2 changes: 1 addition & 1 deletion packages/cpt-ui/__tests__/AuthDemoPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const MockAuthProvider = ({ children }) => {

// Since we've referenced AuthContext in the mock provider, we need to re-import it here
// after the mock is set up.
import { AuthContext } from "../context/AuthContext";
import { AuthContext } from "../context/AuthProvider";
import AuthPage from "../app/auth_demo/page";

describe("AuthPage", () => {
Expand Down
Loading
Loading