Skip to content

Commit

Permalink
fix(cb2-11908): Change labels of examiner notes (#1491)
Browse files Browse the repository at this point in the history
* feat(cb2-10241): update adr notes to use custom component (#1446)

* feat/CB2-11250 - Edit button on additional examiner notes takes you to blank page (#1447)

* feat(cb2-10241): update adr notes to use custom component

* feat(cb2-11250): format table

* feat(cb2-11250): set up router link

* feat(cb2-11250): blank page link working

* feat(cb2-11250): revert unnecessary changes

* feat(cb2-11250): amend routing function

* feat(cb2-11250): fix linting and add unit test

* feat(cb2-11250): fix linting and add unit test

* feat(cb2-11250): update link design

* feat(cb2-11250): fix button link styling

---------

Co-authored-by: Brandon Thomas-Davies <[email protected]>

* feat(CB2-9916): Add warning to cherished transfer (#1451)

* feat(cb2-9916): added cherised transfer warning message for psv and hgv

* feat(cb2-9916): fix linting

* feat(cb2-10032): add pagination to adr examiner notes (#1450)

* feat(cb2-10032): add pagination to adr examiner notes

* feat(cb2-10032): add pagination to notes amend view

* feat(cb2-11103): createdAtDate for adr examiner notes now save as full iso date string (#1452)

* feat(cb2-11103): ability to submit and show date and time for adr notes creation

* feat(cb2-11103): fix unit test

* feat(cb2-11103): fix other unit test

* feat/CB2-10033 - Additional Examiner Note (#1448)

* feat(cb2-10241): update adr notes to use custom component

* feat(cb2-11250): format table

* feat(cb2-11250): set up router link

* feat(cb2-11250): blank page link working

* feat(cb2-11250): revert unnecessary changes

* feat(cb2-11250): amend routing function

* feat(cb2-11250): fix linting and add unit test

* feat(cb2-11250): fix linting and add unit test

* feat(cb2-11250): update link design

* feat(cb2-11250): fix button link styling

* feat(cb2-10033): basic setup and grabbed selected note from record

* feat(cb2-10033): stash for mobbing

* feat(cb2-10033): hook form up to display note which is to be edited

* feat(cb2-10033): set up model binding to component

* feat(cb2-10033): use correct directive and basic form validation

* feat(cb2-10033): amend routing title for notifiable alteration

* feat(cb2-10033): remove validation as requirements confirmed not needed

* feat(cb2-10033): implement state management solution

* feat(cb2-10033): fix display for summary screen

* feat(cb2-10033): refactor state and data handling approach

* feat(cb2-10033): reducer tests

* feat(cb2-10033): basic unit testing draft

* feat(cb2-10033): unit testing

* feat(cb2-10033): linting fix

* feat(cb2-10033): fix review screen

* feat(cb2-10033): git stash for mobbing

* feat(cb2-10033): add logic to hide collapse function and fix missing acs

* feat(cb2-10033): move title from component to templates

* feat(cb2-10033): acordion issues solved

---------

Co-authored-by: Brandon Thomas-Davies <[email protected]>
Co-authored-by: Tom Evans <[email protected]>
Co-authored-by: Thomas Evans <[email protected]>

* feat(cb2-10033): upped char count to 151 (#1453)

Co-authored-by: Tom Evans <[email protected]>

* feat(cb2-10033): upped char count to 150

* feat(cb2-10033): upped char count to 150

* feat(cb2-10033): upped char count to 15 again

* feat(cb2-10033): css removed

* fix(cb2-11103): re-add missing timestamp from adr notes view (#1460)

* feat(cb2-10286): add hint text to 3 month extension (#1462)

* feat(cb2-10973): feature flags changed to show IVA flow in all envs (#1465)

Co-authored-by: Tom Evans <[email protected]>

* feat(cb2-10125): make adr guidance notes a checkbox group (#1466)

* feat(cb2-11546): make 'make' required for HGVs and TRLs which carry dangerous goods (#1461)

* fix(cb2-11546): make vehicle make required when carrying dangerous goods

* feat(cb2-11546): only make applicable for HGVs and LGVs

* feat(cb2-10286): add new certificate required field (#1463)

* feat(cb2-10286): add new certificate required field

* feat(cb2-9747): default checkbox to false so it will correctly display no text in read mode

* 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 <[email protected]>

* fix(cb2-9747): fix failing unit test (#1468)

* fix(cb2-9747): create mocked date to fix failing unit test (#1469)

* feat(cb2-11185): ensure correct text-wrapping. (#1473)

* fix(cb2-11185): break text to avoid long strings causing the page to overflow horizontally

* fix(cb2-11185): break long strings to overflow, but not mid-word unless necessary

* fix(cb2-11185): fix linting

* fix(cb2-10419): change casing in select defect (#1474)

* fix(cb2-11302): correct spelling of accessor to assessor (#1475)

* fix(cb2-10562): prevent submitting a psv with one axle (#1480)

* fix(cb2-11069): reset error message when new data is provided (#1479)

* fix(cb2-11068): allow unset as form node width so it never hides option text (#1478)

* fix(CB2-11243): prevent SR field in tyres component being cut-off on large screens (#1477)

* fix(cb2-11068): allow unset as form node width so it never hides option text

* fix(cb2-11243): set width to unset to select autoscales to text

* fix(CB2-11453): prevent download .zip file in seperate window (as this may be blocked) (#1476)

* fix(cb2-11453): do not download link via external tab

* fix(cb2-11453): fix unit test

* fix(cb2-11908): remove duplicate label from additional examiner notes history

* fix(cb2-11908): Change labels of examiner notes

* fix(cb2-11908): fix unit tests

---------

Co-authored-by: Brandon Thomas-Davies <[email protected]>
Co-authored-by: Thomas Crawley <[email protected]>
Co-authored-by: Tom Evans <[email protected]>
Co-authored-by: Thomas Evans <[email protected]>
  • Loading branch information
5 people authored May 9, 2024
1 parent df1c0ae commit b15764f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<ng-container *ngIf="control">
<ng-container *ngIf="adrNotes">
<section class="govuk-!-margin-top-4">
<label *ngIf="control.meta?.label" class="govuk-label govuk-label--m">
{{ control.meta.label }}
</label>
<table class="govuk-table" *ngIf="adrNotes && adrNotes.length > 0; else empty">
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
import { TechRecordType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-vehicle-type';
import { CustomFormControl, FormNodeTypes } from '@forms/services/dynamic-form.types';
import { provideMockStore } from '@ngrx/store/testing';
import { State, initialAppState } from '@store/index';
import { TechnicalRecordService } from '@services/technical-record/technical-record.service';
import { mockVehicleTechnicalRecord } from '@mocks/mock-vehicle-technical-record.mock';
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 { provideMockStore } from '@ngrx/store/testing';
import { RouterService } from '@services/router/router.service';
import { TechnicalRecordService } from '@services/technical-record/technical-record.service';
import { State, initialAppState } from '@store/index';
import { of } from 'rxjs';
import { AdrExaminerNotesHistoryViewComponent } from './adr-examiner-notes-history-view.component';

describe('AdrExaminerNotesHistoryViewComponent', () => {
Expand All @@ -24,6 +24,7 @@ describe('AdrExaminerNotesHistoryViewComponent', () => {
const control = new CustomFormControl({
name: 'techRecord_adrDetails_additionalExaminerNotes',
type: FormNodeTypes.CONTROL,
label: 'Additional Examiner Notes History',
});

beforeEach(async () => {
Expand Down
61 changes: 13 additions & 48 deletions src/app/forms/templates/general/adr-summary.template.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import {
ADRAdditionalNotesNumber,
} from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrAdditionalNotesNumber.enum.js';
import { ADRAdditionalNotesNumber } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrAdditionalNotesNumber.enum.js';
import { ADRBodyType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrBodyType.enum.js';
import {
ADRCompatibilityGroupJ,
} from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrCompatibilityGroupJ.enum.js';
import { ADRCompatibilityGroupJ } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrCompatibilityGroupJ.enum.js';
import { ADRDangerousGood } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrDangerousGood.enum.js';
import { ADRTankDetailsTankStatementSelect } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrTankDetailsTankStatementSelect.enum.js';
import { ADRTankStatementSubstancePermitted } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrTankStatementSubstancePermitted.js';
Expand Down Expand Up @@ -37,11 +33,7 @@ import { ValidatorNames } from '@forms/models/validators.enum';
import { getOptionsFromEnum } from '@forms/utils/enum-map';
import { TC2Types } from '@models/adr.enum';
import {
FormNode,
FormNodeEditTypes,
FormNodeTypes,
FormNodeViewTypes,
FormNodeWidth,
FormNode, FormNodeEditTypes, FormNodeTypes, FormNodeViewTypes, FormNodeWidth,
} from '../../services/dynamic-form.types';

export const AdrSummaryTemplate: FormNode = {
Expand Down Expand Up @@ -79,9 +71,7 @@ export const AdrSummaryTemplate: FormNode = {
value: null,
width: FormNodeWidth.XXL,
type: FormNodeTypes.CONTROL,
validators: [
{ name: ValidatorNames.MaxLength, args: 150 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 150 }],
groups: ['applicant_details', 'dangerous_goods'],
hide: true,
},
Expand Down Expand Up @@ -266,9 +256,7 @@ export const AdrSummaryTemplate: FormNode = {
width: FormNodeWidth.L,
groups: ['adr_details', 'dangerous_goods'],
hide: true,
validators: [
{ name: ValidatorNames.MaxLength, args: 40 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 40 }],
},
{
name: 'tankDetailsSectionTitle',
Expand Down Expand Up @@ -516,19 +504,15 @@ export const AdrSummaryTemplate: FormNode = {
editType: FormNodeEditTypes.TEXTAREA,
groups: ['productList', 'statement_select_hide', 'tank_details_hide', 'dangerous_goods'],
hide: true,
validators: [
{ name: ValidatorNames.MaxLength, args: 1500 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 1500 }],
},
{
name: 'techRecord_adrDetails_tank_tankDetails_specialProvisions',
label: 'Special Provisions',
type: FormNodeTypes.CONTROL,
editType: FormNodeEditTypes.TEXTAREA,
hide: true,
validators: [
{ name: ValidatorNames.MaxLength, args: 1024 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 1024 }],
groups: ['dangerous_goods', 'tank_details'],
},
{
Expand Down Expand Up @@ -574,9 +558,7 @@ export const AdrSummaryTemplate: FormNode = {
viewType: FormNodeViewTypes.HIDDEN,
hide: true,
groups: ['tank_details', 'dangerous_goods'],
validators: [
{ name: ValidatorNames.MaxLength, args: 70 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 70 }],
},
{
name: 'techRecord_adrDetails_tank_tankDetails_tc2Details_tc2IntermediateExpiryDate',
Expand Down Expand Up @@ -612,9 +594,7 @@ export const AdrSummaryTemplate: FormNode = {
editType: FormNodeEditTypes.CHECKBOXGROUP,
groups: ['tank_details', 'dangerous_goods'],
hide: true,
options: [
{ value: '07/09 3mth leak ext ', label: 'Yes' },
],
options: [{ value: '07/09 3mth leak ext ', label: 'Yes' }],
validators: [],
},
{
Expand Down Expand Up @@ -702,7 +682,6 @@ export const AdrSummaryTemplate: FormNode = {
},
},
],

},
{
name: 'techRecord_adrDetails_brakeDeclarationIssuer',
Expand All @@ -711,9 +690,7 @@ export const AdrSummaryTemplate: FormNode = {
hide: true,
groups: ['issuer_section', 'dangerous_goods'],
editType: FormNodeEditTypes.TEXTAREA,
validators: [
{ name: ValidatorNames.MaxLength, args: 500 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 500 }],
},
{
name: 'techRecord_adrDetails_brakeEndurance',
Expand All @@ -739,7 +716,6 @@ export const AdrSummaryTemplate: FormNode = {
},
},
],

},
{
name: 'techRecord_adrDetails_weight',
Expand All @@ -754,7 +730,6 @@ export const AdrSummaryTemplate: FormNode = {
name: ValidatorNames.RequiredIfNotHidden,
},
],

},
{
name: 'techRecord_adrDetails_declarationsSeen',
Expand Down Expand Up @@ -782,13 +757,6 @@ export const AdrSummaryTemplate: FormNode = {
groups: ['dangerous_goods'],
hide: true,
},
{
name: 'ExaminerNotesSectionTitle',
label: 'Additional Examiner Notes History',
type: FormNodeTypes.TITLE,
groups: ['adr_details', 'dangerous_goods'],
hide: true,
},
{
name: 'techRecord_adrDetails_additionalExaminerNotes_note',
label: 'Additional Examiner Notes',
Expand All @@ -797,13 +765,12 @@ export const AdrSummaryTemplate: FormNode = {
editType: FormNodeEditTypes.TEXTAREA,
groups: ['adr_details', 'dangerous_goods'],
hide: true,
validators: [
{ name: ValidatorNames.MaxLength, args: 1024 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 1024 }],
},
{
name: 'techRecord_adrDetails_additionalExaminerNotes',
value: null,
label: 'Additional Examiner Notes History',
type: FormNodeTypes.CONTROL,
viewType: FormNodeViewTypes.CUSTOM,
viewComponent: AdrExaminerNotesHistoryViewComponent,
Expand All @@ -821,9 +788,7 @@ export const AdrSummaryTemplate: FormNode = {
viewType: FormNodeViewTypes.STRING,
groups: ['adrDetails', 'dangerous_goods'],
hide: true,
validators: [
{ name: ValidatorNames.MaxLength, args: 1500 },
],
validators: [{ name: ValidatorNames.MaxLength, args: 1500 }],
},
],
};
8 changes: 1 addition & 7 deletions src/app/forms/templates/general/adr.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,6 @@ export const AdrTemplate: FormNode = {
groups: ['dangerous_goods'],
hide: true,
},
{
name: 'ExaminerNotesSectionTitle',
label: 'Additional Examiner Notes History',
type: FormNodeTypes.TITLE,
groups: ['adr_details', 'dangerous_goods'],
hide: true,
},
{
name: 'techRecord_adrDetails_additionalExaminerNotes_note',
label: 'Additional Examiner Notes',
Expand All @@ -811,6 +804,7 @@ export const AdrTemplate: FormNode = {
{
name: 'techRecord_adrDetails_additionalExaminerNotes',
value: null,
label: 'Additional Examiner Notes History',
type: FormNodeTypes.CONTROL,
viewType: FormNodeViewTypes.CUSTOM,
viewComponent: AdrExaminerNotesHistoryViewComponent,
Expand Down

0 comments on commit b15764f

Please sign in to comment.