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

reporting buttons fixes #2567

Merged
merged 9 commits into from
Dec 12, 2024
Merged

reporting buttons fixes #2567

merged 9 commits into from
Dec 12, 2024

Conversation

gdalcengio
Copy link
Contributor

@gdalcengio gdalcengio commented Dec 10, 2024

bcgov/cas-reporting#444

  • fix: Fix reporting step buttons on attachments and allocation pages
  • test: update tests after reporting step buttons update

🔬 SH Post Review - 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
  1. Navigate to http://localhost:3000
  2. Click button "Log in with Business BCeID"
  3. Navigate to http://localhost:3000/reporting/reports
    Expected Results
  • Reporting grid displays with rows having action buttons Start or Continue
  1. Click Operator 3 row button Start
    Expected Results
  • Url does NOT display any query parameters such as`..?reports_title=...1
  • Router navigates to form: Review operation information
  • Form has buttons: Back; Save; Save & Continue
  1. Navigate to http://localhost:3000/reporting/reports
  2. Click Operator 3 row button Continue
    Expected Results
  • Url does NOT display any query parameters such as`..?reports_title=...1
  • Router navigates to form: Review operation information
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click Operator 3 row button Continue
  2. Click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form: Person Responsible
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Form POST data to the server
  • Router navigates to form: Person Responsible
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form: Review facility information
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Form POST data to the server
  • Router navigates to form: Review facility information
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form: General stationary combustion excluding line tracing
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Form POST data to the server
  • Router navigates to form: General stationary combustion excluding line tracing
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form: Activities (currently "Something went wrong...")
  1. Navigate to http://localhost:3000/reporting/reports/3/facilities/f486f2fb-62ed-438d-bb3e-0819b51e3aff/non-attributable
  • Router navigates to form: Non-Attributable Emissions
  • Form has buttons: Back; Save; Save & Continue
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form: Emission Summary
  • Form has buttons: Back; Save; Continue
  • Button Save is disabled
  1. Click button Continue
    Expected Results
  • Router navigates to form: Production Data
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the 'Emission Summary`
  1. Click button Continue
    Expected Results
  • Router navigates to form: Production Data
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form; Allocation Of Emissions
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Form POST data to the server
  • Router navigates to form: Allocation Of Emissions
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form: Additional Reporting Data
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Form POST data to the server
  • Router navigates to form: Additional Reporting Data
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form: new-entrant-information (coming soon)
  • Form has buttons: Back; Save; Save & Continue
  1. Navigate to http://localhost:3000/reporting/reports/3/verification
    Expected Results
  • Router navigates to form: Verification
  • Form has buttons: Back; Save; Save & Continue
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form; Attachments
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Form POST data to the server
  • Router navigates to form: Attachments
  1. Complete form and click button Save
    Expected Results
  • Form POST data to the server
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Form POST data to the server
  • Router navigates to form; Final Review
  • Form has buttons: Back; Save; Save & Continue
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Form POST data to the server
  • Router navigates to form: Final Review
  1. Complete form and click button Save
    Expected Results
  • Router does not navigate to the next step
  1. Click button Save & Continue
    Expected Results
  • Router navigates to form; Sign Off
  • Form has buttons: Back; Save; Save & Continue
  • Button Save is disabled
  1. Click button Back
    Expected Results
  • Router navigates to the previous next step
  1. Click button Save & Continue
  • Router navigates to form; Sign Off
  1. Complete form and click button Save & Continue
    Expected Results
  • Successful Submission displays

@@ -29,11 +30,13 @@ const taskListElements: TaskListElement[] = [
},
];

