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/cb2 14449 #1715

Merged
merged 205 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 200 commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
e653a0a
chore(cb2-0000): basic form
pbardy2000 Sep 17, 2024
71fd840
chore(cb2-0000): changes
pbardy2000 Sep 18, 2024
d0f4abc
chore(cb2-0000): add view and summary mode
pbardy2000 Sep 19, 2024
f28a586
chore(cb2-0000): add example directive
pbardy2000 Sep 19, 2024
153e671
chore(cb2-0000): initial implementation of vehicle summary section
BrandonT95 Sep 20, 2024
47b3951
chore(cb2-0000): add dates and directives
pbardy2000 Sep 23, 2024
50f8e60
Merge branch 'chore/dfs-poc-phil' into chore/poc-vehicle-section
BrandonT95 Sep 23, 2024
edf63af
chore(cb2-0000): rebase and lint
BrandonT95 Sep 23, 2024
604cf10
chore(cb2-0000): additional vehicle section properties
tomcrawleyy Sep 23, 2024
9949212
feat(cb2-0000): add additional directives
tomcrawleyy Sep 26, 2024
e165d39
chore(cb2-0000): adr section changes
pbardy2000 Sep 30, 2024
f441cb5
Merge branch 'develop' into chore/dfs-poc-phil
pbardy2000 Sep 30, 2024
c74744d
chore(cb2-0000): fix issues with global error service
pbardy2000 Oct 1, 2024
0ca87d0
Merge branch 'chore/dfs-poc-phil' into chore/poc-vehicle-section
pbardy2000 Oct 1, 2024
8aa5a8b
chore(cb2-0000): fix linting
pbardy2000 Oct 1, 2024
a6c9303
chore(cb2-0000): fix validation for ADR section
pbardy2000 Oct 1, 2024
38be6e1
chore(cb2-0000): fix tc3 validator
pbardy2000 Oct 1, 2024
f276392
Merge branch 'chore/dfs-poc-phil' into chore/poc-vehicle-section
BrandonT95 Oct 1, 2024
6a04365
chore(cb2-0000): commit progress on vehicle summary
BrandonT95 Oct 2, 2024
b05a454
chore(poc-vehicle-section): hgv options and accessibility refactor
tomcrawleyy Oct 2, 2024
d542534
chore(cb2-0000): general ADR section fixes
pbardy2000 Oct 2, 2024
422b21c
chore(cb2-0000): attempt at adding controls based off vehicle type
BrandonT95 Oct 2, 2024
c6417d3
chore(cb2-0000): attempt at adding controls based off vehicle type im…
BrandonT95 Oct 2, 2024
5ed5d1a
chore(cb2-0000): improve form typing
BrandonT95 Oct 2, 2024
13115da
feat(cb2-0000): migrate remaining elements to new accessibility syntax
tomcrawleyy Oct 2, 2024
2e5664a
chore(cb2-0000): move vehicle class based off vehicle type
BrandonT95 Oct 2, 2024
40547fa
feat(cb2-0000): styling POC
tomcrawleyy Oct 3, 2024
c9bf763
chore(cb2-0000): styling fixes
pbardy2000 Oct 3, 2024
e62ce51
chore(cb2-0000): allow editing fields on different pages
pbardy2000 Oct 3, 2024
804ed36
Merge branch 'chore/dfs-poc-phil' into chore/poc-vehicle-section
BrandonT95 Oct 3, 2024
3308641
feat(cb2-0000): update to use new global scss styles
tomcrawleyy Oct 4, 2024
4185839
Merge branch 'chore/poc-vehicle-section', remote-tracking branch 'ori…
tomcrawleyy Oct 4, 2024
0c3d7a4
feat(cb2-0000): add select style class
tomcrawleyy Oct 4, 2024
4f88ce8
feat(cb2-0000): input and split control styling
tomcrawleyy Oct 4, 2024
1573296
feat(cb2-0000): remove additional redundant duplicated code
tomcrawleyy Oct 4, 2024
11b9fd8
Merge branch 'chore/poc-vehicle-section-styling' into feat/CB2-14451
pbardy2000 Nov 25, 2024
2e11a52
feat(CB2-14451): fix html
pbardy2000 Nov 25, 2024
7a24f1f
feat(CB2-14451): fix feature flag
pbardy2000 Nov 25, 2024
9caa3ac
feat(cb2-14451): minor changes
tomcrawleyy Nov 25, 2024
a3f06ad
feat(cb2-14451): add radio type to radio components
tomcrawleyy Nov 25, 2024
bf04a57
feat(CB2-14451): fix form controls
pbardy2000 Nov 25, 2024
bf585f8
feat(CB2-14451): view mode progress
tomcrawleyy Nov 26, 2024
90139e9
feat(cb2-14451): fix styling
tomcrawleyy Nov 26, 2024
c6349f5
feat(cb2-14451): fix euro standard text
tomcrawleyy Nov 26, 2024
c7ffc97
feat(cb2-14451): HGV view component
tomcrawleyy Nov 26, 2024
b0eaa1a
feat(CB2-14451): TRL view mode
tomcrawleyy Nov 26, 2024
6ad525d
feat(cb2-14451): date of first reg text fix
tomcrawleyy Nov 26, 2024
9d63b04
feat(cb2-14451): motorcycle no of wheels driven
tomcrawleyy Nov 26, 2024
8de3b78
feat(cb2-14451): psv view mode
tomcrawleyy Nov 26, 2024
ad86fdc
feat(cb2-0000): commit progress
BrandonT95 Nov 27, 2024
37c0657
Merge branch 'feat/CB2-14451' into feat/vs-edit-brandon
pbardy2000 Nov 27, 2024
d89ab11
feat(CB2-14451): use checkbox group component
pbardy2000 Nov 27, 2024
163a90a
feat(CB2-14451): convert to old syntax
pbardy2000 Nov 27, 2024
d214fed
feat(cb2-14451): exempt view mode transformations
tomcrawleyy Nov 27, 2024
0e080ea
feat(cb2-14451): date pipe fix
tomcrawleyy Nov 27, 2024
e551c83
feat(cb2-14451): edit mode progress
BrandonT95 Nov 27, 2024
4ed3df2
feat(cb2-14451): small trailer view mode
tomcrawleyy Nov 28, 2024
821483f
feat(cb2-14451): more edit mode progress
BrandonT95 Nov 28, 2024
19f9e7d
feat(cb2-14451): radio component
tomcrawleyy Nov 28, 2024
5e33073
feat(cb2-14451): edit mode finish trl fields
BrandonT95 Nov 28, 2024
422f760
feat(CB2-14451): radio component implementation attempt 1
tomcrawleyy Nov 28, 2024
6118764
feat(CB2-14451): add radio component
pbardy2000 Nov 28, 2024
803c6e4
feat(CB2-14451): populate fields correctly in amend
pbardy2000 Nov 28, 2024
7fe793c
feat(cb2-14451): use radio component for radio controls
BrandonT95 Nov 29, 2024
ef93d48
feat(cb2-0000): implement validation for controls
BrandonT95 Nov 29, 2024
11dcd2f
feat(cb2-14451): add multi option pipe (#1656)
pbardy2000 Nov 29, 2024
12f4288
Merge branch 'feat/CB2-14451' into feat/vs-edit-brandon-2
BrandonT95 Nov 29, 2024
69314f3
feat(cb2-0000): dynamically display tags based off vehicle type
BrandonT95 Nov 29, 2024
d3b4f8f
feat(CB2-14451): update multi option and radios
pbardy2000 Nov 29, 2024
95e04d6
feat(cb2-0000): comment out method
BrandonT95 Nov 29, 2024
9ccf483
feat(cb2-0000): fix psv seat validator
BrandonT95 Dec 2, 2024
6726d0f
Merge branch 'feat/vs-edit-brandon-2' into feat/CB2-14451
BrandonT95 Dec 2, 2024
8a43837
feat(cb2-0000): fix conflicts
BrandonT95 Dec 2, 2024
593ae0a
feat/cb2-14451-select-component - new select component (#1657)
tomcrawleyy Dec 2, 2024
ea4cef9
feat(cb2-14451): add fors to date labels
pbardy2000 Dec 2, 2024
d70c624
feat(cb2-14451): reg date validators
Dec 2, 2024
174989e
feat(cb2-14451): ui fix for required and plates
Dec 2, 2024
4973be1
feat(CB2-14451): update function code
pbardy2000 Dec 2, 2024
855bf98
feat(cb2-14451): update noAxles when adding axles
pbardy2000 Dec 2, 2024
3a79db3
feat(CB2-14451): make number of axles a number input
pbardy2000 Dec 2, 2024
7066c37
feat(cb2-0000): edit section unit test progress
BrandonT95 Dec 2, 2024
b8a7a4e
feat(CB2-14451): remove speed limiter exempt plates tag for psv
pbardy2000 Dec 2, 2024
f4817cd
feat(CB2-14451): regression pack fixes
pbardy2000 Dec 2, 2024
e0b12f9
feat(cb2-14451): plates labels
Dec 3, 2024
d676b73
feat(CB2-14451): more pack fixes
pbardy2000 Dec 3, 2024
e0e7f6f
feat/cb2-14451-input-component - Introduce input components (#1658)
tomcrawleyy Dec 3, 2024
4ed97d8
feat(cb2-0000): edit section unit test progress
BrandonT95 Dec 3, 2024
82ab167
feat(cb2-0000): edit section unit test progress
BrandonT95 Dec 3, 2024
c148f9a
feat(CB2-14451): styling fixes
pbardy2000 Dec 3, 2024
166528f
feat(cb2-0000): edit section unit test progress
BrandonT95 Dec 3, 2024
7a916d3
feat(cb2-14451): test changes
tomcrawleyy Dec 3, 2024
e9933cf
feat(cb2-14451): fix psv seat tests
tomcrawleyy Dec 3, 2024
7004a4d
feat(CB2-14451): fix unit tests
pbardy2000 Dec 3, 2024
1852349
feat(cb2-0000): final unit tests complete for vehicle section edit mode
BrandonT95 Dec 3, 2024
3f2eb10
feat(cb2-14451): add date control
pbardy2000 Dec 3, 2024
c0f5d44
feat(CB2-14451): small fixes
pbardy2000 Dec 4, 2024
d5b8e91
feat(cb2-14451): missing inputs
tomcrawleyy Dec 4, 2024
b3fe7fe
feat(cb2-14451): use custom components (#1659)
pbardy2000 Dec 4, 2024
096bae7
feat(CB2-14451): add tags to select
pbardy2000 Dec 4, 2024
33fc040
feat(CB2-14451): add review screen
pbardy2000 Dec 4, 2024
71bf2d0
feat(CB2-14451): small corrections
pbardy2000 Dec 4, 2024
efee7f9
feat(CB2-14451): add date validation to seatbelt installation
pbardy2000 Dec 4, 2024
f709d88
feat(CB2-14451): fix tags and plates tag
tomcrawleyy Dec 5, 2024
a832fc6
feat(cb2-14451): fix width for select
tomcrawleyy Dec 5, 2024
1b13c39
feat(cb2-14451): select width and month of manufacture fixes
tomcrawleyy Dec 5, 2024
f8e8dba
feat(CB2-14459): boiler plate for body section
pbardy2000 Dec 6, 2024
94f90e2
feat(CB2-14451): fixes
pbardy2000 Dec 6, 2024
4dad2e3
Merge branch 'feat/CB2-14451' into feat/CB2-14459
tomcrawleyy Dec 6, 2024
5e01f21
Merge branch 'develop' into feat/CB2-14451
pbardy2000 Dec 6, 2024
2e969c0
Merge branch 'feat/CB2-14451' into feat/CB2-14459
pbardy2000 Dec 6, 2024
aed3804
feat(CB2-14459): boilerplate for edit
tomcrawleyy Dec 6, 2024
0ea91f7
feat(cb2-14459): body view component progress
BrandonT95 Dec 6, 2024
2a30f04
feat(cb2-14459): body summary component progress
BrandonT95 Dec 9, 2024
c8f410e
feat(CB2-14449): add notes section
pbardy2000 Dec 9, 2024
b75f435
Merge branch 'feat/CB2-14459' into feat/CB2-14449
pbardy2000 Dec 9, 2024
4a19959
feat/cb2-14459-edit - merge edit into main branch (#1665)
tomcrawleyy Dec 9, 2024
57d9804
feat(CB2-14459): add additional fields
tomcrawleyy Dec 9, 2024
bfbf6c1
feat(CB2-14459): stash for swarm
tomcrawleyy Dec 10, 2024
be2061e
feat(CB2-14459): stash for swarm
tomcrawleyy Dec 10, 2024
61f9897
feat(CB2-14459): fix body makes
tomcrawleyy Dec 10, 2024
9b7ae5c
feat(CB2-14459): add tags fix label styling and function code not pul…
tomcrawleyy Dec 10, 2024
c0a0984
feat(CB2-14459): start on vehicle configuration linking
tomcrawleyy Dec 10, 2024
e492e7d
feat(CB2-14459): fix autocomplete
pbardy2000 Dec 10, 2024
6a9747a
feat(CB2-14459): update values from parent component
tomcrawleyy Dec 10, 2024
dfaecbc
feat(CB2-14459): fix feature flag not showing old section
tomcrawleyy Dec 10, 2024
2549bd0
feat(CB2-14459): stash
tomcrawleyy Dec 10, 2024
8bfdd03
feat(CB2-14459): stash
tomcrawleyy Dec 10, 2024
fdad7ec
feat(CB2-14459): dtp number fix maybe
tomcrawleyy Dec 10, 2024
ed563e2
feat(CB2-14459): body type code
tomcrawleyy Dec 10, 2024
d62f7b3
feat(cb2-14459): fix undefined custom components when flag enabled
BrandonT95 Dec 10, 2024
140d185
feat(CB2-14459): starting tests
tomcrawleyy Dec 11, 2024
8979133
feat(CB2-14459): remove redundant tests
tomcrawleyy Dec 11, 2024
6c1fe5c
feat(cb2-14459): ngdestroy test
Dec 11, 2024
4f014ab
feat(CB2-14459): first attempt at testing dtp number on change logic
tomcrawleyy Dec 11, 2024
4f9f4b0
feat(CB2-14459): minor unit test updates
tomcrawleyy Dec 11, 2024
eb128e3
feat(CB2-14459): minor unit test updates
tomcrawleyy Dec 11, 2024
379cfc3
feat(CB2-14459): dtp number changing test amendments
tomcrawleyy Dec 11, 2024
87227cd
feat(CB2-14459): minor unit test updates
tomcrawleyy Dec 11, 2024
b677100
feat(CB2-14459): unit test conquered
tomcrawleyy Dec 11, 2024
1016db8
feat(cb2-14459): unit test progress
BrandonT95 Dec 11, 2024
fe9a25a
feat(CB2-14459): vehicle configuration changes
tomcrawleyy Dec 11, 2024
64f443a
feat(CB2-14459): fix autocomplete
pbardy2000 Dec 11, 2024
16cdd98
feat(CB2-14459): fix plates tag on year of manufacture
tomcrawleyy Dec 11, 2024
1a322a1
feat(CB2-14459): remove commented out logic
tomcrawleyy Dec 11, 2024
8e00d3c
feat(CB2-14459): fix autocomplete again
pbardy2000 Dec 11, 2024
6e17ade
Merge branch 'develop' into feat/CB2-14459
pbardy2000 Dec 11, 2024
cf16bc2
feat/CB2-14459 - Body section (#1667)
tomcrawleyy Dec 11, 2024
eb63b78
Merge branch 'feat/CB2-14459' into feat/CB2-14449
pbardy2000 Dec 11, 2024
98655f0
feat(cb2-15556): fix spacing and adding of alteration marker
BrandonT95 Dec 11, 2024
a4ecfa6
feat(CB2-14459): remove console error
pbardy2000 Dec 11, 2024
63a883f
feat(CB2-14459): dtp number is not required for hgv or trl
pbardy2000 Dec 11, 2024
15bdebd
Merge branch 'feat/CB2-14459' into feature/VTMDEV-2
pbardy2000 Dec 11, 2024
5d15d26
feat(CB2-14459): use correct id
pbardy2000 Dec 11, 2024
9861a0f
Merge branch 'feat/CB2-14459' into feature/VTMDEV-2
pbardy2000 Dec 11, 2024
4dd2440
feat(CB2-14451): fix number of seats on psv (#1671)
tomcrawleyy Dec 12, 2024
ecbbf27
feat(CB2-14451): fix number of seats on psv (#1671) (#1672)
tomcrawleyy Dec 12, 2024
250cd9f
fix(CB2-14459): fix additional disabled properties added by mistake (…
tomcrawleyy Dec 12, 2024
24b5e50
Merge branch 'feature/VTMDEV-2' into feat/CB2-14459
tomcrawleyy Dec 12, 2024
260cf76
fix(CB2-14459): fix additional disabled properties added by mistake (…
tomcrawleyy Dec 12, 2024
84cb3c5
feat(CB2-14459): update editing tech record
pbardy2000 Dec 12, 2024
0da20b3
Merge branch 'feature/VTMDEV-2' into feat/CB2-14459
tomcrawleyy Dec 12, 2024
b50cef1
Feat/cb2 14459 (#1674)
tomcrawleyy Dec 12, 2024
d43cd1c
feat(CB2-14459): add missing vehicle type check
tomcrawleyy Dec 12, 2024
025e306
Merge branch 'feature/VTMDEV-2' into feat/CB2-14459
tomcrawleyy Dec 12, 2024
8e34a35
Feat/cb2 14459 (#1675)
tomcrawleyy Dec 12, 2024
4969fc9
feat(CB2-14459): handle body type description change
tomcrawleyy Dec 12, 2024
7e05181
Merge branch 'feature/VTMDEV-2' into feat/CB2-14459
tomcrawleyy Dec 12, 2024
89ec354
Feat/cb2 14459 (#1676)
tomcrawleyy Dec 12, 2024
7859061
feat(CB2-14459): add changes to feature flag logic
tomcrawleyy Dec 12, 2024
6ca4709
Merge branch 'feature/VTMDEV-2' into feat/CB2-14459
tomcrawleyy Dec 12, 2024
f0631cd
feat(CB2-14459): add changes to feature flag logic
tomcrawleyy Dec 12, 2024
bcf7cb8
Feat/cb2 14459 (#1677)
tomcrawleyy Dec 12, 2024
1b45f80
feat(CB2-14459): date of first use
tomcrawleyy Dec 13, 2024
70e328c
feat(CB2-14459): number of seatbelts width fix
tomcrawleyy Dec 13, 2024
cb1c6f2
feat/cb2-14451-vehicle-section-fixes (#1680)
tomcrawleyy Dec 13, 2024
42878c6
feat(cb2-15623): use multi option pipe tp show full string (#1678)
BrandonT95 Dec 13, 2024
afaae3e
Merge branch 'feature/VTMDEV-1' into feat/CB2-14451
tomcrawleyy Dec 13, 2024
d12060e
Merge branch 'feat/CB2-14451' into feat/CB2-14459
pbardy2000 Dec 13, 2024
5beba38
feat(CB2-14459): add validator to DTP number
pbardy2000 Dec 13, 2024
c7b6fa1
Merge branch 'feat/CB2-14459' into feature/VTMDEV-2
pbardy2000 Dec 13, 2024
09a5339
feat(CB2-14459): fix validation
pbardy2000 Dec 13, 2024
0ffd634
Merge branch 'feat/CB2-14459' into feature/VTMDEV-2
pbardy2000 Dec 13, 2024
40fb7d9
feat(CB2-14459): mark as touched after typing
pbardy2000 Dec 16, 2024
217b43a
Merge branch 'feat/CB2-14459' into feature/VTMDEV-2
pbardy2000 Dec 16, 2024
103741e
feat(CB2-14459): fix casing
pbardy2000 Dec 16, 2024
e75d7fd
feat(CB2-14459): stability fixes
pbardy2000 Dec 16, 2024
0d83ead
Merge branch 'feat/CB2-14459' into feature/VTMDEV-2
pbardy2000 Dec 16, 2024
164310d
Merge branch 'develop' into feat/CB2-14449
pbardy2000 Dec 17, 2024
79613f2
Merge branch 'develop' into feat/CB2-14459
pbardy2000 Dec 17, 2024
c2c8ef6
Merge branch 'feat/CB2-14459' into feat/CB2-14449
pbardy2000 Dec 17, 2024
0c5c015
feat(CB2-14449): fix unit tests
pbardy2000 Dec 17, 2024
37e3034
fix(handle-recalls-failure): handle recalls failure (#1689)
pbardy2000 Dec 17, 2024
3c9c705
Merge branch 'feat/CB2-14459' into feat/CB2-14449
pbardy2000 Dec 17, 2024
debe729
feat(CB2-14449-tomc): validation changes and unnecessary html code re…
tomcrawleyy Dec 18, 2024
7f944f1
feat(CB2-14459): prevent issues on create
pbardy2000 Dec 18, 2024
85c7194
Merge branch 'feat/CB2-14459' into feat/CB2-14449
pbardy2000 Dec 18, 2024
4c45298
feat(CB2-15809): fix notes not showing dash when empty (#1712)
tomcrawleyy Jan 9, 2025
d5b357c
feat(feat/cb2-15817): gap removed for body (#1713)
tomevs88 Jan 9, 2025
a8142d8
feat(cb2-14449): make body make required when dangerous goods is true…
BrandonT95 Jan 9, 2025
5e21e6b
Merge branch 'develop' into feat/CB2-14449
tomevs88 Jan 13, 2025
1c9c108
feat(feat/cb2-14449): missing lines
Jan 13, 2025
817f858
feat(CB2-14449): fix unit test
pbardy2000 Jan 13, 2025
32a4d41
Merge branch 'develop' into feat/CB2-14449
tomcrawleyy Jan 13, 2025
cb54622
feat(feat/cb2-14449): fix for function code issue (#1718)
tomevs88 Jan 14, 2025
8d92ec9
feat(feat/cb2-14449): fix for tests
Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@

<ng-template #accordion let-sectionName="sectionName" let-section="section">
<ng-container [ngSwitch]="sectionName">
<ng-container *ngSwitchCase="'notes'">
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsNotes'); else oldNotes">
<app-notes-section [techRecord]="techRecordEdited" mode="summary" />
</ng-container>

<ng-template #oldNotes>
<app-dynamic-form-group [data]="techRecordChanges" [template]="section"></app-dynamic-form-group>
</ng-template>
</ng-container>

<ng-container *ngSwitchCase="'techRecordSummary'">
<!-- New Vehicle Summary section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsVehicleSummary'); else oldTechRecordSummary">
Expand All @@ -95,7 +105,17 @@

</ng-container>

<app-body *ngSwitchCase="'bodySection'" [techRecord]="techRecordEdited" [disableLoadOptions]="true"></app-body>
<ng-container *ngSwitchCase="'bodySection'">
<!-- New Body section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsBody')">
<app-body-section [techRecord]="techRecordEdited" mode="summary" />
</ng-container>

<!-- Old Body section -->
<ng-template #oldBodySection>
<app-body [techRecord]="techRecordEdited" [disableLoadOptions]="true"></app-body>
</ng-template>
</ng-container>

<ng-container *ngSwitchCase="'dimensionsSection'">
<app-dimensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { LettersComponent } from '@forms/custom-sections/letters/letters.compone
import { DynamicFormsModule } from '@forms/dynamic-forms.module';
import { MultiOptionsService } from '@services/multi-options/multi-options.service';

import { FormControl, FormGroup } from '@angular/forms';
import { TechRecordType as TechRecordTypeByVehicle } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-vehicle-type';
import { TechRecordType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-verb';
import { Roles } from '@models/roles.enum';
Expand Down Expand Up @@ -196,4 +197,23 @@ describe('TechRecordSummaryComponent', () => {
expect(dispatchSpy).toHaveBeenCalledWith(updateEditingTechRecord({ vehicleTechRecord: mockTechRecord }));
});
});

describe('handleVehicleConfigurationChanges', () => {
it('should update various form fields once the vehicle configuration changes', () => {
const form = new FormGroup({
techRecord_vehicleConfiguration: new FormControl(''),
techRecord_bodyType_description: new FormControl(''),
techRecord_bodyType_code: new FormControl(''),
techRecord_functionCode: new FormControl(''),
});
const subscriptionSpy = jest
.spyOn(form.get('techRecord_vehicleConfiguration')!.valueChanges, 'pipe')
.mockReturnValue(of('articulated'));
const formPatchSpy = jest.spyOn(form, 'patchValue');
component.form = form;
component.handleVehicleConfigurationChanges();
expect(subscriptionSpy).toHaveBeenCalled();
expect(formPatchSpy).toHaveBeenCalled();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<div class="govuk-grid-column-one-half">
<ng-container *ngFor="let section of sectionTemplates; let i = index">
<app-accordion *ngIf="i >= middleIndex" [id]="section.name" [title]="section.label">
<app-accordion *ngIf="i >= middleIndex" [id]="section.name" [title]="section.label" [isExpanded]="isSectionExpanded$(section.name) | async">
<ng-template [ngTemplateOutlet]="accordion" [ngTemplateOutletContext]="{ sectionName: section.name, section: section }"></ng-template>
</app-accordion>
</ng-container>
Expand All @@ -22,6 +22,23 @@
<form [formGroup]="form">
<ng-container *ngIf="techRecordCalculated">
<ng-container [ngSwitch]="sectionName">
<ng-container *ngSwitchCase="'notesSection'">
<!-- New Notes section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsNotes'); else oldNotes">
<app-notes-section [techRecord]="techRecordCalculated" [mode]="(isEditing$ | async) ? 'edit' : 'view'" />
</ng-container>

<!-- Old Notes section -->
<ng-template #oldNotes>
<app-dynamic-form-group
[data]="techRecordCalculated"
[template]="section"
[edit]="(isEditing$ | async) ?? false"
(formChange)="handleFormState($event)"
></app-dynamic-form-group>
</ng-template>
</ng-container>

<ng-container *ngSwitchCase="'techRecordSummary'">
<!-- New Vehicle Summary section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsVehicleSummary'); else oldTechRecordSummary">
Expand All @@ -40,12 +57,21 @@

</ng-container>

<app-body
*ngSwitchCase="'bodySection'"
[techRecord]="techRecordCalculated"
[isEditing]="(isEditing$ | async) ?? false"
(formChange)="handleFormState($event)"
></app-body>
<ng-container *ngSwitchCase="'bodySection'">
<!-- New Body section -->
<ng-container *ngIf="featureToggleService.isFeatureEnabled('FsBody'); else oldBodySection">
<app-body-section [techRecord]="techRecordCalculated" [mode]="(isEditing$ | async) ? 'edit' : 'view'" />
</ng-container>

<!-- Old Body section -->
<ng-template #oldBodySection>
<app-body
[techRecord]="techRecordCalculated"
[isEditing]="(isEditing$ | async) ?? false"
(formChange)="handleFormState($event)"
></app-body>
</ng-template>
</ng-container>

<ng-container *ngSwitchCase="'dimensionsSection'">
<app-dimensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class TechRecordSummaryComponent implements OnInit, OnDestroy, AfterViewI
isEditing = false;
scrollPosition: [number, number] = [0, 0];
isADRCertGenEnabled = false;
isDFSEnabled = false;
isADREnabled = false;

private axlesService = inject(AxlesService);
private errorService = inject(GlobalErrorService);
Expand All @@ -90,11 +90,11 @@ export class TechRecordSummaryComponent implements OnInit, OnDestroy, AfterViewI

private destroy$ = new Subject<void>();

form = this.fb.group({});
form: FormGroup = this.fb.group({});

ngOnInit(): void {
this.isADRCertGenEnabled = this.featureToggleService.isFeatureEnabled('adrCertToggle');
this.isDFSEnabled = this.featureToggleService.isFeatureEnabled('FsAdr');
this.isADREnabled = this.featureToggleService.isFeatureEnabled('FsAdr');

this.technicalRecordService.techRecord$
.pipe(
Expand Down Expand Up @@ -178,6 +178,34 @@ export class TechRecordSummaryComponent implements OnInit, OnDestroy, AfterViewI
.subscribe((techRecord) => {
if (this.isEditing && techRecord) this.form.patchValue({ ...techRecord });
});

this.handleVehicleConfigurationChanges();
}

handleVehicleConfigurationChanges() {
// 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') {
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_functionCode: functionCode,
});
});
}

get vehicleType() {
Expand Down Expand Up @@ -214,30 +242,44 @@ export class TechRecordSummaryComponent implements OnInit, OnDestroy, AfterViewI
}

get customSectionForms(): Array<CustomFormGroup | CustomFormArray> {
const commonCustomSections = [
this.body?.form,
this.dimensions?.form,
this.tyres?.form,
this.weights?.form,
this.approvalType?.form,
];
const commonCustomSections = this.addCustomSectionsBasedOffFlag();

switch (this.vehicleType) {
case VehicleTypes.PSV:
return [...commonCustomSections, this.psvBrakes.form];
case VehicleTypes.HGV:
return !this.isDFSEnabled ? [...commonCustomSections, this.adr.form] : commonCustomSections;
return !this.isADREnabled ? [...commonCustomSections, this.adr.form] : commonCustomSections;
case VehicleTypes.TRL:
return !this.isDFSEnabled
return !this.isADREnabled
? [...commonCustomSections, this.trlBrakes.form, this.letters.form, this.adr.form]
: [...commonCustomSections, this.trlBrakes.form, this.letters.form];
case VehicleTypes.LGV:
return !this.isDFSEnabled ? [this.adr.form] : [];
return !this.isADREnabled ? [this.adr.form] : [];
default:
return [];
}
}

addCustomSectionsBasedOffFlag(): CustomFormGroup[] {
const sections = [];
if (!this.featureToggleService.isFeatureEnabled('FsBody') && this.body?.form) {
sections.push(this.body.form);
}
if (!this.featureToggleService.isFeatureEnabled('FsDimensions') && this.dimensions?.form) {
sections.push(this.dimensions.form);
}
if (!this.featureToggleService.isFeatureEnabled('FsTyres') && this.tyres?.form) {
sections.push(this.tyres.form);
}
if (!this.featureToggleService.isFeatureEnabled('FsWeights') && this.weights?.form) {
sections.push(this.weights.form);
}
if (!this.featureToggleService.isFeatureEnabled('FsApprovalType') && this.approvalType?.form) {
sections.push(this.approvalType.form);
}
return sections;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
handleFormState(event: any): void {
const isPrimitiveArray = (a: unknown, b: unknown) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
<option value=""></option>
<option *ngFor="let option of options" [value]="option.value" [selected]="option.value === control?.value">{{ option.label }}</option>
</select>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div [class]="style">
<label tag for="{{ id }}" [id]="labelId" class="govuk-label govuk-label--m">
{{ controlLabel }}
<ng-container *ngIf="tags?.length">
<div class="flex gap-2">
<app-tag *ngFor="let tag of tags" [type]="tag.colour">{{ tag.label }}</app-tag>
</div>
</ng-container>
</label>

<ng-container *ngIf="controlHint">
<div class="govuk-hint" id="{{ hintId }}"> {{ controlHint }} </div>
</ng-container>

<ng-container *ngIf="hasError">
<p class="govuk-error-message" id="{{ errorId }}">
<span class="govuk-visually-hidden">Error: </span>
<span>{{ (control?.errors | keyvalue)?.[0]?.value }}</span>
</p>
</ng-container>

<div [class]="innerStyle">
<select id="{{ id }}"></select>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.autocomplete__wrapper {
z-index: 0;
font-family: 'GDS Transport', arial, sans-serif;
}

.extra-margin {
margin-bottom: 30px;
}

.internal-wrapper {
margin-top: 10px;
display: flex;

.prefix {
border: 2px solid #0b0c0c;
border-right: 0;
height: fit-content;
}

@media (max-width: 640px) {
.prefix {
line-height: 1.25;
}
}
}
Loading
Loading