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

Conditional Task List for Report Sign-Off and Submit #2673

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

shon-button
Copy link
Contributor

@shon-button shon-button commented Jan 10, 2025

Addresses 493

🚀 Impact:

  • Implements conditional Signoff & Submit tasks based on needs verification service

🔬 Local Testing:

  1. From terminal command, start the api server:
cd bc_obps
make reset_db
make run
  1. From terminal command, start the app development server:
cd bciers && yarn dev-all

Test for needs verification links

  1. Navigate to http://localhost:3000
  2. Click button "Log in with Business BCeID"
  3. Navigate to http://localhost:3000/reporting/reports
  4. On row Operation 3, click button Continue
  5. Complete the report pages until http://localhost:3000/reporting/reports/1/compliance-summary
  6. Click button Continue
    Expected Results
  • Signoff & Submit task list displays including: "Verification";
    image
  1. Click the task list links
    Expected Results
  • Link route as expected with expected task list
    image
    image
    image

Test for does not need verification links

  1. Navigate to http://localhost:3000
  2. Click button "Log in with Business BCeID"
  3. Navigate to http://localhost:3000/reporting/reports
  4. On row Operation 14, click button Start
  5. Complete the report pages until http://localhost:3000/reporting/reports/3/compliance-summary
  6. Click button Continue
    Expected Results
  • Signoff & Submit task list displays NOT including: "Verification";
    image
  1. Click the task list links
    Expected Results
  • Link route as expected with expected task list
    image
    image
    image

@shon-button shon-button changed the title Conditional signOffSubmit tasks list Conditional Task List for Report Sign-Off and Submit Jan 10, 2025
Copy link
Contributor

@pbastia pbastia left a comment

Choose a reason for hiding this comment

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

🥇 work! Just a couple of things about the attachments

export const getSignOffAndSubmitSteps: (
versionId: number,
activeIndex?: ActivePage | number,
) => TaskListElement[] = (versionId, activeIndex = undefined) => {
) => Promise<TaskListElement[]> = async (
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be up for making these steps as static as possible, and let the various components figure out how to fetch the dynamic data.

This way we're not constrained to which API endpoint to use, nor to using these tasklist elements on the server side

export const getSignOffAndSubmitSteps: (
  versionId: number,
  activeIndex?: ActivePage | number,
  needsVerification?: boolean
 ) => TaskListElement[] = ...

and in the SignOffPage server component:

needsVerif = await getReportNeedsVerification(versionId)
taskList = getSignOffAndSubmitSteps(version_id, ActivePage.SignOff, needsVerif)
...

const filteredElements: TaskListElement[] = elements.filter((element) => {
if (!needsVerification) {
return (
element.title !== "Verification" && element.title !== "Attachments"
Copy link
Contributor

Choose a reason for hiding this comment

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

The Attachments page contains more than just the verification statement (confidentiality request, extra WCI info, etc.) so we need to keep it there no matter what

@shon-button shon-button force-pushed the chore/conditional-task-list branch from bbe7d93 to 842097a Compare January 13, 2025 16:47
@shon-button shon-button merged commit b62a570 into develop Jan 13, 2025
42 checks passed
@shon-button shon-button deleted the chore/conditional-task-list branch January 13, 2025 17:01
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.

2 participants