|
|
|
@ -1,4 +1,5 @@ |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config'; |
|
|
|
import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos'; |
|
|
|
import { ConfirmationDialogType } from '@ghostfolio/common/enums'; |
|
|
|
import { getLocale, getLowercase } from '@ghostfolio/common/helper'; |
|
|
|
@ -22,6 +23,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
|
import { MatMenuModule } from '@angular/material/menu'; |
|
|
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator'; |
|
|
|
import { MatSort, MatSortModule } from '@angular/material/sort'; |
|
|
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table'; |
|
|
|
import { ActivatedRoute, Router, RouterModule } from '@angular/router'; |
|
|
|
@ -46,6 +48,7 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform- |
|
|
|
IonIcon, |
|
|
|
MatButtonModule, |
|
|
|
MatMenuModule, |
|
|
|
MatPaginatorModule, |
|
|
|
MatSortModule, |
|
|
|
MatTableModule, |
|
|
|
RouterModule |
|
|
|
@ -59,11 +62,13 @@ export class GfAdminPlatformComponent implements OnInit { |
|
|
|
|
|
|
|
protected dataSource = new MatTableDataSource<Platform>(); |
|
|
|
protected readonly displayedColumns = ['name', 'url', 'accounts', 'actions']; |
|
|
|
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); |
|
|
|
|
|
|
|
private readonly adminService = inject(AdminService); |
|
|
|
@ -145,6 +150,7 @@ export class GfAdminPlatformComponent implements OnInit { |
|
|
|
this.platforms = platforms; |
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(platforms); |
|
|
|
this.dataSource.paginator = this.paginator(); |
|
|
|
this.dataSource.sort = this.sort(); |
|
|
|
this.dataSource.sortingDataAccessor = getLowercase; |
|
|
|
|
|
|
|
|