Skip to content

Commit

Permalink
Feat/cb2 14450 weights dfs (#1719)
Browse files Browse the repository at this point in the history
* fix(handle-recalls-failure): handle recalls failure (#1688)

* feat(CB2-14452): set up new components under feature flag

* feat(CB2-14452): add controls

* fix(CB2-12720): show validation immediately (#1694)

* feat(feat/CB2-15486): spelling error corrected (#1686)

Co-authored-by: Tom Evans <thomas.evans@dvsa.gov.uk>
Co-authored-by: Thomas Crawley <thomas.crawley@dvsa.gov.uk>

* fix(CB2-15660): fix issue where delete of tc3 inspection was not propagated (#1690)

Co-authored-by: Thomas Evans <36958694+tomevs88@users.noreply.github.com>

* feat(CB2-14452): add edit mode controls

* feat(cb2-15580): add ability to download VTP and VTG 12 documents for abandoned tests (#1693)

* feat(cb2-15580): add ability to download vtp and vtg 12 documents for abandoned tests

* feat(cb2-15580): use static test type ids as BE ids are wrong for now

* feat(cb2-15580): re-add cvs common package for vtg/vtp12 test type ids

---------

Co-authored-by: Thomas Evans <36958694+tomevs88@users.noreply.github.com>

* feat(CB2-14452): prepopulate tyres data

* feat(CB2-14452): fix adding axles

* feat(CB2-14452): fix removing axle

* feat(CB2-14452): tidy up

* feat(cb2-14452): add summary progress

* feat(cb2-14452): reference amend not current

* feat(CB2-14452):  fix tyre code entry and styling

* fix(CB2-14452): reset autocomplete to default value when cleared (#1697)

* fix(CB2-14452): reset autocomplete to default value when cleared

* fix(CB2-14452): fix unit test

* fix(CB2-15741): fix correct small trl eu vehicle cat (#1699)

* feat(CB2-14452-tyres-dfs): styling fix

* feat(feat/CB2-15735): bug fixed (#1701)

Co-authored-by: Tom Evans <thomas.evans@dvsa.gov.uk>

* feat/cb2-14452-tyres-dfs-view - merge view into main component (#1696)

* feat(CB2-14452-tyres-dfs-view): minor changes

* feat(CB2-14452-tyres-dfs-view): start adding table properties

* feat(CB2-14452-tyres-dfs-view): table functionally working

* feat(CB2-14452-tyres-dfs-view): stash

* feat(CB2-14452-tyres-dfs-view): concatenate ng containers

* feat(CB2-14452-tyres-dfs-view): axle warning view mode

* feat(CB2-14452): fix casing

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>

* feat(CB2-14452-tyres-dfs): add ids for automation pack

* feat(cb2-15734): hide required tag for subclass for small trl (#1700)

* feat(CB2-14452-tyres-dfs): add class used in automation pack

* feat(CB2-14452-tyres-dfs): fix accesibility issue

* feat(CB2-14452-tyres-dfs): add ids for view mode

* fix(cb2-15660): fix un numbers (#1698)

* fix(CB2-15660): fix issue where delete of tc3 inspection was not propagated

* fix(CB2-15660): handle pre-populate UN Numbers

---------

Co-authored-by: Thomas Evans <36958694+tomevs88@users.noreply.github.com>

* feat(cb2-14450): initial migration of weights section

* feat(cb2-14450): initial weights edit progress

* feat(cb2-14450): reference correct values within axles for weights

* feat(cb2-14450): add all fields within weights for psv, trl and hgv

* feat(cb2-14450): fix adding and removing of axle ui changes

* feat/CB2-14450-weights-dfs-view -  Weights view mode (#1706)

* feat(CB2-14450): weights view mode

* feat(CB2-14450-weights-dfs-view): missing field

* feat(CB2-14450): fix test id

* feat(CB2-14450-weights-dfs-review): dfs review section (#1705)

* feat(CB2-14450-weights-dfs-review): dfs review section

* feat(CB2-14450-weights-dfs-review): change feature flag

* feat(CB2-14450-weights-dfs-review): add unladen weight to review page

---------

Co-authored-by: Brandon Thomas-Davies <87308252+BrandonT95@users.noreply.github.com>

* feat(cb2-14450): fix id names

* feat(feat/cb2-14450): cross form working

* feat(cb2-14450): add validators to controls

* feat(CB2-14450-weights-dfs-edit): fix weights styling

* feat(cb2-14450): add remaining validators to controls

* feat(feat/cb2-14450): unit tests started

* feat(cb2-14450): add some unit tests

* feat(cb2-14450): add some unit tests

* fix(CB2-15820): add plates tag to tyre use code (#1707)

* feat(CB2-14450-weights-dfs): tyres unit tests fix

* Feat/cb2 14452 tyres dfs temp (#1710)

* feat(CB2-14452-tyres-dfs-temp): add back changes that were reverted

* feat(CB2-14450-weights-dfs): tyres unit tests fix

---------

Co-authored-by: Thomas Crawley <thomas.crawley@dvsa.gov.uk>

* feat(CB2-14450-weights-dfs): push label fix for tyres on view and summary

* fix(CB2-15824): fix tyre use code styling on review page (#1708)

* fix(CB2-15821): fix interaction with weights (#1714)

* fix(CB2-15821): fixes for axles

* fix(CB2-15821): fixes for interaction with tyres

* fix(CB2-15821): remove console log

* fix(CB2-15821): fix weights for psv

* feat(CB2-14450-weights-dfs): remove tyre axle merging issue

* feat(CB2-14450): implement interface for on changes

* feat(CB2-14450-weights-dfs): fix axle removal issues

* feat(CB2-14450): use default null or empty pipe in tables for view and summary

* feat(CB2-14450-weights-dfs): prevent duplication of ids

* feat(CB2-14450-weights-dfs): display inline error message

* fix(CB2-15892-fix-function-code): fix function code (#1716) (#1717)

* Feat/cb2 14449 (#1715)

* chore(cb2-0000): basic form

* chore(cb2-0000): changes

* chore(cb2-0000): add view and summary mode

* chore(cb2-0000): add example directive

* chore(cb2-0000): initial implementation of vehicle summary section

* chore(cb2-0000): add dates and directives

* chore(cb2-0000): rebase and lint

* chore(cb2-0000): additional vehicle section properties

* feat(cb2-0000): add additional directives

* chore(cb2-0000): adr section changes

* chore(cb2-0000): fix issues with global error service

* chore(cb2-0000): fix linting

* chore(cb2-0000): fix validation for ADR section

* chore(cb2-0000): fix tc3 validator

* chore(cb2-0000): commit progress on vehicle summary

* chore(poc-vehicle-section): hgv options and accessibility refactor

* chore(cb2-0000): general ADR section fixes

* chore(cb2-0000): attempt at adding controls based off vehicle type

* chore(cb2-0000): attempt at adding controls based off vehicle type improvements

* chore(cb2-0000): improve form typing

* feat(cb2-0000): migrate remaining elements to new accessibility syntax

* chore(cb2-0000): move vehicle class based off vehicle type

* feat(cb2-0000): styling POC

* chore(cb2-0000): styling fixes

* chore(cb2-0000): allow editing fields on different pages

* feat(cb2-0000): update to use new global scss styles

* feat(cb2-0000): add select style class

* feat(cb2-0000): input and split control styling

* feat(cb2-0000): remove additional redundant duplicated code

* feat(CB2-14451): fix html

* feat(CB2-14451): fix feature flag

* feat(cb2-14451): minor changes

* feat(cb2-14451): add radio type to radio components

* feat(CB2-14451): fix form controls

* feat(CB2-14451): view mode progress

* feat(cb2-14451): fix styling

* feat(cb2-14451): fix euro standard text

* feat(cb2-14451): HGV view component

* feat(CB2-14451): TRL view mode

* feat(cb2-14451): date of first reg text fix

* feat(cb2-14451): motorcycle no of wheels driven

* feat(cb2-14451): psv view mode

* feat(cb2-0000): commit progress

* feat(CB2-14451): use checkbox group component

* feat(CB2-14451): convert to old syntax

* feat(cb2-14451): exempt view mode transformations

* feat(cb2-14451): date pipe fix

* feat(cb2-14451): edit mode progress

* feat(cb2-14451): small trailer view mode

* feat(cb2-14451): more edit mode progress

* feat(cb2-14451): radio component

* feat(cb2-14451): edit mode finish trl fields

* feat(CB2-14451): radio component implementation attempt 1

* feat(CB2-14451): add radio component

* feat(CB2-14451): populate fields correctly in amend

* feat(cb2-14451): use radio component for radio controls

* feat(cb2-0000): implement validation for controls

* feat(cb2-14451): add multi option pipe (#1656)

* feat(cb2-0000): dynamically display tags based off vehicle type

* feat(CB2-14451): update multi option and radios

* feat(cb2-0000): comment out method

* feat(cb2-0000): fix psv seat validator

* feat(cb2-0000): fix conflicts

* feat/cb2-14451-select-component - new select component (#1657)

* feat(CB2-14451): select component attempt

* feat(CB2-14451): select component cyclic dependency fix

* feat(cb2-14451-select-component): ng model binding

* feat(cb2-14451-select-component): remove conflict

* feat(cb2-14451): add fors to date labels

* feat(cb2-14451): reg date validators

* feat(cb2-14451): ui fix for required and plates

* feat(CB2-14451): update function code

* feat(cb2-14451): update noAxles when adding axles

* feat(CB2-14451): make number of axles a number input

* feat(cb2-0000): edit section unit test progress

* feat(CB2-14451): remove speed limiter exempt plates tag for psv

* feat(CB2-14451): regression pack fixes

* feat(cb2-14451): plates labels

* feat(CB2-14451): more pack fixes

* feat/cb2-14451-input-component -  Introduce input components (#1658)

* feat(CB2-14451-input-component): number and text input

* feat(cb2-14451-input-component): replace instances in vehicle section

* feat(cb2-0000): edit section unit test progress

* feat(cb2-0000): edit section unit test progress

* feat(CB2-14451): styling fixes

* feat(cb2-0000): edit section unit test progress

* feat(cb2-14451): test changes

* feat(cb2-14451): fix psv seat tests

* feat(CB2-14451): fix unit tests

* feat(cb2-0000): final unit tests complete for vehicle section edit mode

* feat(cb2-14451): add date control

* feat(CB2-14451): small fixes

* feat(cb2-14451): missing inputs

* feat(cb2-14451): use custom components (#1659)

* feat(CB2-14451): add tags to select

* feat(CB2-14451): add review screen

* feat(CB2-14451): small corrections

* feat(CB2-14451): add date validation to seatbelt installation

* feat(CB2-14451): fix tags and plates tag

* feat(cb2-14451): fix width for select

* feat(cb2-14451): select width and month of manufacture fixes

* feat(CB2-14459): boiler plate for body section

* feat(CB2-14451): fixes

* feat(CB2-14459): boilerplate for edit

* feat(cb2-14459): body view component progress

* feat(cb2-14459): body summary component progress

* feat(CB2-14449): add notes section

* feat/cb2-14459-edit - merge edit into main branch (#1665)

* feat(CB2-14459): show controls based on vehicle type

* feat(CB2-14451): resolve errors

* feat(CB2-14459): add disabled attribute to chassis make

* feat(CB2-14459): add psv fields to edit mode

* feat(CB2-14459-edit): autocomplete boilerplate

* feat(CB2-14459): autocomplete stuff

* feat(CB2-14459): more autocomplete stuff

* feat(CB2-14459): more autocomplete stuff

* feat(CB2-14459-edit): add dropdown

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>

* feat(CB2-14459): add additional fields

* feat(CB2-14459): stash for swarm

* feat(CB2-14459): stash for swarm

* feat(CB2-14459): fix body makes

* feat(CB2-14459): add tags fix label styling and function code not pulling values in

* feat(CB2-14459): start on vehicle configuration linking

* feat(CB2-14459): fix autocomplete

* feat(CB2-14459): update values from parent component

* feat(CB2-14459): fix feature flag not showing old section

* feat(CB2-14459): stash

* feat(CB2-14459): stash

* feat(CB2-14459): dtp number fix maybe

* feat(CB2-14459): body type code

* feat(cb2-14459): fix undefined custom components when flag enabled

* feat(CB2-14459): starting tests

* feat(CB2-14459): remove redundant tests

* feat(cb2-14459): ngdestroy test

* feat(CB2-14459): first attempt at testing dtp number on change logic

* feat(CB2-14459): minor unit test updates

* feat(CB2-14459): minor unit test updates

* feat(CB2-14459): dtp number changing test amendments

* feat(CB2-14459): minor unit test updates

* feat(CB2-14459): unit test conquered

* feat(cb2-14459): unit test progress

* feat(CB2-14459): vehicle configuration changes

* feat(CB2-14459): fix autocomplete

* feat(CB2-14459): fix plates tag on year of manufacture

* feat(CB2-14459): remove commented out logic

* feat(CB2-14459): fix autocomplete again

* feat/CB2-14459 - Body section (#1667)

* feat(cb2-15344): show chassis make and model for PSVs on review screen (#1662)

* fix(cb2-15343): submit after gross laden weight calculation when brake code is not entered (#1655)

Co-authored-by: Thomas Crawley <thomas.crawley@dvsa.gov.uk>

* feat(CB2-14743): add recalls banner (#1663)

* feat(CB2-14743): add recalls banner

* feat(CB2-14743): correct spelling mistakes

* feat(CB2-14743): add an fix unit tests

---------

Co-authored-by: Thomas Crawley <thomas.crawley@dvsa.gov.uk>

* feat(CB2-14451): fix tags and plates tag

* feat(cb2-14451): fix width for select

* feat(cb2-14451): select width and month of manufacture fixes

* feat(CB2-14459): boiler plate for body section

* feat(CB2-14451): fixes

* feat(CB2-14459): boilerplate for edit

* feat(cb2-14459): body view component progress

* feat(cb2-14743): remove recalls from test submission for non HGV/PSV/TRL tests (#1664)

* feat(CB2-14743): add recalls banner

* feat(CB2-14743): correct spelling mistakes

* feat(CB2-14743): add an fix unit tests

* feat(CB2-14743): remove recalls from non HGV/PSV/TRL to allow test submission

* feat(CB2-14743): actually make request properly

---------

Co-authored-by: Thomas Crawley <thomas.crawley@dvsa.gov.uk>

* feat(cb2-14459): body summary component progress

* feat/cb2-14459-edit - merge edit into main branch (#1665)

* feat(CB2-14459): show controls based on vehicle type

* feat(CB2-14451): resolve errors

* feat(CB2-14459): add disabled attribute to chassis make

* feat(CB2-14459): add psv fields to edit mode

* feat(CB2-14459-edit): autocomplete boilerplate

* feat(CB2-14459): autocomplete stuff

* feat(CB2-14459): more autocomplete stuff

* feat(CB2-14459): more autocomplete stuff

* feat(CB2-14459-edit): add dropdown

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>

* feat(CB2-14459): add additional fields

* feat(CB2-14459): stash for swarm

* feat(CB2-14459): stash for swarm

* feat(CB2-14459): fix body makes

* feat(CB2-14459): add tags fix label styling and function code not pulling values in

* feat(CB2-14459): start on vehicle configuration linking

* feat(CB2-14459): fix autocomplete

* feat(CB2-14459): update values from parent component

* feat(CB2-14459): fix feature flag not showing old section

* feat(CB2-14459): stash

* feat(CB2-14459): stash

* feat(CB2-14459): dtp number fix maybe

* feat(CB2-14459): body type code

* feat(cb2-14459): fix undefined custom components when flag enabled

* feat(CB2-14459): starting tests

* feat(CB2-14459): remove redundant tests

* feat(cb2-14459): ngdestroy test

* feat(CB2-14459): first attempt at testing dtp number on change logic

* feat(CB2-14459): minor unit test updates

* feat(CB2-14459): minor unit test updates

* feat(CB2-14459): dtp number changing test amendments

* feat(CB2-14459): minor unit test updates

* feat(CB2-14459): unit test conquered

* feat(cb2-14459): unit test progress

* feat(CB2-14459): vehicle configuration changes

* feat(CB2-14459): fix autocomplete

* feat(CB2-14459): fix plates tag on year of manufacture

* feat(CB2-14459): remove commented out logic

* feat(CB2-14459): fix autocomplete again

---------

Co-authored-by: Philip Bardy <146740183+pbardy2000@users.noreply.github.com>
Co-authored-by: Brandon Thomas-Davies <87308252+BrandonT95@users.noreply.github.com>
Co-authored-by: Tom Evans <thomas.evans@dvsa.gov.uk>

* feat(cb2-15556): fix spacing and adding of alteration marker

* feat(CB2-14459): remove console error

* feat(CB2-14459): dtp number is not required for hgv or trl

* feat(CB2-14459): use correct id

* feat(CB2-14451): fix number of seats on psv (#1671)

* feat(CB2-14451): fix number of seats on psv (#1671) (#1672)

* fix(CB2-14459): fix additional disabled properties added by mistake (#1670)

* fix(CB2-14449): fix additional disabled properties added by mistake

* feat(CB2-14451): fix number of seats on psv

* feat(CB2-14459): fix body description code

* fix(CB2-14459): fix additional disabled properties added by mistake (#1670) (#1673)

* fix(CB2-14449): fix additional disabled properties added by mistake

* feat(CB2-14451): fix number of seats on psv

* feat(CB2-14459): fix body description code

* feat(CB2-14459): update editing tech record

* Feat/cb2 14459 (#1674)

* fix(CB2-14459): fix additional disabled properties added by mistake (#1670)

* fix(CB2-14449): fix additional disabled properties added by mistake

* feat(CB2-14451): fix number of seats on psv

* feat(CB2-14459): fix body description code

* feat(CB2-14459): update editing tech record

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>

* feat(CB2-14459): add missing vehicle type check

* Feat/cb2 14459 (#1675)

* fix(CB2-14459): fix additional disabled properties added by mistake (#1670)

* fix(CB2-14449): fix additional disabled properties added by mistake

* feat(CB2-14451): fix number of seats on psv

* feat(CB2-14459): fix body description code

* feat(CB2-14459): update editing tech record

* feat(CB2-14459): add missing vehicle type check

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>

* feat(CB2-14459): handle body type description change

* Feat/cb2 14459 (#1676)

* fix(CB2-14459): fix additional disabled properties added by mistake (#1670)

* fix(CB2-14449): fix additional disabled properties added by mistake

* feat(CB2-14451): fix number of seats on psv

* feat(CB2-14459): fix body description code

* feat(CB2-14459): update editing tech record

* feat(CB2-14459): add missing vehicle type check

* feat(CB2-14459): handle body type description change

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>

* feat(CB2-14459): add changes to feature flag logic

* feat(CB2-14459): add changes to feature flag logic

* Feat/cb2 14459 (#1677)

* fix(CB2-14459): fix additional disabled properties added by mistake (#1670)

* fix(CB2-14449): fix additional disabled properties added by mistake

* feat(CB2-14451): fix number of seats on psv

* feat(CB2-14459): fix body description code

* feat(CB2-14459): update editing tech record

* feat(CB2-14459): add missing vehicle type check

* feat(CB2-14459): handle body type description change

* feat(CB2-14459): add changes to feature flag logic

* feat(CB2-14459): add changes to feature flag logic

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>

* feat(CB2-14459): date of first use

* feat(CB2-14459): number of seatbelts width fix

* feat/cb2-14451-vehicle-section-fixes (#1680)

* feat(CB2-14459): date of first use

* feat(CB2-14459): number of seatbelts width fix

* feat(CB2-14459): vehicle class fix

* feat(CB2-14451): id change

* feat(cb2-15623): use multi option pipe tp show full string (#1678)

* feat(CB2-14459): add validator to DTP number

* feat(CB2-14459): fix validation

* feat(CB2-14459): mark as touched after typing

* feat(CB2-14459): fix casing

* feat(CB2-14459): stability fixes

* feat(CB2-14449): fix unit tests

* fix(handle-recalls-failure): handle recalls failure (#1689)

* feat(CB2-14449-tomc): validation changes and unnecessary html code removed (#1691) (#1692)

* feat(CB2-14459): prevent issues on create

* feat(CB2-15809): fix notes not showing dash when empty (#1712)

* feat(feat/cb2-15817): gap removed for body (#1713)

Co-authored-by: Tom Evans <thomas.evans@dvsa.gov.uk>
Co-authored-by: Brandon Thomas-Davies <87308252+BrandonT95@users.noreply.github.com>

* feat(cb2-14449): make body make required when dangerous goods is true (#1711)

* feat(cb2-14449): make body make required when dangerous goods is true

* feat(cb2-14449): revert adr spec change

* feat(feat/cb2-14449): missing lines

* feat(CB2-14449): fix unit test

* feat(feat/cb2-14449): fix for function code issue (#1718)

Co-authored-by: Tom Evans <thomas.evans@dvsa.gov.uk>

* feat(feat/cb2-14449): fix for tests

---------

Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com>
Co-authored-by: Brandon Thomas-Davies <87308252+BrandonT95@users.noreply.github.com>
Co-authored-by: Thomas Crawley <thomas.crawley@dvsa.gov.uk>
Co-authored-by: Tom Evans <thomas.evans@dvsa.gov.uk>

* feat(CB2-14450-weights-dfs): remove unit test

---------

Co-authored-by: Thomas Evans <36958694+tomevs88@users.noreply.github.com>
Co-authored-by: Tom Evans <thomas.evans@dvsa.gov.uk>
Co-authored-by: Thomas Crawley <thomas.crawley@dvsa.gov.uk>
Co-authored-by: Brandon Thomas-Davies <87308252+BrandonT95@users.noreply.github.com>
  • Loading branch information
5 people authored Jan 14, 2025
1 parent a8142d8 commit 3d59ade
Show file tree
Hide file tree
Showing 58 changed files with 2,355 additions and 132 deletions.
27 changes: 25 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvs-app-vtm",
"version": "1.29",
"version": "1.30",
"description": "DVSA CVS Vehicle Testing Management Application",
"main": "index.js",
"engines": {
Expand Down Expand Up @@ -75,6 +75,7 @@
"@commitlint/config-conventional": "^18.6.2",
"@compodoc/compodoc": "^1.1.23",
"@dvsa/biome-config": "0.2.0",
"@dvsa/cvs-microservice-common": "1.3.1",
"@ngrx/schematics": "^18.0.2",
"@sentry/cli": "^2.32.2",
"@types/jest": "^29.5.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@
<div class="govuk-summary-list__row" *ngIf="techRecordEdited.techRecord_vehicleType !== 'psv'">
<dt class="govuk-summary-list__key">Make</dt>
<dd class="govuk-summary-list__value" id="test-techRecord_make">
{{
techRecordEdited.techRecord_vehicleType === 'trl' || techRecordEdited.techRecord_vehicleType === 'hgv'
? (techRecordEdited.techRecord_make | defaultNullOrEmpty)
: '-'
{{
techRecordEdited.techRecord_vehicleType === 'trl' || techRecordEdited.techRecord_vehicleType === 'hgv'
? (techRecordEdited.techRecord_make | defaultNullOrEmpty)
: '-'
}}
</dd>
</div>
<div class="govuk-summary-list__row" *ngIf="techRecordEdited.techRecord_vehicleType !== 'psv'">
<dt class="govuk-summary-list__key">Model</dt>
<dd class="govuk-summary-list__value" id="test-techRecord_model">
{{
techRecordEdited.techRecord_vehicleType === 'trl' || techRecordEdited.techRecord_vehicleType === 'hgv'
? (techRecordEdited.techRecord_model | defaultNullOrEmpty)
: '-'
{{
techRecordEdited.techRecord_vehicleType === 'trl' || techRecordEdited.techRecord_vehicleType === 'hgv'
? (techRecordEdited.techRecord_model | defaultNullOrEmpty)
: '-'
}}
</dd>
</div>
Expand Down Expand Up @@ -156,7 +156,15 @@
techRecordEdited.techRecord_vehicleType === 'trl'
"
>
<app-tyres [vehicleTechRecord]="techRecordEdited"></app-tyres>
<!-- New Tyres section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsTyres'); else oldTyresSection">
<app-tyres-section [techRecord]="techRecordEdited" [mode]="'summary'"></app-tyres-section>
</ng-container>

<!-- Old Tyres section -->
<ng-template #oldTyresSection>
<app-tyres [vehicleTechRecord]="techRecordEdited"></app-tyres>
</ng-template>
</ng-container>
</ng-container>

Expand All @@ -176,10 +184,27 @@
You removed an axle.
</strong>
</div>
<app-weights [vehicleTechRecord]="techRecordEdited"></app-weights>
<!-- New Weights section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsWeights'); else oldWeightsSection">
<app-weights-section [techRecord]="techRecordEdited" [mode]="'summary'"/>
</ng-container>

<!-- Old Weights section -->
<ng-template #oldWeightsSection>
<app-weights [vehicleTechRecord]="techRecordEdited"></app-weights>
</ng-template>
</ng-container>

<ng-template #noDeleted>
<app-modified-weights *ngIf="changesForWeights" [vehicleType]="vehicleType" [changes]="changesForWeights"></app-modified-weights>
<!-- New Weights section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsWeights'); else oldModifiedWeightsSection">
<app-weights-section [techRecord]="techRecordEdited" [mode]="'summary'"/>
</ng-container>

<!-- Old Weights section -->
<ng-template #oldModifiedWeightsSection>
<app-modified-weights *ngIf="changesForWeights" [vehicleType]="vehicleType" [changes]="changesForWeights"></app-modified-weights>
</ng-template>
</ng-template>
</ng-container>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ describe('TechRecordSummaryComponent', () => {
.mockReturnValue(of('articulated'));
const formPatchSpy = jest.spyOn(form, 'patchValue');
component.form = form;
component.form.get('techRecord_vehicleConfiguration')?.markAsDirty();
component.handleVehicleConfigurationChanges();
expect(subscriptionSpy).toHaveBeenCalled();
expect(formPatchSpy).toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,48 @@
</ng-container>

<ng-container *ngSwitchCase="'tyreSection'">
<app-tyres
*ngIf="
techRecordCalculated.techRecord_vehicleType === 'trl' ||
techRecordCalculated.techRecord_vehicleType === 'hgv' ||
techRecordCalculated.techRecord_vehicleType === 'psv'
"
[vehicleTechRecord]="techRecordCalculated"
[isEditing]="(isEditing$ | async) ?? false"
(formChange)="handleFormState($event)"
></app-tyres>
<ng-container *ngIf="
techRecordCalculated.techRecord_vehicleType === 'trl' ||
techRecordCalculated.techRecord_vehicleType === 'hgv' ||
techRecordCalculated.techRecord_vehicleType === 'psv'
">
<!-- New Tyres section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsTyres'); else oldTyresSection">
<app-tyres-section [techRecord]="techRecordCalculated" [mode]="(isEditing$ | async) ? 'edit' : 'view'" />
</ng-container>

<!-- Old Tyres section -->
<ng-template #oldTyresSection>
<app-tyres
[vehicleTechRecord]="techRecordCalculated"
[isEditing]="(isEditing$ | async) ?? false"
(formChange)="handleFormState($event)"
></app-tyres>
</ng-template>
</ng-container>
</ng-container>

<ng-container *ngSwitchCase="'weightsSection'">
<app-weights
*ngIf="
<ng-container *ngIf="
techRecordCalculated.techRecord_vehicleType === 'trl' ||
techRecordCalculated.techRecord_vehicleType === 'hgv' ||
techRecordCalculated.techRecord_vehicleType === 'psv'
"
[vehicleTechRecord]="techRecordCalculated"
[isEditing]="(isEditing$ | async) ?? false"
(formChange)="handleFormState($event)"
></app-weights>
">
<!-- New Weights Section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsWeights'); else oldWeightsSection">
<app-weights-section
[techRecord]="techRecordCalculated"
[mode]="(isEditing$ | async) ? 'edit' : 'view'"/>
</ng-container>
<!-- Old Weights Section -->
<ng-template #oldWeightsSection>
<app-weights
[vehicleTechRecord]="techRecordCalculated"
[isEditing]="(isEditing$ | async) ?? false"
(formChange)="handleFormState($event)"
></app-weights>
</ng-template>
</ng-container>
</ng-container>

<ng-container *ngSwitchCase="'lettersSection'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export class TechRecordSummaryComponent implements OnInit, OnDestroy, AfterViewI
});

this.form.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((changes) => {
this.handleFormState(changes);
this.techRecordCalculated = mergeWith(cloneDeep(this.techRecordCalculated), changes);
this.technicalRecordService.updateEditingTechRecord(this.techRecordCalculated as TechRecordType<'put'>);
});
}

Expand All @@ -183,25 +184,26 @@ export class TechRecordSummaryComponent implements OnInit, OnDestroy, AfterViewI
// TODO clean this up in the future
const formControl = this.form.get('techRecord_vehicleConfiguration');
formControl?.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value) => {
if (!value) {
return;
}
if (this.techRecordCalculated?.techRecord_vehicleType === VehicleTypes.HGV && value === 'articulated') {
if (value && formControl?.dirty) {
if (this.techRecordCalculated?.techRecord_vehicleType === VehicleTypes.HGV && value === 'articulated') {
this.form.patchValue({
techRecord_bodyType_description: 'articulated',
techRecord_bodyType_code: 'a',
});
}

const functionCodes: Record<string, string> = {
rigid: 'R',
articulated: 'A',
'semi-trailer': 'A',
};

const functionCode = functionCodes[value];
this.form.patchValue({
techRecord_bodyType_description: 'articulated',
techRecord_bodyType_code: 'a',
techRecord_functionCode: functionCode,
});
formControl.markAsPristine();
}
const functionCodes: Record<string, string> = {
rigid: 'R',
articulated: 'A',
'semi-trailer': 'A',
};

const functionCode = functionCodes[value];
this.form.patchValue({
techRecord_functionCode: functionCode,
});
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export class ConfirmCancellationComponent implements OnDestroy {
}

handleSubmit() {
if (!this.form.valid) return;
if (!this.form.valid) {
this.form.markAllAsTouched();
return;
}

const reason: string = this.form.get('reason')?.value;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { TestType } from '@models/test-types/test-type.model';
import { TestType, resultOfTestEnum } from '@models/test-types/test-type.model';
import { V3TechRecordModel, VehicleConfigurations, VehicleTypes } from '@models/vehicle-tech-record.model';
import { provideMockStore } from '@ngrx/store/testing';
import { HttpService } from '@services/http/http.service';
Expand Down Expand Up @@ -109,4 +109,20 @@ describe('VehicleHeaderComponent', () => {
expect(component.isADRTest).toBe(false);
});
});

describe('shouldShowAbandonCert', () => {
it('should return true if the VTG/VTP12 document should show', () => {
jest.spyOn(component, 'resultOfTest', 'get').mockReturnValue(resultOfTestEnum.abandoned);
jest.spyOn(component, 'test', 'get').mockReturnValue({ testTypeId: '3' } as TestType);
jest.spyOn(component, 'vehicleTypes', 'get').mockReturnValue('psv' as unknown as typeof VehicleTypes);
expect(component.shouldShowAbandonCert).toBe(true);
});

it('should return false if the VTG/VTP12 document should show', () => {
jest.spyOn(component, 'resultOfTest', 'get').mockReturnValue(resultOfTestEnum.abandoned);
jest.spyOn(component, 'test', 'get').mockReturnValue({ testTypeId: '193' } as TestType);
jest.spyOn(component, 'vehicleTypes', 'get').mockReturnValue('psv' as unknown as typeof VehicleTypes);
expect(component.shouldShowAbandonCert).toBe(false);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ <h1 class="govuk-heading-l">
</div>

<!-- Recalls warning -->
<app-field-warning-message
*ngIf="(recalls | async)?.hasRecall"
<app-field-warning-message
*ngIf="(recalls | async)?.hasRecall"
warningMessage="This vehicle has an outstanding vehicle recall. Tell the presenter to contact their nearest dealership to arrange for a free repair.">
</app-field-warning-message>

<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
<h2 class="govuk-heading-m">Vehicle details</h2>
Expand Down Expand Up @@ -97,8 +97,8 @@ <h1 class="govuk-heading-l govuk-!-margin-bottom-2">
</div>

<!-- Recalls warning -->
<app-field-warning-message
*ngIf="(recalls | async)?.hasRecall"
<app-field-warning-message
*ngIf="(recalls | async)?.hasRecall"
warningMessage="This vehicle has an outstanding vehicle recall. Tell the presenter to contact their nearest dealership to arrange for a free repair.">
</app-field-warning-message>

Expand Down Expand Up @@ -212,6 +212,14 @@ <h3 class="govuk-heading-m">Vehicle overview</h3>
</app-test-certificate>
</dd>
</div>
<div *ngIf="shouldShowAbandonCert" class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">{{ abandonCertDocName }} document</dt>
<dd id="test-vtg-vtp-document" class="govuk-summary-list__value">
<a class="link" appRetrieveDocument [params]="params" [fileName]="fileName">
Download
</a>
</dd>
</div>
</dl>
</ng-container>
</ng-container>
Loading

0 comments on commit 3d59ade

Please sign in to comment.