1
|
<p-fieldset legend="Results"
|
2
|
[toggleable]="_searchResultsPage?.data !== null"
|
3
|
[collapsed]="_searchResultsPage?.data === null">
|
4
|
<p-confirmDialog message="{{'DELETE-MESSAGE-CATEGORY' | translate}}"
|
5
|
header="{{'DELETE-CONFIRMATION' | translate}}"
|
6
|
acceptLabel="{{'ACCEPT_LABEL' | translate}}"
|
7
|
rejectLabel="{{'REJECT_LABEL' | translate}}"
|
8
|
acceptButtonStyleClass="p-button-primary"
|
9
|
rejectButtonStyleClass="p-button-warning"
|
10
|
acceptIcon="null"
|
11
|
rejectIcon="null">
|
12
|
</p-confirmDialog>
|
13
|
<p-table [value]="_searchResultsPage?.data"
|
14
|
[lazy]="true"
|
15
|
(onLazyLoad)="onLazyLoad($event)"
|
16
|
[paginator]="true"
|
17
|
[rows]="rows"
|
18
|
[totalRecords]="totalRecords"
|
19
|
styleClass="p-datatable-gridlines"
|
20
|
[rowHover]="true"
|
21
|
[loading]="loading"
|
22
|
[autoLayout]="true">
|
23
|
<ng-template pTemplate="header">
|
24
|
<tr>
|
25
|
<th>Document Classification</th>
|
26
|
<th>Category Name</th>
|
27
|
<th>Category Code</th>
|
28
|
<!-- TODO: Fix hacky way of locking the icon-columns in place -->
|
29
|
<th class="two-buttons">Actions</th>
|
30
|
</tr>
|
31
|
</ng-template>
|
32
|
<ng-template pTemplate="body" let-category>
|
33
|
<tr>
|
34
|
<td>{{category.documentClassification.classificationName}}</td>
|
35
|
<td>{{category.categoryName}}</td>
|
36
|
<td>{{category.categoryCode}}</td>
|
37
|
<!-- Edit & Delete icons -->
|
38
|
<td>
|
39
|
<button pButton
|
40
|
[disabled]="!canEditCategories()"
|
41
|
(click)="edit(category)"
|
42
|
icon="pi pi-pencil"
|
43
|
pTooltip="{{'EDIT-CATEGORY' | translate}}"
|
44
|
class="p-button-secondary p-button-rounded p-button-outlined">
|
45
|
</button>
|
46
|
<button pButton
|
47
|
[disabled]="!canDeleteCategories()"
|
48
|
(click)="delete(category)"
|
49
|
icon="pi pi pi-trash"
|
50
|
pTooltip="{{'DELETE-CATEGORY' | translate}}"
|
51
|
class="p-button-danger p-button-rounded p-button-outlined p-ml-2">
|
52
|
</button>
|
53
|
</td>
|
54
|
</tr>
|
55
|
</ng-template>
|
56
|
</p-table>
|
57
|
</p-fieldset>
|
58
|
|
59
|
<app-create-category-dialog [displayDialog]="displayEditCategoryDialog"
|
60
|
[header]="header"
|
61
|
(cancelled)="cancelEditCategory()"
|
62
|
[categoryToEdit]="categoryToEdit"
|
63
|
(valueChange)="passEvent($event)">
|
64
|
</app-create-category-dialog>
|