Skip to content

Commit

Permalink
feat(CB2-14450): use default null or empty pipe in tables for view an…
Browse files Browse the repository at this point in the history
…d summary
  • Loading branch information
tomcrawleyy committed Jan 10, 2025
1 parent 3a3d2a9 commit 0a1ec87
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<ng-container *ngFor="let axle of vm.techRecord_axles; let i = index">
<tr class="govuk-table__row" *ngIf="hasAxleChanged(i)">
<th scope="row" class="govuk-table__header">T{{ axle.axleNumber }}</th>
<td class="govuk-table__cell">{{ axle.tyres_tyreCode }}</td>
<td class="govuk-table__cell">{{ axle.tyres_tyreSize }}</td>
<td class="govuk-table__cell">{{ axle.tyres_plyRating }}</td>
<td class="govuk-table__cell">{{ axle.tyres_dataTrAxles }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(axle).tyres_speedCategorySymbol }}</td>
<td class="govuk-table__cell">{{ axle.tyres_fitmentCode }}</td>
<td class="govuk-table__cell">{{ axle.tyres_tyreCode | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.tyres_tyreSize | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.tyres_plyRating | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.tyres_dataTrAxles | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(axle).tyres_speedCategorySymbol | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.tyres_fitmentCode | defaultNullOrEmpty }}</td>
</tr>
</ng-container>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row" *ngFor="let axle of vm.techRecord_axles; let i = index">
<th scope="row" class="govuk-table__header">T{{axle.axleNumber}}</th>
<td class="govuk-table__cell" id="tyres_tyreCode-{{ i + 1 }}">{{ axle.tyres_tyreCode }}</td>
<td class="govuk-table__cell" id="tyres_tyreSize-{{ i + 1 }}">{{ axle.tyres_tyreSize }}</td>
<td class="govuk-table__cell" id="tyres_plyRating-{{ i + 1 }}">{{ axle.tyres_plyRating }}</td>
<td class="govuk-table__cell" id="tyres_dataTrAxles-{{ i + 1 }}">{{ axle.tyres_dataTrAxles }}</td>
<th scope="row" class="govuk-table__header">T{{axle.axleNumber | defaultNullOrEmpty }}</th>
<td class="govuk-table__cell" id="tyres_tyreCode-{{ i + 1 }}">{{ axle.tyres_tyreCode | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" id="tyres_tyreSize-{{ i + 1 }}">{{ axle.tyres_tyreSize | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" id="tyres_plyRating-{{ i + 1 }}">{{ axle.tyres_plyRating | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" id="tyres_dataTrAxles-{{ i + 1 }}">{{ axle.tyres_dataTrAxles | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell uppercase" id="tyres_speedCategorySymbol-{{ i + 1 }}" *ngIf="vm.techRecord_vehicleType == VehicleTypes.PSV">
{{ $any(axle).tyres_speedCategorySymbol }}
{{ $any(axle).tyres_speedCategorySymbol | defaultNullOrEmpty }}
</td>
<td class="govuk-table__cell capitalize" id="tyres_fitmentCode-{{ i + 1 }}">{{ axle.tyres_fitmentCode }}</td>
<td class="govuk-table__cell capitalize" id="tyres_fitmentCode-{{ i + 1 }}">{{ axle.tyres_fitmentCode | defaultNullOrEmpty }}</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,45 +30,45 @@
<th scope="col" class="govuk-table__header">Axle {{ axle.axleNumber }}</th>

<ng-container *ngIf="vm.techRecord_vehicleType === VehicleTypes.HGV || vm.techRecord_vehicleType === VehicleTypes.TRL">
<td class="govuk-table__cell">{{ axle.weights_gbWeight }}</td>
<td class="govuk-table__cell">{{ $any(axle).weights_eecWeight }}</td>
<td class="govuk-table__cell">{{ axle.weights_designWeight }}</td>
<td class="govuk-table__cell">{{ axle.weights_gbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ $any(axle).weights_eecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.weights_designWeight | defaultNullOrEmpty }}</td>
</ng-container>

<ng-container *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">
<td class="govuk-table__cell">{{ $any(axle).weights_kerbWeight }}</td>
<td class="govuk-table__cell">{{ $any(axle).weights_ladenWeight }}</td>
<td class="govuk-table__cell">{{ axle.weights_gbWeight }}</td>
<td class="govuk-table__cell">{{ axle.weights_designWeight }}</td>
<td class="govuk-table__cell">{{ $any(axle).weights_kerbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ $any(axle).weights_ladenWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.weights_gbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.weights_designWeight | defaultNullOrEmpty }}</td>
</ng-container>
</tr>
</ng-container>

<ng-container *ngIf="vm.techRecord_vehicleType === VehicleTypes.HGV || vm.techRecord_vehicleType === VehicleTypes.TRL">
<tr class="govuk-table__row" *ngIf="hasHGVOrTRLGrossAxleChanged()">
<th scope="col" class="govuk-table__header">Gross</th>
<td class="govuk-table__cell">{{ vm.techRecord_grossGbWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossEecWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossDesignWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossEecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossDesignWeight | defaultNullOrEmpty }}</td>
</tr>
</ng-container>

<ng-container *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">
<tr class="govuk-table__row" *ngIf="hasPsvGrossAxleChanged()">
<th scope="col" class="govuk-table__header">Gross</th>
<td class="govuk-table__cell">{{ vm.techRecord_grossKerbWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossLadenWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossGbWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossDesignWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossKerbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossLadenWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossDesignWeight | defaultNullOrEmpty }}</td>
</tr>
</ng-container>

<ng-container *ngIf="vm.techRecord_vehicleType === VehicleTypes.HGV">
<tr class="govuk-table__row" *ngIf="hasHgvTrainAxleChanged()">
<th scope="col" class="govuk-table__header">Train</th>
<td class="govuk-table__cell">{{ vm.techRecord_trainGbWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_trainEecWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_trainDesignWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_trainGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_trainEecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_trainDesignWeight | defaultNullOrEmpty }}</td>
</tr>
</ng-container>

Expand All @@ -77,17 +77,17 @@
<th scope="col" class="govuk-table__header">Train</th>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainGbWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_trainDesignWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_trainDesignWeight | defaultNullOrEmpty }}</td>
</tr>
</ng-container>

<ng-container *ngIf="vm.techRecord_vehicleType === VehicleTypes.HGV">
<tr class="govuk-table__row" *ngIf="hasMaxTrainAxleChanged()">
<th scope="col" class="govuk-table__header">Max Train</th>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainGbWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainEecWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainDesignWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainEecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainDesignWeight | defaultNullOrEmpty }}</td>
</tr>
</ng-container>
</tbody>
Expand All @@ -100,7 +100,7 @@
Unladen Weight
</dt>
<dd class="govuk-summary-list__value">
{{ vm.techRecord_unladenWeight }} kg
{{ vm.techRecord_unladenWeight | defaultNullOrEmpty }} kg
</dd>
</div>
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,34 @@
<tbody class="govuk-table__body">
<tr class="govuk-table__row" *ngFor="let axle of vm.techRecord_axles">
<th scope="row" class="govuk-table__header">Axle {{axle.axleNumber}}</th>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(axle).weights_kerbWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(axle).weights_ladenWeight }}</td>
<td class="govuk-table__cell">{{ axle.weights_gbWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(axle).weights_eecWeight }}</td>
<td class="govuk-table__cell">{{ axle.weights_designWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(axle).weights_kerbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(axle).weights_ladenWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.weights_gbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(axle).weights_eecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ axle.weights_designWeight | defaultNullOrEmpty }}</td>
</tr>
<tr>
<th scope="row" class="govuk-table__header">Gross</th>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(vm).techRecord_grossKerbWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(vm).techRecord_grossLadenWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossGbWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(vm).techRecord_grossEecWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossDesignWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(vm).techRecord_grossKerbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(vm).techRecord_grossLadenWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(vm).techRecord_grossEecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_grossDesignWeight | defaultNullOrEmpty }}</td>
</tr>
<tr *ngIf="vm.techRecord_vehicleType !== VehicleTypes.TRL">
<th scope="row" class="govuk-table__header">Train</th>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV"></td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV"></td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(vm).techRecord_trainGbWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(vm).techRecord_maxTrainGbWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(vm).techRecord_trainEecWeight }}</td>
<td class="govuk-table__cell">{{ $any(vm).techRecord_trainDesignWeight }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(vm).techRecord_trainGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">{{ $any(vm).techRecord_maxTrainGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">{{ $any(vm).techRecord_trainEecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ $any(vm).techRecord_trainDesignWeight | defaultNullOrEmpty }}</td>
</tr>
<tr *ngIf="vm.techRecord_vehicleType === VehicleTypes.HGV">
<th scope="row" class="govuk-table__header">Max Train</th>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainGbWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainEecWeight }}</td>
<td class="govuk-table__cell">{{ $any(vm).techRecord_maxTrainDesignWeight }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainGbWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ vm.techRecord_maxTrainEecWeight | defaultNullOrEmpty }}</td>
<td class="govuk-table__cell">{{ $any(vm).techRecord_maxTrainDesignWeight | defaultNullOrEmpty }}</td>
</tr>
</tbody>
</table>
Expand All @@ -52,7 +52,7 @@
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Unladen weight</dt>
<dd class="govuk-summary-list__value" id="test-techRecord_unladenWeight">
{{ vm.techRecord_unladenWeight | defaultNullOrEmpty }}
{{ vm.techRecord_unladenWeight | defaultNullOrEmpty }} kg
</dd>
</div>
</dl>
Expand Down

0 comments on commit 0a1ec87

Please sign in to comment.