frontend: add "Load More" functionality to recording and room lists components

This commit is contained in:
juancarmore 2025-07-26 00:35:30 +02:00
parent 96dd1a1137
commit 6770bbd9bb
7 changed files with 36 additions and 3 deletions

View File

@ -258,6 +258,16 @@
></tr> ></tr>
</table> </table>
</div> </div>
<!-- Load More Section -->
@if (showLoadMore) {
<div class="load-more-container" id="load-more-container">
<button mat-button class="load-more-btn" (click)="loadMoreRecordings()" [disabled]="loading" id="load-more-btn">
<mat-icon>expand_more</mat-icon>
<span>Load More Recordings</span>
</button>
</div>
}
} @else { } @else {
<!-- Empty State --> <!-- Empty State -->
<div class="no-recordings-state"> <div class="no-recordings-state">

View File

@ -86,6 +86,7 @@ export class RecordingListsComponent implements OnInit, OnChanges {
@Input() showFilters = false; @Input() showFilters = false;
@Input() showSelection = true; @Input() showSelection = true;
@Input() showRoomInfo = true; @Input() showRoomInfo = true;
@Input() showLoadMore = false;
@Input() loading = false; @Input() loading = false;
// Host binding for styling when recordings are selected // Host binding for styling when recordings are selected
@ -97,6 +98,7 @@ export class RecordingListsComponent implements OnInit, OnChanges {
// Output events // Output events
@Output() recordingAction = new EventEmitter<RecordingTableAction>(); @Output() recordingAction = new EventEmitter<RecordingTableAction>();
@Output() filterChange = new EventEmitter<{ nameFilter: string; statusFilter: string }>(); @Output() filterChange = new EventEmitter<{ nameFilter: string; statusFilter: string }>();
@Output() loadMore = new EventEmitter<{ nameFilter: string; statusFilter: string }>();
@Output() refresh = new EventEmitter<void>(); @Output() refresh = new EventEmitter<void>();
// Filter controls // Filter controls
@ -274,6 +276,12 @@ export class RecordingListsComponent implements OnInit, OnChanges {
} }
} }
loadMoreRecordings() {
const nameFilter = this.nameFilterControl.value || '';
const statusFilter = this.statusFilterControl.value || '';
this.loadMore.emit({ nameFilter, statusFilter });
}
// ===== FILTER METHODS ===== // ===== FILTER METHODS =====
hasActiveFilters(): boolean { hasActiveFilters(): boolean {

View File

@ -317,6 +317,16 @@
></tr> ></tr>
</table> </table>
</div> </div>
<!-- Load More Section -->
@if (showLoadMore) {
<div class="load-more-container" id="load-more-container">
<button mat-button class="load-more-btn" (click)="loadMore.emit()" [disabled]="loading" id="load-more-btn">
<mat-icon>expand_more</mat-icon>
<span>Load More Rooms</span>
</button>
</div>
}
} @else { } @else {
<!-- Empty State --> <!-- Empty State -->
<div class="no-rooms-state"> <div class="no-rooms-state">

View File

@ -94,6 +94,7 @@ export class RoomsListsComponent implements OnInit, OnChanges {
@Input() rooms: MeetRoom[] = []; @Input() rooms: MeetRoom[] = [];
@Input() showFilters = false; @Input() showFilters = false;
@Input() showSelection = true; @Input() showSelection = true;
@Input() showLoadMore = false;
@Input() loading = false; @Input() loading = false;
// Host binding for styling when rooms are selected // Host binding for styling when rooms are selected
@ -105,6 +106,7 @@ export class RoomsListsComponent implements OnInit, OnChanges {
// Output events // Output events
@Output() roomAction = new EventEmitter<RoomTableAction>(); @Output() roomAction = new EventEmitter<RoomTableAction>();
@Output() filterChange = new EventEmitter<{ nameFilter: string; statusFilter: string }>(); @Output() filterChange = new EventEmitter<{ nameFilter: string; statusFilter: string }>();
@Output() loadMore = new EventEmitter<void>();
@Output() refresh = new EventEmitter<void>(); @Output() refresh = new EventEmitter<void>();
// Filter controls // Filter controls

View File

@ -32,9 +32,10 @@
[recordings]="recordings()" [recordings]="recordings()"
[canDeleteRecordings]="true" [canDeleteRecordings]="true"
[loading]="isLoading" [loading]="isLoading"
[showFilters]="true"
[showSelection]="true" [showSelection]="true"
[showLoadMore]="hasMoreRecordings"
(recordingAction)="onRecordingAction($event)" (recordingAction)="onRecordingAction($event)"
(loadMore)="loadMoreRecordings($event)"
(refresh)="refreshRecordings()" (refresh)="refreshRecordings()"
(filterChange)="refreshRecordings($event)" (filterChange)="refreshRecordings($event)"
> >

View File

@ -110,9 +110,9 @@ export class RecordingsComponent implements OnInit {
} }
} }
async loadMoreRecordings() { async loadMoreRecordings(filters?: { nameFilter: string; statusFilter: string }) {
if (!this.hasMoreRecordings || this.isLoading) return; if (!this.hasMoreRecordings || this.isLoading) return;
await this.loadRecordings(); await this.loadRecordings(filters);
} }
async refreshRecordings(filters?: { nameFilter: string; statusFilter: string }) { async refreshRecordings(filters?: { nameFilter: string; statusFilter: string }) {

View File

@ -35,7 +35,9 @@
[rooms]="rooms()" [rooms]="rooms()"
[loading]="isLoading" [loading]="isLoading"
[showSelection]="true" [showSelection]="true"
[showLoadMore]="hasMoreRooms"
(roomAction)="onRoomAction($event)" (roomAction)="onRoomAction($event)"
(loadMore)="loadMoreRooms()"
(refresh)="refreshRooms()" (refresh)="refreshRooms()"
></ov-rooms-lists> ></ov-rooms-lists>
</div> </div>