Browse Source

Task/add skeleton loader to coupons table of admin control panel (#7327)

Add skeleton loader
pull/6947/merge
Thomas Kaul 13 hours ago
committed by GitHub
parent
commit
d857bc882c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      apps/client/src/app/components/admin-overview/admin-overview.component.ts
  2. 11
      apps/client/src/app/components/admin-overview/admin-overview.html

7
apps/client/src/app/components/admin-overview/admin-overview.component.ts

@ -63,6 +63,7 @@ import {
trashOutline trashOutline
} from 'ionicons/icons'; } from 'ionicons/icons';
import ms, { StringValue } from 'ms'; import ms, { StringValue } from 'ms';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -79,6 +80,7 @@ import ms, { StringValue } from 'ms';
MatSnackBarModule, MatSnackBarModule,
MatSlideToggleModule, MatSlideToggleModule,
MatTableModule, MatTableModule,
NgxSkeletonLoaderModule,
ReactiveFormsModule, ReactiveFormsModule,
RouterModule RouterModule
], ],
@ -102,6 +104,7 @@ export class GfAdminOverviewComponent implements OnInit {
protected hasPermissionToToggleReadOnlyMode: boolean; protected hasPermissionToToggleReadOnlyMode: boolean;
protected readonly info: InfoItem; protected readonly info: InfoItem;
protected isDataGatheringEnabled: boolean; protected isDataGatheringEnabled: boolean;
protected isLoading = false;
protected readonly permissions = permissions; protected readonly permissions = permissions;
protected systemMessage: SystemMessage; protected systemMessage: SystemMessage;
protected userCount: number; protected userCount: number;
@ -320,6 +323,8 @@ export class GfAdminOverviewComponent implements OnInit {
} }
private fetchAdminData() { private fetchAdminData() {
this.isLoading = true;
this.adminService this.adminService
.fetchAdminData() .fetchAdminData()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
@ -336,6 +341,8 @@ export class GfAdminOverviewComponent implements OnInit {
this.userCount = userCount; this.userCount = userCount;
this.version = version; this.version = version;
this.isLoading = false;
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
}); });
} }

11
apps/client/src/app/components/admin-overview/admin-overview.html

@ -248,6 +248,17 @@
mat-row mat-row
></tr> ></tr>
</table> </table>
@if (isLoading) {
<ngx-skeleton-loader
animation="pulse"
class="px-4 py-3"
[theme]="{
height: '1.5rem',
width: '100%'
}"
/>
}
</div> </div>
</mat-card-content> </mat-card-content>
<mat-card-actions align="end"> <mat-card-actions align="end">

Loading…
Cancel
Save