Skip to content

feat: DTOSS-12464 remove dummy gp code screen#1878

Open
hardik-desai-nhs wants to merge 7 commits intomainfrom
DTOSS-12464-Remove-Dummy-GP-Screen
Open

feat: DTOSS-12464 remove dummy gp code screen#1878
hardik-desai-nhs wants to merge 7 commits intomainfrom
DTOSS-12464-Remove-Dummy-GP-Screen

Conversation

@hardik-desai-nhs
Copy link
Copy Markdown
Contributor

@hardik-desai-nhs hardik-desai-nhs commented Apr 1, 2026

Description

implement DTOSS-12464. add new screen to request remove dummy GP code.

Key changes:

  • New page at /remove-dummy-gp-code with an NHS-styled form collecting NHS Number, Forename, Surname, Date of Birth, and ServiceNow Ticket Number
  • Server action (app/lib/removeDummyGpCode.ts) that validates input via Zod, calls the RemoveDummyGPCode API endpoint, and handles 202/400/error responses
  • Zod validation schema (app/lib/formValidationSchemas.ts) with NHS Number checksum validation, ServiceNow ticket format, and date-of-birth assembly from day/month/year fields
  • Client component (app/components/removeDummyGpCodeForm.tsx) using useActionState for progressive enhancement, inline field-level errors, error summary, and form value preservation on failure
  • Card component updated to support optional value and a loading shimmer state
  • New "Dummy GP Code" section added to the home page overview
  • New tests — new tests for new and updated conponents

Context

Adds a new Remove Dummy GP Code screen to the Cohort Manager web application, allowing users to submit a request to remove a dummy GP practice code from a participant record. Also improves the overview/home page by introducing Suspense-based streaming for exception card data and parallelising the fetch calls.

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

##Test Evidence

Screenshot 2026-04-01 111248 Screenshot 2026-04-01 111713 Screenshot 2026-04-01 111721 Screenshot 2026-04-01 111607

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Unit Test Results

✔️ Tests 1019 / 1019 - passed in 71.9s
📝 Coverage 47.31%
📏 4819 / 10486 lines covered 🌿 1181 / 2196 branches covered
🔍 click here for more details

✏️ updated for commit 6fa28bc

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “Remove Dummy GP Code” user flow to the Cohort Manager web app, including a new route and server action for submitting removal requests to an external API, and updates the home/overview to surface the new capability while improving exceptions-card loading via Suspense.

Changes:

  • Introduces /remove-dummy-gp-code page with a client form + server action + Zod validation + tests.
  • Updates overview home page to stream exception card data using Suspense and parallel exception fetches; adds a new “Dummy GP Code” section.
  • Enhances card components to support optional numeric values and a loading shimmer state; adjusts test step to read the card number reliably.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
application/CohortManager/src/Web/tsconfig.json Switches JSX emit to react-jsx.
application/CohortManager/src/Web/tests/features/steps/steps.ts Improves card-number extraction/assertion in Playwright step.
application/CohortManager/src/Web/app/remove-dummy-gp-code/page.tsx Adds the new route page and success panel handling via searchParams.
application/CohortManager/src/Web/app/lib/removeDummyGpCode.ts Adds server action: form parsing, Zod validation, API call + response handling.
application/CohortManager/src/Web/app/lib/removeDummyGpCode.test.ts Adds unit tests for server action behaviors and request payload.
application/CohortManager/src/Web/app/lib/formValidationSchemas.ts Adds removeDummyGpCodeSchema with NHS number, DOB, and ServiceNow ticket validation.
application/CohortManager/src/Web/app/lib/formValidationSchemas.test.ts Adds schema unit tests for removeDummyGpCodeSchema.
application/CohortManager/src/Web/app/globals.scss Adds shimmer animation styling for loading card placeholders.
application/CohortManager/src/Web/app/components/removeDummyGpCodeForm.tsx Adds client form component using useActionState, inline errors, and value preservation.
application/CohortManager/src/Web/app/components/overviewData.tsx New async component to fetch exception counts in parallel and render cards (or error).
application/CohortManager/src/Web/app/components/overview.tsx Refactors overview to use Suspense + skeleton cards; adds “Dummy GP Code” section.
application/CohortManager/src/Web/app/components/cardGroup.tsx Extends card group items to allow optional value and loading.
application/CohortManager/src/Web/app/components/card.tsx Updates card rendering for optional value and loading shimmer; adjusts clickability logic.
application/CohortManager/src/Web/.env.tests Adds REMOVE_DUMMY_GP_CODE_API_URL for tests.
application/CohortManager/src/Web/.env.example Documents REMOVE_DUMMY_GP_CODE_API_URL in example env file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread application/CohortManager/src/Web/app/lib/formValidationSchemas.ts Outdated
Comment thread application/CohortManager/src/Web/app/components/removeDummyGpCodeForm.tsx Outdated
Comment thread application/CohortManager/src/Web/app/components/removeDummyGpCodeForm.tsx Outdated
Comment thread application/CohortManager/src/Web/app/globals.scss
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

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.

3 participants