export default function SignOffPage() {
const SignOffPage: React.FC<HasReportVersion> = ({ version_id }) => {
Copy link
Contributor

@shon-button shon-button Dec 11, 2024

Choose a reason for hiding this comment

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

@gdalcengio
For your consideration:
IMO, for Next.js apps, if your component is a page component, the preferred pattern is a function declaration with export default; such as, export default function SignOffPage({ version_id }: HasReportVersion) {...
This pattern aligns with the framework's dynamic routing and file-based conventions.

@shon-button
Copy link
Contributor

shon-button commented Dec 11, 2024

@gdalcengio

Seems, this is still an issue:

@shon-button shon-button force-pushed the reporting_buttons_fixes branch from f6b8ba1 to 3089450 Compare December 11, 2024 17:55
@@ -236,8 +236,6 @@ export default function FacilityEmissionAllocationForm({
setSubmitButtonDisabled(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

@gdalcengio
FYI: Clicking Save disables the Save and Continue due to handleSubmit\setSubmitButtonDisabled(false);

@shon-button
Copy link
Contributor

shon-button commented Dec 11, 2024

@gdalcengio

FYI, related to breadcrumb component, there are some navigation links with obsoletequery parameters no longer needed for reporting breadcrumbs (such as reports-titleandfacility_title`)

@shon-button shon-button force-pushed the reporting_buttons_fixes branch from 4052364 to 4711986 Compare December 11, 2024 20:00
@shon-button shon-button force-pushed the reporting_buttons_fixes branch from 9949aa6 to 7777381 Compare December 11, 2024 22:01
chore: fix additonal data back url

chore: fix backURL

chore: fix incorrect url
@shon-button shon-button force-pushed the reporting_buttons_fixes branch from 7777381 to 6238498 Compare December 11, 2024 22:03
@shon-button
Copy link
Contributor

shon-button commented Dec 11, 2024

@gdalcengio

Other components with button display and functionality issues:
AdditionalReportingDataForm
NonAttributableEmissionsForm
FinalReviewForm

@shon-button shon-button force-pushed the reporting_buttons_fixes branch from bd1a0fe to eed0626 Compare December 11, 2024 23:10
const continueUrl =
operationType === "Linear Facility Operation"
? `/reporting/reports/${version_id}/facilities/lfo-facilities${queryString}`
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: incorrect /reporting/reports/ instead of /reports/

Copy link
Contributor

@acatchpole acatchpole left a comment

Choose a reason for hiding this comment

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

local testing confirms working. Only possible issue noticed is :
On 'Review Operation Information' page: clicking "Save" generates error =
An error occurred while fetching /reporting/report-version/3/report-operation: SyntaxError: Unexpected token '<', "
<!doctype "... is not valid JSON
- status 200 is still returned from the POST and seem to function properly. Behaviour is NOT seen when clicking "Save and Continue". probably not an issue that would be noticed in testing tomorrow


*/
Copy link
Contributor

Choose a reason for hiding this comment

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

commented code still present

@shon-button
Copy link
Contributor

shon-button commented Dec 12, 2024

local testing confirms working. Only possible issue noticed is : On 'Review Operation Information' page: clicking "Save" generates error = An error occurred while fetching /reporting/report-version/3/report-operation: SyntaxError: Unexpected token '<', " <!doctype "... is not valid JSON - status 200 is still returned from the POST and seem to function properly. Behaviour is NOT seen when clicking "Save and Continue". probably not an issue that would be noticed in testing tomorrow

Thanks @acatchpole !
I can not reproduce "On 'Review Operation Information' page: clicking "Save" generates error"
but, I did notice that on page General stationary combustion excluding line tracing clicking "Save" without any data generates error.
I have a note to create a possible ticket(s)

chore: additional data

chore: add test delay for CI pre-commit

fix for CI

fix for CI
@shon-button shon-button force-pushed the reporting_buttons_fixes branch from 076a829 to bd961e9 Compare December 12, 2024 00:21
@shon-button shon-button merged commit 8b9bb06 into develop Dec 12, 2024
42 checks passed
@shon-button
Copy link
Contributor

Capturing Additional Reporting Data buttons display in this branch:
image

@shon-button shon-button deleted the reporting_buttons_fixes branch December 18, 2024 14:24
@gdalcengio
Copy link
Contributor Author

Thank you @shon-button. I really appreciate you cleaning up all the mess I left!

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