Skip to content

Commit

Permalink
fix(cb2-10591): uncomment custom views for TC2 and TC3 inspections (#…
Browse files Browse the repository at this point in the history
…1376)

* fix(cb2-10591): uncomment custom views for TC2 and TC3 inspections

* fix(cb2-10591): minor corrections

* fix(cb2-10591): more minor corrections
  • Loading branch information
pbardy2000 authored Feb 9, 2024
1 parent dc73c04 commit f119945
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,6 @@
</td>
</ng-container>

<!-- TODO: remove entirely, and use custom view component -->
<ng-container *ngSwitchCase="formNodeViewTypes.ADRINSPECTIONS">
<ng-container *ngIf="value && value.length > 0">
<table>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header"></th>
<th scope="col" class="govuk-table__header">TC3: Inspection Type</th>
<th scope="col" class="govuk-table__header">TC3: Certificate Number</th>
<th scope="col" class="govuk-table__header">TC3: Expiry Date</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row" *ngFor="let result of value; let i = index; let isLast = last">
<td class="govuk-table__cell break-words" [class.border-b-0]="isLast">{{ i + 1 }}</td>
<td class="govuk-table__cell break-words" [class.border-b-0]="isLast">{{ result.tc3Type }}</td>
<td class="govuk-table__cell break-words" [class.border-b-0]="isLast">{{ result.tc3PeriodicNumber }}</td>
<td class="govuk-table__cell break-words" [class.border-b-0]="isLast">
{{ result.tc3PeriodicExpiryDate | date : 'dd/MM/yyyy' | defaultNullOrEmpty }}
</td>
</tr>
</tbody>
</table>
</ng-container>
</ng-container>

