Skip to content

Commit

Permalink
feat(cb2-10241): update adr notes to use custom component (#1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonT95 authored Mar 28, 2024
1 parent c098b99 commit 1645ddd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,6 @@
</td>
</ng-container>

<!-- TODO: remove entirely, and use custom view component -->
<ng-container *ngSwitchCase="formNodeViewTypes.ADR_EXAMINER_NOTES">
<td class="govuk-table__cell">
<table class="govuk-table" *ngIf="value && value.length > 0">
<tbody class="govuk-table__body">
<tr>
<th scope="col" class="govuk-table__header">Date</th>
<th scope="col" class="govuk-table__header">Created By</th>
<th scope="col" class="govuk-table__header">Notes</th>
</tr>
<ng-container *ngFor="let result of value; let i = index; let isLast = last">
<tr *ngIf="i < 3">
<td class="govuk-table__cell break-words" [class.border-b-0]="i === 2 || isLast">
{{ result.createdAtDate | date : 'dd/MM/yyyy' | defaultNullOrEmpty }}
</td>
<td class="govuk-table__cell break-words" [class.border-b-0]="i === 2 || isLast">{{ result.lastUpdatedBy }}</td>
<td class="govuk-table__cell break-words" [class.border-b-0]="i === 2 || isLast">{{ result.note }}</td>
</tr>
</ng-container>
</tbody>
</table>
<dl class="govuk-summary-list" *ngIf="!value || value.length === 0">
<div class="govuk-summary-list__row border-b-0">
<dt class="govuk-summary-list__key">No additional examiner notes history available</dt>
</div>
</dl>
</td>
</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
@@ -1,21 +1,21 @@
<ng-container *ngIf="control">
<section class="govuk-!-margin-top-4">
<h3 class="govuk-heading-m">ADR Examiner Notes History</h3>
<h3 class="govuk-heading-m">Additional Examiner Notes History</h3>
<table class="govuk-table" *ngIf="control.value && control.value.length > 0; else empty">
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header whitespace-nowrap">Date</th>
<th scope="col" class="govuk-table__header whitespace-nowrap">Created By</th>
<th scope="col" class="govuk-table__header whitespace-nowrap">Notes</th>
<th scope="col" class="govuk-table__header whitespace-nowrap">Created By</th>
<th scope="col" class="govuk-table__header whitespace-nowrap">Date</th>
</tr>
<ng-container *ngFor="let result of control.value; let i = index; let isLast = last">
<tr class="govuk-table__row" *ngIf="i < 3">
<td class="govuk-table__cell break-words" [class.border-b-0]="i === 2 || isLast">
{{ result.createdAtDate | date : 'dd/MM/yyyy' | defaultNullOrEmpty }}
{{ result.note }}
</td>
<td class="govuk-table__cell break-words" [class.border-b-0]="i === 2 || isLast">{{ result.lastUpdatedBy }}</td>
<td class="govuk-table__cell break-words" [class.border-b-0]="i === 2 || isLast">
{{ result.note }}
{{ result.createdAtDate | date : 'dd/MM/yyyy' | defaultNullOrEmpty }}
</td>
</tr>
</ng-container>
Expand Down
2 changes: 1 addition & 1 deletion src/app/forms/templates/general/adr.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ export const AdrTemplate: FormNode = {
label: 'Additional examiner notes history',
value: null,
type: FormNodeTypes.CONTROL,
viewType: FormNodeViewTypes.ADR_EXAMINER_NOTES, // TODO: replace with custom
viewType: FormNodeViewTypes.CUSTOM,
viewComponent: AdrExaminerNotesHistoryViewComponent,
editType: FormNodeEditTypes.CUSTOM,
editComponent: AdrExaminerNotesHistoryEditComponent,
Expand Down

0 comments on commit 1645ddd

Please sign in to comment.