|
1 | 1 | <div class="container"> |
2 | | - <div class="d-flex"> |
3 | | - <h2 class="flex-grow-1">{{'audit.object.overview.title' | translate}}</h2> |
4 | | - </div> |
| 2 | + <div class="d-flex"> |
| 3 | + <h2 class="flex-grow-1">{{'audit.object.overview.title' | translate}}</h2> |
| 4 | + </div> |
5 | 5 |
|
6 | | - <ng-container *ngIf="object"> |
7 | | - <h4 class="mt-4 mb-4">{{ object.name }} (<em>{{object.type}}</em>)</h4> |
8 | | - |
9 | | - <ng-container *ngIf="(auditsRD$ | async)?.payload as audits"> |
10 | | - |
11 | | - <div *ngIf="audits.totalElements === 0"> |
| 6 | + @if (object) { |
| 7 | + <h4 class="mt-4 mb-4">{{ object.name }} (<em>{{object.type}}</em>)</h4> |
| 8 | + @if ((auditsRD$ | async)?.payload; as audits) { |
| 9 | + @if (audits.totalElements === 0) { |
| 10 | + <div> |
12 | 11 | No audits found. |
13 | 12 | </div> |
14 | | - |
15 | | - <ds-pagination *ngIf="audits.totalElements > 0" |
16 | | - [paginationOptions]="pageConfig" |
17 | | - [collectionSize]="audits.totalElements" |
18 | | - [hideGear]="true" |
19 | | - [hidePagerWhenSinglePage]="true"> |
20 | | - |
| 13 | + } |
| 14 | + @if (audits.totalElements > 0) { |
| 15 | + <ds-pagination |
| 16 | + [paginationOptions]="pageConfig" |
| 17 | + [collectionSize]="audits.totalElements" |
| 18 | + [hideGear]="true" |
| 19 | + [hidePagerWhenSinglePage]="true"> |
21 | 20 | <div class="table-responsive"> |
22 | 21 | <table class="table table-striped table-hover"> |
23 | 22 | <thead> |
24 | | - <tr> |
25 | | - <!-- <th>{{ 'audit.overview.table.id' | translate }}</th> --> |
26 | | - <th>{{ 'audit.overview.table.entityType' | translate }}</th> |
27 | | - <th>{{ 'audit.overview.table.eperson' | translate }}</th> |
28 | | - <th>{{ 'audit.overview.table.timestamp' | translate }}</th> |
29 | | - <th>Other Object</th> |
30 | | - </tr> |
| 23 | + <tr> |
| 24 | + <!-- <th>{{ 'audit.overview.table.id' | translate }}</th> --> |
| 25 | + <th>{{ 'audit.overview.table.entityType' | translate }}</th> |
| 26 | + <th>{{ 'audit.overview.table.eperson' | translate }}</th> |
| 27 | + <th>{{ 'audit.overview.table.timestamp' | translate }}</th> |
| 28 | + <th>Other Object</th> |
| 29 | + </tr> |
31 | 30 | </thead> |
32 | 31 | <tbody> |
33 | | - <tr *ngFor="let audit of audits.page"> |
34 | | - <!-- <td><a [routerLink]="['/auditlogs/', audit.id]">{{audit.id}}</a></td> --> |
35 | | - <td>{{ audit.eventType }}</td> |
36 | | - <td *ngVar="(getEpersonName(audit) | async) as ePersonName">{{ePersonName}}</td> |
37 | | - <td>{{ audit.timeStamp | date:dateFormat}}</td> |
38 | | - <td> |
39 | | - <span *ngIf="object.id === audit.objectUUID"> |
40 | | - <!-- object.id === audit.objectUUID --> |
41 | | - <ng-container *ngIf="(getOtherObject(audit, object.id) | async) as subject"> |
42 | | - <ng-container *ngIf="subject"> |
43 | | - {{ subject.name }} <em>({{ subject.type }})</em> |
44 | | - </ng-container> |
45 | | - </ng-container> |
46 | | - </span> |
47 | | - |
48 | | - <span *ngIf="object.id === audit.subjectUUID"> |
49 | | - <!-- object.id === audit.subjectUUID --> |
50 | | - </span> |
51 | | - </td> |
52 | | - </tr> |
| 32 | + @for (audit of audits.page; track audit) { |
| 33 | + <tr> |
| 34 | + <!-- <td><a [routerLink]="['/auditlogs/', audit.id]">{{audit.id}}</a></td> --> |
| 35 | + <td>{{ audit.eventType }}</td> |
| 36 | + <td *ngVar="(getEpersonName(audit) | async) as ePersonName">{{ePersonName}}</td> |
| 37 | + <td>{{ audit.timeStamp | date:dateFormat}}</td> |
| 38 | + <td> |
| 39 | + @if (object.id === audit.objectUUID) { |
| 40 | + <span> |
| 41 | + <!-- object.id === audit.objectUUID --> |
| 42 | + @if ((getOtherObject(audit, object.id) | async); as subject) { |
| 43 | + @if (subject) { |
| 44 | + {{ subject.name }} <em>({{ subject.type }})</em> |
| 45 | + } |
| 46 | + } |
| 47 | + </span> |
| 48 | + } |
| 49 | + @if (object.id === audit.subjectUUID) { |
| 50 | + <span> |
| 51 | + <!-- object.id === audit.subjectUUID --> |
| 52 | + </span> |
| 53 | + } |
| 54 | + </td> |
| 55 | + </tr> |
| 56 | + } |
53 | 57 | </tbody> |
54 | 58 | </table> |
55 | 59 | </div> |
56 | 60 | </ds-pagination> |
57 | | - |
58 | | - <a class="btn btn-light mt-3" [routerLink]="['/items', object.id]"><i class="fas fa-arrow-left"></i> Back to Item</a> |
59 | | - |
60 | | - <!-- <a class="btn btn-light mt-3" [routerLink]="'/auditlogs'">{{'audit.detail.back' | translate}}</a> --> |
61 | | - |
62 | | - </ng-container> |
63 | | - |
64 | | - <h4 class="mt-4 mb-4" *ngIf="(auditsRD$ | async)?.statusCode === 404">{{'audit.object.overview.disabled.message' | translate}}</h4> |
65 | | - |
66 | | - </ng-container> |
| 61 | + } |
| 62 | + <a class="btn btn-light mt-3" [routerLink]="['/items', object.id]"><i class="fas fa-arrow-left"></i> Back to Item</a> |
| 63 | + <!-- <a class="btn btn-light mt-3" [routerLink]="'/auditlogs'">{{'audit.detail.back' | translate}}</a> --> |
| 64 | + } |
| 65 | + @if ((auditsRD$ | async)?.statusCode === 404) { |
| 66 | + <h4 class="mt-4 mb-4">{{'audit.object.overview.disabled.message' | translate}}</h4> |
| 67 | + } |
| 68 | + } |
67 | 69 |
|
68 | 70 | </div> |
0 commit comments