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

fix: ORV2-1823 - Fix vehicle selection bug and refactor vehicle type/subtype variable naming #1081

Merged
merged 11 commits into from
Jan 12, 2024

Conversation

zgong-gov
Copy link
Collaborator

@zgong-gov zgong-gov commented Jan 12, 2024

Description

Please provide a summary of the change and the issue fixed. Please include relevant context. List dependency changes.

  • Fixed the vehicle selection bug inside the create/update application form for vehicle details (as described in ticket ORV2-1823 for multiple vehicles with same VIN/plate/unitNumber)
  • Added concept of vehicleId for vehicle details, and together with vehicleType, distinguishes between which vehicle was selected for the application/permit
  • Shows selected vehicle unit number or plate for any created applications with vehicle details that's already in the vehicle inventory
  • Fixed/updated logic for saving vehicle to inventory from application form
  • Multiple refactoring of vehicle type and subtype related code (especially confusing nomenclature)
  • Fixed broken tests for vehicle details

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Create two power units (or trailers) with identical information in the vehicle inventory, but only differ in unit numbers. After that, go to the create application form and confirm that the two created vehicles are indeed selectable. Choose one of the created vehicles and continue to the review page, and confirm that the correct vehicle was selected (the correct unit number).
  • Go to the create application page (new application), and do not choose any vehicles from the selectable dropdown. Ensure that the fields for the vehicle details are empty, and proceed to enter any valid vehicle information for these fields and switch the radio button for saving to inventory to "Yes". After clicking continue and going to the review page, make sure that the entered vehicle details are present for the application (check in the network tab that the 'vehicleId' field/value exists and isn't empty for the application vehicle details), and that the vehicle was added to the vehicle inventory.
  • Go to the create application page, and choose any vehicle from the dropdown, and proceed to edit some of the vehicle details fields (except the vehicle type field, which at this point should be disabled). Once again, switch the radio button for saving to inventory to "Yes", and after clicking continue to go to the review page, ensure that the entered vehicle details info is present in the application (check the network tab, and that the 'vehicleId' is the same as the previously selected vehicle). Furthermore, go back to the application form once again by clicking 'Edit' or the breadcrumb at the top, and notice that the previously selected vehicle's unit number is present in the dropdown (this is a new feature).

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

Further comments


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are promoted to:

@zgong-gov zgong-gov changed the title ORV2-1823 fix: ORV2-1823 - Fix vehicle selection bug and refactor vehicle type/subtype variable naming Jan 12, 2024
Copy link
Contributor

@erikataot erikataot left a comment

Choose a reason for hiding this comment

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

Ran through a few manual form entries as well as ran npm run test without issue. Good work!

Copy link

Quality Gate Passed Quality Gate passed for 'onroutebc vehicles'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

Quality Gate Failed Quality Gate failed for 'onroutebc frontend'

Failed conditions

80.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@zgong-gov zgong-gov merged commit 89924f9 into main Jan 12, 2024
29 of 30 checks passed
@zgong-gov zgong-gov deleted the ORV2-1823 branch January 12, 2024 19:11
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