Feature/setup skeleton loader for data tables (#3735)
* Setup skeleton loader for data tables * Update changelog
This commit is contained in:
parent
8c322b4e81
commit
1bc2b47452
@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Set up a performance logging service
|
- Set up a performance logging service
|
||||||
|
- Added a loading indicator to the queue jobs table in the admin control panel
|
||||||
|
- Added a loading indicator to the users table in the admin control panel
|
||||||
- Added the attribute `mode` to the scraper configuration to get quotes instantly
|
- Added the attribute `mode` to the scraper configuration to get quotes instantly
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -51,6 +51,7 @@ export class AdminJobsComponent implements OnDestroy, OnInit {
|
|||||||
'status',
|
'status',
|
||||||
'actions'
|
'actions'
|
||||||
];
|
];
|
||||||
|
public isLoading = false;
|
||||||
public statusFilterOptions = QUEUE_JOB_STATUS_LIST;
|
public statusFilterOptions = QUEUE_JOB_STATUS_LIST;
|
||||||
public user: User;
|
public user: User;
|
||||||
|
|
||||||
@ -138,12 +139,16 @@ export class AdminJobsComponent implements OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fetchJobs(aStatus?: JobStatus[]) {
|
private fetchJobs(aStatus?: JobStatus[]) {
|
||||||
|
this.isLoading = true;
|
||||||
|
|
||||||
this.adminService
|
this.adminService
|
||||||
.fetchJobs({ status: aStatus })
|
.fetchJobs({ status: aStatus })
|
||||||
.pipe(takeUntil(this.unsubscribeSubject))
|
.pipe(takeUntil(this.unsubscribeSubject))
|
||||||
.subscribe(({ jobs }) => {
|
.subscribe(({ jobs }) => {
|
||||||
this.dataSource = new MatTableDataSource(jobs);
|
this.dataSource = new MatTableDataSource(jobs);
|
||||||
|
|
||||||
|
this.isLoading = false;
|
||||||
|
|
||||||
this.changeDetectorRef.markForCheck();
|
this.changeDetectorRef.markForCheck();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,16 @@
|
|||||||
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr>
|
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr>
|
||||||
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr>
|
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr>
|
||||||
</table>
|
</table>
|
||||||
|
@if (isLoading) {
|
||||||
|
<ngx-skeleton-loader
|
||||||
|
animation="pulse"
|
||||||
|
class="px-4 py-3"
|
||||||
|
[theme]="{
|
||||||
|
height: '1.5rem',
|
||||||
|
width: '100%'
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,6 +5,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { MatSelectModule } from '@angular/material/select';
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
import { MatTableModule } from '@angular/material/table';
|
import { MatTableModule } from '@angular/material/table';
|
||||||
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
|
||||||
|
|
||||||
import { AdminJobsComponent } from './admin-jobs.component';
|
import { AdminJobsComponent } from './admin-jobs.component';
|
||||||
|
|
||||||
@ -17,6 +18,7 @@ import { AdminJobsComponent } from './admin-jobs.component';
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatTableModule,
|
MatTableModule,
|
||||||
|
NgxSkeletonLoaderModule,
|
||||||
ReactiveFormsModule
|
ReactiveFormsModule
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
|
@ -32,6 +32,7 @@ export class AdminUsersComponent implements OnDestroy, OnInit {
|
|||||||
public hasPermissionForSubscription: boolean;
|
public hasPermissionForSubscription: boolean;
|
||||||
public hasPermissionToImpersonateAllUsers: boolean;
|
public hasPermissionToImpersonateAllUsers: boolean;
|
||||||
public info: InfoItem;
|
public info: InfoItem;
|
||||||
|
public isLoading = false;
|
||||||
public user: User;
|
public user: User;
|
||||||
|
|
||||||
private unsubscribeSubject = new Subject<void>();
|
private unsubscribeSubject = new Subject<void>();
|
||||||
@ -142,12 +143,16 @@ export class AdminUsersComponent implements OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fetchAdminData() {
|
private fetchAdminData() {
|
||||||
|
this.isLoading = true;
|
||||||
|
|
||||||
this.adminService
|
this.adminService
|
||||||
.fetchAdminData()
|
.fetchAdminData()
|
||||||
.pipe(takeUntil(this.unsubscribeSubject))
|
.pipe(takeUntil(this.unsubscribeSubject))
|
||||||
.subscribe(({ users }) => {
|
.subscribe(({ users }) => {
|
||||||
this.dataSource = new MatTableDataSource(users);
|
this.dataSource = new MatTableDataSource(users);
|
||||||
|
|
||||||
|
this.isLoading = false;
|
||||||
|
|
||||||
this.changeDetectorRef.markForCheck();
|
this.changeDetectorRef.markForCheck();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -245,6 +245,16 @@
|
|||||||
></tr>
|
></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@if (isLoading) {
|
||||||
|
<ngx-skeleton-loader
|
||||||
|
animation="pulse"
|
||||||
|
class="px-4 py-3"
|
||||||
|
[theme]="{
|
||||||
|
height: '1.5rem',
|
||||||
|
width: '100%'
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,6 +6,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
|||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { MatTableModule } from '@angular/material/table';
|
import { MatTableModule } from '@angular/material/table';
|
||||||
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
|
||||||
|
|
||||||
import { AdminUsersComponent } from './admin-users.component';
|
import { AdminUsersComponent } from './admin-users.component';
|
||||||
|
|
||||||
@ -18,7 +19,8 @@ import { AdminUsersComponent } from './admin-users.component';
|
|||||||
GfValueComponent,
|
GfValueComponent,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
MatTableModule
|
MatTableModule,
|
||||||
|
NgxSkeletonLoaderModule
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user