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

feat: review facilities page #2689

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from

Conversation

acatchpole
Copy link
Contributor

@acatchpole acatchpole commented Jan 15, 2025

Card: bcgov/cas-reporting#197

This page is where a user selects what facilities are being reported on. The save function of this page creates a facility report for each facility selected. If unselecting a previously selected facility, that facility report, and any data added to it, will be deleted.

Local Testing

Assumptions:

  • You are working with the current (Jan '25) default testing data.
  • The backend is running
  • The frontend is running
  • You are logged in

Steps:

  1. Navigate to http://localhost:3000/reporting/reports/2/review-facilities-list
    • Expect to see page with a list of facility names beside checkboxes, all of which are selected except 'Facility 2'
  2. Click on the Back button.
    • Expect for it to navigate to the 'Person Responsible' page.
  3. Select a person from the drop down and then click Save & Continue button.
  • Expect to navigate back to the 'Review Facilities' page
  1. In the blue information block, open 'Facilities Information' link into a new tab.
  2. In the 'Facilities' page in the new tab, click the Add Facility button.
  3. Fill out this form (small aggregate is easiest type) and click the Submit button.
  4. Close this tab and go back to the 'Review Facilities' page
  5. Click on the Sync Latest Data... button.
  • Expect to see the new facility added to the list without the page refreshing
  1. Deselect the check next to 'Facility 1'
  2. Click the Save & Continue button
  • Expect to see a confirmation modal come up with Facility 1 listed as being deselected
  1. Click the Continue button in the modal
  • Expect to navigate to the 'Report Information' (WIP)
  1. Navigate back to http://localhost:3000/reporting/reports/2/review-facilities-list
    - Expect for Facility 1 to no longer be selected
  2. Click the checkbox next to 'Facility 2' and hit Save
  • Expect no modal to pop up and the button to show 'Success'

Unresolved issue:

Was unable to find an easy way for the modal to know whether it had been opened by the 'Save' or the 'Save & Continue' button. Currently, if you click 'Continue' from the confirmation modal, you will navigate to the next page, even if you had clicked 'Save' instead of 'Save & Continue'.

@ayeshmcg ayeshmcg force-pushed the feat/197-lfo-review-facilities-page branch from 6b67f60 to e7e895f Compare January 17, 2025 01:13
@ayeshmcg
Copy link
Contributor

@acatchpole
Added the following changes:-

  1. get and post endpoints
  2. Schema
  3. Service for both get and save
  4. Removed selected facilities model

Remaining:-

  1. Tests: API and service

@ayeshmcg ayeshmcg changed the title feat: review selected facilities page feat: review facilities page Jan 17, 2025
@ayeshmcg ayeshmcg force-pushed the feat/197-lfo-review-facilities-page branch from 8ef18d9 to 99b3826 Compare January 21, 2025 07:32
@ayeshmcg
Copy link
Contributor

ayeshmcg commented Jan 21, 2025

@acatchpole
Added checkbox widget, refactored form code.
Now all the facilities are visible and the facilities in facility report table are preselected as well
image

To do:

  1. Fix spacing
  2. Add correct urls in this page
  3. fix url for this page in the tasklist
  4. Add tests(Frontend)
  5. Test- Backend(API)
  6. On save - get list of facility Ids and send post req to reporting/report-version/2/review-facilities
  7. pop-up modal

@ayeshmcg ayeshmcg force-pushed the feat/197-lfo-review-facilities-page branch 4 times, most recently from aa29c38 to c948206 Compare January 22, 2025 20:53
@acatchpole acatchpole marked this pull request as ready for review January 27, 2025 22:10
@ayeshmcg ayeshmcg force-pushed the feat/197-lfo-review-facilities-page branch from 9f0b8c7 to 89ffc3b Compare January 27, 2025 23:04
@acatchpole acatchpole force-pushed the feat/197-lfo-review-facilities-page branch from dc96de1 to 568d35c Compare January 29, 2025 19:46
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