Browse Source

Task/add loading indicator to platform and tag management of admin panel (#7982)

* Add loading indicator

* Update changelog
pull/7962/head
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
a73809fff1
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 11
      apps/client/src/app/components/admin-platform/admin-platform.component.html
  3. 10
      apps/client/src/app/components/admin-platform/admin-platform.component.ts
  4. 11
      apps/client/src/app/components/admin-tag/admin-tag.component.html
  5. 9
      apps/client/src/app/components/admin-tag/admin-tag.component.ts

2
CHANGELOG.md

@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added a loading indicator to the platform management of the admin control panel
- Added a loading indicator to the tag management of the admin control panel
- Added a _Refresh_ action to the user detail dialog menu in the admin control panel
- Added the total column to the table of the tag management in the admin control panel

11
apps/client/src/app/components/admin-platform/admin-platform.component.html

@ -103,6 +103,17 @@
</table>
</div>
@if (isLoading) {
<ngx-skeleton-loader
animation="pulse"
class="px-4 py-3"
[theme]="{
height: '1.5rem',
width: '100%'
}"
/>
}
<mat-paginator
[class.d-none]="dataSource.data.length <= pageSize"
[hidePageSize]="true"

10
apps/client/src/app/components/admin-platform/admin-platform.component.ts

@ -36,6 +36,7 @@ import {
trashOutline
} from 'ionicons/icons';
import { DeviceDetectorService } from 'ngx-device-detector';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { GfCreateOrUpdatePlatformDialogComponent } from './create-or-update-platform-dialog/create-or-update-platform-dialog.component';
import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-dialog/interfaces/interfaces';
@ -51,6 +52,7 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-
MatPaginatorModule,
MatSortModule,
MatTableModule,
NgxSkeletonLoaderModule,
RouterModule
],
selector: 'gf-admin-platform',
@ -61,6 +63,7 @@ export class GfAdminPlatformComponent implements OnInit {
public readonly locale = input(getLocale());
protected dataSource = new MatTableDataSource<Platform>();
protected readonly displayedColumns = [
'icon',
'name',
@ -68,12 +71,15 @@ export class GfAdminPlatformComponent implements OnInit {
'accounts',
'actions'
];
protected isLoading = false;
protected readonly pageSize = DEFAULT_PAGE_SIZE;
protected platforms: Platform[];
private readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
);
private readonly paginator = viewChild.required(MatPaginator);
private readonly sort = viewChild.required(MatSort);
@ -149,6 +155,8 @@ export class GfAdminPlatformComponent implements OnInit {
}
private fetchPlatforms() {
this.isLoading = true;
this.adminService
.fetchPlatforms()
.pipe(takeUntilDestroyed(this.destroyRef))
@ -162,6 +170,8 @@ export class GfAdminPlatformComponent implements OnInit {
this.dataService.updateInfo();
this.isLoading = false;
this.changeDetectorRef.markForCheck();
});
}

11
apps/client/src/app/components/admin-tag/admin-tag.component.html

@ -141,6 +141,17 @@
</table>
</div>
@if (isLoading) {
<ngx-skeleton-loader
animation="pulse"
class="px-4 py-3"
[theme]="{
height: '1.5rem',
width: '100%'
}"
/>
}
<mat-paginator
[class.d-none]="dataSource.data.length <= pageSize"
[hidePageSize]="true"

9
apps/client/src/app/components/admin-tag/admin-tag.component.ts

@ -40,6 +40,7 @@ import {
trashOutline
} from 'ionicons/icons';
import { DeviceDetectorService } from 'ngx-device-detector';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { GfCreateOrUpdateTagDialogComponent } from './create-or-update-tag-dialog/create-or-update-tag-dialog.component';
import { CreateOrUpdateTagDialogParams } from './create-or-update-tag-dialog/interfaces/interfaces';
@ -54,6 +55,7 @@ import { CreateOrUpdateTagDialogParams } from './create-or-update-tag-dialog/int
MatPaginatorModule,
MatSortModule,
MatTableModule,
NgxSkeletonLoaderModule,
RouterModule
],
selector: 'gf-admin-tag',
@ -74,6 +76,8 @@ export class GfAdminTagComponent implements OnInit {
'total',
'actions'
];
protected isLoading = false;
protected readonly isSystemTag = isSystemTag;
protected readonly pageSize = DEFAULT_PAGE_SIZE;
protected tags: TagWithAccountAndActivityCount[];
@ -82,6 +86,7 @@ export class GfAdminTagComponent implements OnInit {
private readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
);
private readonly paginator = viewChild.required(MatPaginator);
private readonly sort = viewChild.required(MatSort);
@ -163,6 +168,8 @@ export class GfAdminTagComponent implements OnInit {
}
private fetchTags() {
this.isLoading = true;
this.dataService
.fetchTags()
.pipe(takeUntilDestroyed(this.destroyRef))
@ -185,6 +192,8 @@ export class GfAdminTagComponent implements OnInit {
this.dataService.updateInfo();
this.isLoading = false;
this.changeDetectorRef.markForCheck();
});
}

Loading…
Cancel
Save