Skip to content

Commit

Permalink
feat/CB2-14450-weights-dfs-view - Weights view mode (#1706)
Browse files Browse the repository at this point in the history
* feat(CB2-14450): weights view mode

* feat(CB2-14450-weights-dfs-view): missing field

* feat(CB2-14450): fix test id
  • Loading branch information
tomcrawleyy authored Jan 7, 2025
1 parent 665be13 commit 7d7d13a
Showing 1 changed file with 53 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,58 @@
<ng-container *ngIf="techRecord() as vm">
<dl class="govuk-summary-list">
<ng-container *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV || vm.techRecord_vehicleType === VehicleTypes.HGV || vm.techRecord_vehicleType === VehicleTypes.TRL">
<table class="govuk-table">
<caption class="govuk-table__caption govuk-table__caption--m">Axle weights (kg)</caption>
<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" id="weights-kerb-header" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">Kerb</th>
<th scope="col" class="govuk-table__header" id="weights-laden-header" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">Laden</th>
<th scope="col" class="govuk-table__header" id="weights-gb-max-header" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">GB max</th>
<th scope="col" class="govuk-table__header" id="weights-gb-header" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">GB</th>
<th scope="col" class="govuk-table__header" id="weights-eec-header" *ngIf="vm.techRecord_vehicleType !== VehicleTypes.PSV">EEC</th>
<th scope="col" class="govuk-table__header" id="weights-design-header">Design</th>
</tr>
</thead>
<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>
</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>
</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>
</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>
</tr>
</tbody>
</table>
</ng-container>
<dl class="govuk-summary-list" *ngIf="vm.techRecord_vehicleType === VehicleTypes.PSV">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key"></dt>
<dd class="govuk-summary-list__value" id="test-">

<dt class="govuk-summary-list__key">Unladen weight</dt>
<dd class="govuk-summary-list__value" id="test-techRecord_unladenWeight">
{{ vm.techRecord_unladenWeight | defaultNullOrEmpty }}
</dd>
</div>
</dl>
Expand Down

0 comments on commit 7d7d13a

Please sign in to comment.