From e5d2de9433624a148e342d61c54e1be646bcc514 Mon Sep 17 00:00:00 2001 From: Thomas Crawley Date: Mon, 15 Apr 2024 09:11:30 +0100 Subject: [PATCH] feat/CB2-10740 - Mark if a vehicle is used for international journeys on VTM (#1467) * feat(cb2-10740): hook up template and values correctly to type definition * feat(cb2-10740): lint fix --------- Co-authored-by: pbardy2000 <146740183+pbardy2000@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- ...xaminer-notes-history-view.component.spec.ts | 3 +-- .../templates/general/adr-summary.template.ts | 12 ++++++++++++ src/app/forms/templates/general/adr.template.ts | 17 ++++++++++++++++- .../technical-record-service.reducer.ts | 1 + 6 files changed, 35 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d68358f86..1be11df96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@angular/router": "^17.2.1", "@azure/msal-angular": "^3.0.13", "@azure/msal-browser": "^3.10.0", - "@dvsa/cvs-type-definitions": "^6.2.0", + "@dvsa/cvs-type-definitions": "^6.3.0", "@ngrx/effects": "^17.1.0", "@ngrx/entity": "^17.1.0", "@ngrx/router-store": "^17.1.0", @@ -3723,9 +3723,9 @@ } }, "node_modules/@dvsa/cvs-type-definitions": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@dvsa/cvs-type-definitions/-/cvs-type-definitions-6.2.0.tgz", - "integrity": "sha512-r1oPXfn0WeP9zitBJVU+w0r4Eco4t02Wl54UdxeEdJ6B0u0BNC7mIQ1Wr1RqQmMw4kCFSIYop6RinEVpbp/WtA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@dvsa/cvs-type-definitions/-/cvs-type-definitions-6.3.0.tgz", + "integrity": "sha512-wWeGVDdfacUnO+aM1a/42k72XJjPwWIT/9Fc94hJATdUeF8b4rd7DefDXHEzlP+7uZr7CwtVn0/bLStJ7n35Tw==", "dependencies": { "ajv": "^8.12.0", "json-schema-deref-sync": "^0.14.0", diff --git a/package.json b/package.json index e82a2f37c..01bfaf4df 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@angular/router": "^17.2.1", "@azure/msal-angular": "^3.0.13", "@azure/msal-browser": "^3.10.0", - "@dvsa/cvs-type-definitions": "^6.2.0", + "@dvsa/cvs-type-definitions": "^6.3.0", "@ngrx/effects": "^17.1.0", "@ngrx/entity": "^17.1.0", "@ngrx/router-store": "^17.1.0", diff --git a/src/app/forms/custom-sections/adr-examiner-notes-history-view/adr-examiner-notes-history-view.component.spec.ts b/src/app/forms/custom-sections/adr-examiner-notes-history-view/adr-examiner-notes-history-view.component.spec.ts index 3d10b4299..cac1bda6d 100644 --- a/src/app/forms/custom-sections/adr-examiner-notes-history-view/adr-examiner-notes-history-view.component.spec.ts +++ b/src/app/forms/custom-sections/adr-examiner-notes-history-view/adr-examiner-notes-history-view.component.spec.ts @@ -8,9 +8,8 @@ import { mockVehicleTechnicalRecord } from '@mocks/mock-vehicle-technical-record import { VehicleTypes } from '@models/vehicle-tech-record.model'; import { TechRecordType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-vehicle-type'; import { of } from 'rxjs'; -import { AdrExaminerNotesHistoryViewComponent } from './adr-examiner-notes-history-view.component'; import { RouterService } from '@services/router/router.service'; - +import { AdrExaminerNotesHistoryViewComponent } from './adr-examiner-notes-history-view.component'; describe('AdrExaminerNotesHistoryViewComponent', () => { let component: AdrExaminerNotesHistoryViewComponent; diff --git a/src/app/forms/templates/general/adr-summary.template.ts b/src/app/forms/templates/general/adr-summary.template.ts index b95eca03e..3ef290f77 100644 --- a/src/app/forms/templates/general/adr-summary.template.ts +++ b/src/app/forms/templates/general/adr-summary.template.ts @@ -173,6 +173,18 @@ export const AdrSummaryTemplate: FormNode = { }, ], }, + { + name: 'techRecord_adrDetails_vehicleDetails_usedOnInternationalJourneys', + label: 'Vehicle used on international journeys', + type: FormNodeTypes.CONTROL, + options: [ + { value: 'yes', label: 'Yes' }, + { value: 'no', label: 'No' }, + { value: 'n/a', label: 'Not applicable' }, + ], + hide: true, + groups: ['adr_details', 'dangerous_goods'], + }, { name: 'techRecord_adrDetails_vehicleDetails_approvalDate', label: 'Date processed', diff --git a/src/app/forms/templates/general/adr.template.ts b/src/app/forms/templates/general/adr.template.ts index dfe6e4fcb..2ea993c83 100644 --- a/src/app/forms/templates/general/adr.template.ts +++ b/src/app/forms/templates/general/adr.template.ts @@ -24,7 +24,9 @@ import { import { AdrTankDetailsInitialInspectionViewComponent, } from '@forms/custom-sections/adr-tank-details-initial-inspection-view/adr-tank-details-initial-inspection-view.component'; -import { AdrTankDetailsM145ViewComponent } from '@forms/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component'; +import { + AdrTankDetailsM145ViewComponent, +} from '@forms/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component'; import { AdrTankDetailsSubsequentInspectionsEditComponent, } from '@forms/custom-sections/adr-tank-details-subsequent-inspections-edit/adr-tank-details-subsequent-inspections-edit.component'; @@ -178,6 +180,19 @@ export const AdrTemplate: FormNode = { }, ], }, + { + name: 'techRecord_adrDetails_vehicleDetails_usedOnInternationalJourneys', + label: 'Vehicle used on international journeys', + type: FormNodeTypes.CONTROL, + editType: FormNodeEditTypes.RADIO, + options: [ + { value: 'yes', label: 'Yes' }, + { value: 'no', label: 'No' }, + { value: 'n/a', label: 'Not applicable' }, + ], + hide: true, + groups: ['adr_details', 'dangerous_goods'], + }, { name: 'techRecord_adrDetails_vehicleDetails_approvalDate', label: 'Date processed', diff --git a/src/app/store/technical-records/reducers/technical-record-service.reducer.ts b/src/app/store/technical-records/reducers/technical-record-service.reducer.ts index fa0c2f1a5..320ce6095 100644 --- a/src/app/store/technical-records/reducers/technical-record-service.reducer.ts +++ b/src/app/store/technical-records/reducers/technical-record-service.reducer.ts @@ -427,6 +427,7 @@ function handleClearADRDetails(state: TechnicalRecordServiceState) { editingTechRecord: { ...editingTechRecord, techRecord_adrDetails_vehicleDetails_type: null, + techRecord_adrDetails_vehicleDetails_usedOnInternationalJourneys: null, techRecord_adrDetails_vehicleDetails_approvalDate: null, techRecord_adrDetails_permittedDangerousGoods: null, ...nulledCompatibilityGroupJ,