Spaces:
Paused
Paused
Update flare-ui/src/app/components/activity-log/activity-log.component.ts
Browse files
flare-ui/src/app/components/activity-log/activity-log.component.ts
CHANGED
|
@@ -42,27 +42,30 @@ interface ActivityLogResponse {
|
|
| 42 |
MatDividerModule
|
| 43 |
],
|
| 44 |
template: `
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
| 58 |
<mat-spinner diameter="30"></mat-spinner>
|
| 59 |
</div>
|
| 60 |
-
|
|
|
|
| 61 |
<mat-icon>inbox</mat-icon>
|
| 62 |
<p>No activities found</p>
|
| 63 |
</div>
|
| 64 |
-
|
| 65 |
-
|
|
|
|
| 66 |
<mat-list-item>
|
| 67 |
<mat-icon matListItemIcon>{{ getActivityIcon(activity.action) }}</mat-icon>
|
| 68 |
<div matListItemTitle>
|
|
@@ -71,33 +74,38 @@ interface ActivityLogResponse {
|
|
| 71 |
<div matListItemLine>
|
| 72 |
<strong>{{ activity.user }}</strong> {{ getActionText(activity) }}
|
| 73 |
<em>{{ activity.entity_name }}</em>
|
| 74 |
-
|
|
|
|
|
|
|
| 75 |
</div>
|
| 76 |
</mat-list-item>
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
| 79 |
</mat-list>
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
</mat-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
</
|
| 99 |
-
</mat-card>
|
| 100 |
-
|
|
|
|
| 101 |
styles: [`
|
| 102 |
.activity-log-dropdown {
|
| 103 |
width: 450px;
|
|
|
|
| 42 |
MatDividerModule
|
| 43 |
],
|
| 44 |
template: `
|
| 45 |
+
<mat-card class="activity-log-dropdown" (click)="$event.stopPropagation()">
|
| 46 |
+
<mat-card-header>
|
| 47 |
+
<mat-card-title>
|
| 48 |
+
<mat-icon>notifications</mat-icon>
|
| 49 |
+
Recent Activities
|
| 50 |
+
</mat-card-title>
|
| 51 |
+
<button mat-icon-button (click)="close.emit()">
|
| 52 |
+
<mat-icon>close</mat-icon>
|
| 53 |
+
</button>
|
| 54 |
+
</mat-card-header>
|
| 55 |
+
|
| 56 |
+
<mat-card-content>
|
| 57 |
+
@if (loading && activities.length === 0) {
|
| 58 |
+
<div class="loading">
|
| 59 |
<mat-spinner diameter="30"></mat-spinner>
|
| 60 |
</div>
|
| 61 |
+
} @else if (activities.length === 0) {
|
| 62 |
+
<div class="empty">
|
| 63 |
<mat-icon>inbox</mat-icon>
|
| 64 |
<p>No activities found</p>
|
| 65 |
</div>
|
| 66 |
+
} @else {
|
| 67 |
+
<mat-list class="activity-list">
|
| 68 |
+
@for (activity of activities; track activity.id) {
|
| 69 |
<mat-list-item>
|
| 70 |
<mat-icon matListItemIcon>{{ getActivityIcon(activity.action) }}</mat-icon>
|
| 71 |
<div matListItemTitle>
|
|
|
|
| 74 |
<div matListItemLine>
|
| 75 |
<strong>{{ activity.user }}</strong> {{ getActionText(activity) }}
|
| 76 |
<em>{{ activity.entity_name }}</em>
|
| 77 |
+
@if (activity.details) {
|
| 78 |
+
<span class="details">• {{ activity.details }}</span>
|
| 79 |
+
}
|
| 80 |
</div>
|
| 81 |
</mat-list-item>
|
| 82 |
+
@if (!$last) {
|
| 83 |
+
<mat-divider></mat-divider>
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
</mat-list>
|
| 87 |
+
}
|
| 88 |
+
</mat-card-content>
|
| 89 |
+
|
| 90 |
+
<mat-card-actions *ngIf="totalItems > pageSize">
|
| 91 |
+
<mat-paginator
|
| 92 |
+
[length]="totalItems"
|
| 93 |
+
[pageSize]="pageSize"
|
| 94 |
+
[pageIndex]="currentPage - 1"
|
| 95 |
+
[pageSizeOptions]="[10, 25, 50]"
|
| 96 |
+
(page)="onPageChange($event)"
|
| 97 |
+
showFirstLastButtons>
|
| 98 |
+
</mat-paginator>
|
| 99 |
+
</mat-card-actions>
|
| 100 |
+
|
| 101 |
+
<mat-card-actions *ngIf="totalItems <= pageSize && activities.length > 0">
|
| 102 |
+
<button mat-button (click)="openFullView()" class="full-width">
|
| 103 |
+
<mat-icon>open_in_new</mat-icon>
|
| 104 |
+
View All Activities
|
| 105 |
+
</button>
|
| 106 |
+
</mat-card-actions>
|
| 107 |
+
</mat-card>
|
| 108 |
+
`,
|
| 109 |
styles: [`
|
| 110 |
.activity-log-dropdown {
|
| 111 |
width: 450px;
|