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>
</table>
</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 {
<!-- Empty State -->
<div class="no-recordings-state">

View File

@ -86,6 +86,7 @@ export class RecordingListsComponent implements OnInit, OnChanges {
@Input() showFilters = false;
@Input() showSelection = true;
@Input() showRoomInfo = true;
@Input() showLoadMore = false;
@Input() loading = false;
// Host binding for styling when recordings are selected
@ -97,6 +98,7 @@ export class RecordingListsComponent implements OnInit, OnChanges {
// Output events
@Output() recordingAction = new EventEmitter<RecordingTableAction>();
@Output() filterChange = new EventEmitter<{ nameFilter: string; statusFilter: string }>();
@Output() loadMore = new EventEmitter<{ nameFilter: string; statusFilter: string }>();
@Output() refresh = new EventEmitter<void>();
// 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 =====
hasActiveFilters(): boolean {

View File

@ -317,6 +317,16 @@
></tr>
</table>
</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 {
<!-- Empty State -->
<div class="no-rooms-state">

View File

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

View File

@ -32,9 +32,10 @@
[recordings]="recordings()"
[canDeleteRecordings]="true"
[loading]="isLoading"
[showFilters]="true"
[showSelection]="true"
[showLoadMore]="hasMoreRecordings"
(recordingAction)="onRecordingAction($event)"
(loadMore)="loadMoreRecordings($event)"
(refresh)="refreshRecordings()"
(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;
await this.loadRecordings();
await this.loadRecordings(filters);
}
async refreshRecordings(filters?: { nameFilter: string; statusFilter: string }) {

View File

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