<ng-container *ngSwitchCase="formNodeViewTypes.CUSTOM">
<ng-container *ngIf="control && control.meta && control.meta.viewComponent">
<td colspan="2" id="test-{{ name }}" class="govuk-table__cell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ <h4 class="govuk-heading-s">Initial</h4>
<table class="govuk-table">
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header break-words">Certificate number:</th>
<th class="govuk-table__header break-words" [style.width.%]="30">Certificate number:</th>
<td class="govuk-table__cell break-words">
{{ control.parent.value.techRecord_adrDetails_tank_tankDetails_tc2Details_tc2IntermediateApprovalNo | defaultNullOrEmpty }}
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header break-words">Expiry date:</th>
<th class="govuk-table__header break-words" [style.width.%]="30">Expiry date:</th>
<td class="govuk-table__cell break-words">
{{
control.parent.value.techRecord_adrDetails_tank_tankDetails_tc2Details_tc2IntermediateExpiryDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ <h4 class="govuk-heading-s">Subsequent {{ i + 1 }}</h4>
<table class="govuk-table">
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header break-words">Inspection type:</th>
<th class="govuk-table__header break-words" [style.width.%]="30">Inspection type:</th>
<td class="govuk-table__cell break-words">{{ inspection.tc3Type | defaultNullOrEmpty }}</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header break-words">Certificate number:</th>
<th class="govuk-table__header break-words" [style.width.%]="30">Certificate number:</th>
<td class="govuk-table__cell break-words">{{ inspection.tc3PeriodicNumber | defaultNullOrEmpty }}</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header break-words">Inspection type:</th>
<th class="govuk-table__header break-words" [style.width.%]="30">Expiry Date:</th>
<td class="govuk-table__cell break-words">{{ inspection.tc3PeriodicExpiryDate | date : 'dd/MM/yyyy' | defaultNullOrEmpty }}</td>
</tr>
</tbody>
Expand Down
1 change: 0 additions & 1 deletion src/app/forms/services/dynamic-form.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export enum FormNodeViewTypes {
VRM = 'vrm',
CUSTOM = 'custom',
ADR_EXAMINER_NOTES = 'adrExaminerNotes', // TODO: remove in favour of custom
ADRINSPECTIONS = 'adrInspections', // TODO: remove in favour of custom
}

export enum TagTypeLabels {
Expand Down
11 changes: 5 additions & 6 deletions src/app/forms/templates/general/adr-summary.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import {
} from '@forms/custom-sections/adr-examiner-notes-history-view/adr-examiner-notes-history-view.component';
import { AdrGuidanceNotesComponent } from '@forms/custom-sections/adr-guidance-notes/adr-guidance-notes.component';
import { AdrTankDetailsM145ViewComponent } from '@forms/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component';
import {
AdrTankDetailsInitialInspectionViewComponent,
} from '@forms/custom-sections/adr-tank-details-initial-inspection-view/adr-tank-details-initial-inspection-view.component';
import {
AdrTankDetailsSubsequentInspectionsEditComponent,
} from '@forms/custom-sections/adr-tank-details-subsequent-inspections-edit/adr-tank-details-subsequent-inspections-edit.component';
Expand Down Expand Up @@ -537,9 +540,6 @@ export const AdrSummaryTemplate: FormNode = {
},
],
},
// Note: this used only for the view mode for the ADR Tank Details initial inpsection controls
// TODO: uncomment this when needed
/*
{
name: 'tankInspectionsInitialView',
type: FormNodeTypes.CONTROL,
Expand All @@ -549,11 +549,10 @@ export const AdrSummaryTemplate: FormNode = {
groups: ['tank_details', 'dangerous_goods'],
hide: true,
},
*/
{
name: 'techRecord_adrDetails_tank_tankDetails_tc2Details_tc2Type',
type: FormNodeTypes.CONTROL,
// viewType: FormNodeViewTypes.HIDDEN,
viewType: FormNodeViewTypes.HIDDEN,
editType: FormNodeEditTypes.HIDDEN,
label: 'TC2: Inspection type',
value: TC2Types.INITIAL,
Expand Down Expand Up @@ -586,7 +585,7 @@ export const AdrSummaryTemplate: FormNode = {
name: 'techRecord_adrDetails_tank_tankDetails_tc3Details',
label: 'Subsequent Inspections',
type: FormNodeTypes.CONTROL,
viewType: FormNodeViewTypes.ADRINSPECTIONS, // TODO: replace with custom view type
viewType: FormNodeViewTypes.CUSTOM,
viewComponent: AdrTankDetailsSubsequentInspectionsViewComponent,
editType: FormNodeEditTypes.CUSTOM,
editComponent: AdrTankDetailsSubsequentInspectionsEditComponent,
Expand Down
11 changes: 5 additions & 6 deletions src/app/forms/templates/general/adr.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
} from '@forms/custom-sections/adr-examiner-notes-history-view/adr-examiner-notes-history-view.component';
import { AdrGuidanceNotesComponent } from '@forms/custom-sections/adr-guidance-notes/adr-guidance-notes.component';
import { AdrTankDetailsM145ViewComponent } from '@forms/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component';
import {
AdrTankDetailsInitialInspectionViewComponent,
} from '@forms/custom-sections/adr-tank-details-initial-inspection-view/adr-tank-details-initial-inspection-view.component';
import {
AdrTankDetailsSubsequentInspectionsEditComponent,
} from '@forms/custom-sections/adr-tank-details-subsequent-inspections-edit/adr-tank-details-subsequent-inspections-edit.component';
Expand Down Expand Up @@ -535,9 +538,6 @@ export const AdrTemplate: FormNode = {
},
],
},
// Note: this used only for the view mode for the ADR Tank Details initial inpsection controls
// TODO: uncomment when needed
/*
{
name: 'tankInspectionsInitialView',
type: FormNodeTypes.CONTROL,
Expand All @@ -547,12 +547,11 @@ export const AdrTemplate: FormNode = {
groups: ['tank_details', 'dangerous_goods'],
hide: true,
},
*/
{
name: 'techRecord_adrDetails_tank_tankDetails_tc2Details_tc2Type',
type: FormNodeTypes.CONTROL,
editType: FormNodeEditTypes.HIDDEN,
// viewType: FormNodeViewTypes.HIDDEN,
viewType: FormNodeViewTypes.HIDDEN,
label: 'TC2: Inspection type',
value: TC2Types.INITIAL,
hide: true,
Expand Down Expand Up @@ -584,7 +583,7 @@ export const AdrTemplate: FormNode = {
name: 'techRecord_adrDetails_tank_tankDetails_tc3Details',
label: 'Subsequent Inspections',
type: FormNodeTypes.CONTROL,
viewType: FormNodeViewTypes.ADRINSPECTIONS, // TODO: replace with custom view type
viewType: FormNodeViewTypes.CUSTOM,
viewComponent: AdrTankDetailsSubsequentInspectionsViewComponent,
editType: FormNodeEditTypes.CUSTOM,
editComponent: AdrTankDetailsSubsequentInspectionsEditComponent,
Expand Down

0 comments on commit f119945

Please sign in to comment.