From ee8cc47019fd7afe79f5d55783c961f7deb1bb41 Mon Sep 17 00:00:00 2001 From: Aram Al-Sabti Date: Mon, 23 May 2022 11:39:57 +0200 Subject: [PATCH] Enforce same page size options --- .../api-key-table/api-key-table.component.html | 2 +- .../api-key-table/api-key-table.component.ts | 2 ++ .../organisation-tabel.component.html | 4 ++-- .../organisation-tabel.component.ts | 3 +++ .../permission-tabel.component.html | 2 +- .../permission-tabel/permission-tabel.component.ts | 3 +++ .../awaiting-users-table.component.html | 4 ++-- .../awaiting-users-table.component.ts | 7 +++++-- .../user-list/user-table/user-table.component.html | 4 ++-- .../user-list/user-table/user-table.component.ts | 2 ++ .../applications-table.component.html | 2 +- .../applications-table.component.ts | 3 ++- .../datatarget-table.component.html | 2 +- .../datatarget-table/datatarget-table.component.ts | 4 +++- .../iot-devices-table.component.html | 2 +- .../iot-devices-table.component.ts | 2 ++ .../multicast-table/multicast-table.component.html | 14 +++++++------- .../multicast-table/multicast-table.component.ts | 2 ++ .../device-model-table.component.html | 4 ++-- .../device-model-table.component.ts | 2 ++ .../gateway-detail/gateway-detail.component.html | 2 +- .../gateway-detail/gateway-detail.component.ts | 2 ++ .../gateway-status/gateway-status.component.html | 2 +- .../gateway-status/gateway-status.component.ts | 2 ++ .../gateway-table/gateway-table.component.html | 4 ++-- .../gateway-table/gateway-table.component.ts | 2 ++ .../iot-device-minimal-table.component.html | 4 ++-- .../iot-device-minimal-table.component.ts | 4 ++++ .../payload-decoder-table.component.html | 2 +- .../payload-decoder-table.component.ts | 2 ++ .../search-table/search-table.component.html | 2 +- .../search/search-table/search-table.component.ts | 2 ++ src/app/shared/constants/page.constants.ts | 1 + .../sigfox-device-type-table.component.html | 4 ++-- .../sigfox-device-type-table.component.ts | 2 ++ 35 files changed, 73 insertions(+), 34 deletions(-) create mode 100644 src/app/shared/constants/page.constants.ts diff --git a/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html b/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html index 09321fe89..df1ef110c 100644 --- a/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html +++ b/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html @@ -85,7 +85,7 @@ - + - \ No newline at end of file + diff --git a/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts b/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts index de8b8abae..0d9143351 100644 --- a/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts +++ b/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts @@ -10,6 +10,7 @@ import { merge, Observable, of as observableOf } from 'rxjs'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { environment } from '@environments/environment'; import { startWith, switchMap, map, catchError } from 'rxjs/operators'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-organisation-tabel', @@ -29,6 +30,8 @@ export class OrganisationTabelComponent implements AfterViewInit { resultsLength = 0; public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; + isLoadingResults = true; constructor( diff --git a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html index 0b9a5992e..418979b0f 100644 --- a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html +++ b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html @@ -81,6 +81,6 @@ - + diff --git a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts index e456ee747..9a0cbd2c7 100644 --- a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts +++ b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts @@ -15,6 +15,7 @@ import { } from '../../permission.model'; import { PermissionService } from '../../permission.service'; import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-permission-tabel', @@ -39,6 +40,8 @@ export class PermissionTabelComponent implements AfterViewInit { resultsLength = 0; public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; + isLoadingResults = true; constructor( diff --git a/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html b/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html index 9c780e4b7..962fdb424 100644 --- a/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html +++ b/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html @@ -81,10 +81,10 @@ - \ No newline at end of file + diff --git a/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.ts b/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.ts index 6c82c8e19..3ca1fb719 100644 --- a/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.ts +++ b/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.ts @@ -13,6 +13,7 @@ import { TranslateService } from '@ngx-translate/core'; import { merge, Observable, of as observableOf } from 'rxjs'; import { catchError, map, startWith, switchMap } from 'rxjs/operators'; import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-awaiting-users-table', @@ -24,6 +25,8 @@ export class AwaitingUsersTableComponent implements AfterViewInit { users: UserResponse[]; public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; + resultsLength = 0; public errorMessage: string; isLoadingResults = true; @@ -41,9 +44,9 @@ export class AwaitingUsersTableComponent implements AfterViewInit { private userService: UserService, private sharedService: SharedVariableService, private deleteDialogService: DeleteDialogService - ) {} + ) {} - ngAfterViewInit() { + ngAfterViewInit() { this.organizationId = this.sharedService.getSelectedOrganisationId(); // If the user changes the sort order, reset back to the first page. this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); diff --git a/src/app/admin/users/user-list/user-table/user-table.component.html b/src/app/admin/users/user-list/user-table/user-table.component.html index 3f3e48efb..d729f65e0 100644 --- a/src/app/admin/users/user-list/user-table/user-table.component.html +++ b/src/app/admin/users/user-list/user-table/user-table.component.html @@ -81,7 +81,7 @@ - + - \ No newline at end of file + diff --git a/src/app/admin/users/user-list/user-table/user-table.component.ts b/src/app/admin/users/user-list/user-table/user-table.component.ts index 3c45981be..a5a44d90e 100644 --- a/src/app/admin/users/user-list/user-table/user-table.component.ts +++ b/src/app/admin/users/user-list/user-table/user-table.component.ts @@ -12,6 +12,7 @@ import { UserGetManyResponse, UserResponse } from '../../user.model'; import { UserService } from '../../user.service'; import { merge, Observable, of as observableOf } from 'rxjs'; import { environment } from '@environments/environment'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-user-table', @@ -30,6 +31,7 @@ export class UserTableComponent implements AfterViewInit { data: UserResponse[]; public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; resultsLength = 0; isLoadingResults = true; @ViewChild(MatPaginator) paginator: MatPaginator; diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.html b/src/app/applications/applications-list/applications-table/applications-table.component.html index dfc96aacf..c945d5a1e 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.html +++ b/src/app/applications/applications-list/applications-table/applications-table.component.html @@ -56,6 +56,6 @@ - + diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.ts b/src/app/applications/applications-list/applications-table/applications-table.component.ts index 057c408ba..697c512a1 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.ts +++ b/src/app/applications/applications-list/applications-table/applications-table.component.ts @@ -16,8 +16,8 @@ import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dia import { MeService } from '@shared/services/me.service'; import { merge, Observable, of as observableOf } from 'rxjs'; import { catchError, map, startWith, switchMap } from 'rxjs/operators'; -import { DeviceType } from '@shared/enums/device-type'; import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; /** * @title Table retrieving data through HTTP @@ -34,6 +34,7 @@ export class ApplicationsTableComponent implements AfterViewInit, OnInit { data: Application[] = []; public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; resultsLength = 0; isLoadingResults = true; public errorMessage: string; diff --git a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.html b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.html index 90043b6f1..e5172431e 100644 --- a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.html +++ b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.html @@ -48,6 +48,6 @@ - + diff --git a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts index def5822c5..293f36e9d 100644 --- a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts +++ b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts @@ -12,6 +12,7 @@ import { environment } from '@environments/environment'; import { tableSorter } from '@shared/helpers/table-sorting.helper'; import { MeService } from '@shared/services/me.service'; import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-datatarget-table', @@ -28,6 +29,7 @@ export class DatatargetTableComponent implements OnInit, AfterViewInit, OnDestro public canEdit = false; @Input() isLoadingResults = true; public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; @Input() pageLimit: number; public pageOffset = 0; @@ -47,7 +49,7 @@ export class DatatargetTableComponent implements OnInit, AfterViewInit, OnDestro } ngOnInit(): void { - this.applicationId = +Number(this.route.parent.snapshot.paramMap.get('id')); + this.applicationId = +Number(this.route.parent.snapshot.paramMap.get('id')); this.getDatatarget(); this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite); } diff --git a/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.html b/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.html index 5cdc7c8bc..d80758560 100644 --- a/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.html +++ b/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.html @@ -112,6 +112,6 @@ - + diff --git a/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts b/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts index f62ed3d5d..5efed1033 100644 --- a/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts +++ b/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts @@ -24,6 +24,7 @@ import { merge, Observable, of as observableOf } from 'rxjs'; import { catchError, map, startWith, switchMap } from 'rxjs/operators'; import { RestService } from 'src/app/shared/services/rest.service'; import { IoTDeviceService } from '../iot-device.service'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-iot-devices-table', @@ -36,6 +37,7 @@ export class IotDevicesTableComponent implements AfterViewInit, OnInit { @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; displayedColumns: string[] = [ 'name', 'technology', diff --git a/src/app/applications/multicast/multicast-table/multicast-table.component.html b/src/app/applications/multicast/multicast-table/multicast-table.component.html index a4263e0c1..c66b47fad 100644 --- a/src/app/applications/multicast/multicast-table/multicast-table.component.html +++ b/src/app/applications/multicast/multicast-table/multicast-table.component.html @@ -3,7 +3,7 @@ - + - + @@ -44,10 +44,10 @@ - +
@@ -14,16 +14,16 @@ class="application-link">{{element.groupName}} - + {{ 'MULTICAST-TABLE.TYPE' | translate }} - + {{element.lorawanMulticastDefinition.groupType}}
- + - \ No newline at end of file + diff --git a/src/app/applications/multicast/multicast-table/multicast-table.component.ts b/src/app/applications/multicast/multicast-table/multicast-table.component.ts index cd6b95714..a2cf6a480 100644 --- a/src/app/applications/multicast/multicast-table/multicast-table.component.ts +++ b/src/app/applications/multicast/multicast-table/multicast-table.component.ts @@ -19,6 +19,7 @@ import { catchError, map, startWith, switchMap } from 'rxjs/operators'; import { Multicast, MulticastData } from '../multicast.model'; import { MulticastService } from '../multicast.service'; import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-multicast-table', @@ -35,6 +36,7 @@ export class MulticastTableComponent public canEdit = false; @Input() isLoadingResults = true; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; public pageOffset = 0; public applicationId: number; diff --git a/src/app/device-model/device-model-table/device-model-table.component.html b/src/app/device-model/device-model-table/device-model-table.component.html index 1652fced8..ae2652d2b 100644 --- a/src/app/device-model/device-model-table/device-model-table.component.html +++ b/src/app/device-model/device-model-table/device-model-table.component.html @@ -49,6 +49,6 @@ - + - \ No newline at end of file + diff --git a/src/app/device-model/device-model-table/device-model-table.component.ts b/src/app/device-model/device-model-table/device-model-table.component.ts index b4529ae10..18d575ef8 100644 --- a/src/app/device-model/device-model-table/device-model-table.component.ts +++ b/src/app/device-model/device-model-table/device-model-table.component.ts @@ -19,6 +19,7 @@ import { startWith, switchMap, map, catchError } from 'rxjs/operators'; import { DeviceModelService } from '../device-model.service'; import { DeviceModel, DeviceModelResponse } from '../device.model'; import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-device-model-table', @@ -31,6 +32,7 @@ export class DeviceModelTableComponent implements OnInit, AfterViewInit { public data: DeviceModel[]; public displayedColumns: string[] = ['name', 'id', 'menu']; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; public isLoadingResults = false; public resultsLength = 0; deleteDialogSubscription: Subscription; diff --git a/src/app/gateway/gateway-detail/gateway-detail.component.html b/src/app/gateway/gateway-detail/gateway-detail.component.html index 4c959a092..b5159f82c 100644 --- a/src/app/gateway/gateway-detail/gateway-detail.component.html +++ b/src/app/gateway/gateway-detail/gateway-detail.component.html @@ -92,7 +92,7 @@

{{ 'GATEWAY.DATA-PACKETS' | translate }}

- + diff --git a/src/app/gateway/gateway-detail/gateway-detail.component.ts b/src/app/gateway/gateway-detail/gateway-detail.component.ts index c4a28ed76..a28277963 100644 --- a/src/app/gateway/gateway-detail/gateway-detail.component.ts +++ b/src/app/gateway/gateway-detail/gateway-detail.component.ts @@ -15,6 +15,7 @@ import { OrganizationAccessScope } from '@shared/enums/access-scopes'; import { ChartConfiguration } from 'chart.js'; import { ColorGraphBlue1 } from '@shared/constants/color-constants'; import { formatDate } from '@angular/common'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-gateway-detail', @@ -26,6 +27,7 @@ export class GatewayDetailComponent implements OnInit, OnDestroy, AfterViewInit displayedColumns: string[] = ['rxPacketsReceived', 'txPacketsEmitted', 'txPacketsReceived']; private gatewayStats: GatewayStats[]; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; public dataSource = new MatTableDataSource(); @ViewChild(MatPaginator) paginator: MatPaginator; public resultLength = 0; diff --git a/src/app/gateway/gateway-status/gateway-status.component.html b/src/app/gateway/gateway-status/gateway-status.component.html index 81ce42d60..2a67dd3d9 100644 --- a/src/app/gateway/gateway-status/gateway-status.component.html +++ b/src/app/gateway/gateway-status/gateway-status.component.html @@ -48,7 +48,7 @@

{{title}}

-
diff --git a/src/app/gateway/gateway-status/gateway-status.component.ts b/src/app/gateway/gateway-status/gateway-status.component.ts index f569027db..8b1479bed 100644 --- a/src/app/gateway/gateway-status/gateway-status.component.ts +++ b/src/app/gateway/gateway-status/gateway-status.component.ts @@ -17,6 +17,7 @@ import { Observable, Subject, Subscription } from 'rxjs'; import { GatewayStatusInterval } from '../enums/gateway-status-interval.enum'; import { GatewayStatus, AllGatewayStatusResponse } from '../gateway.model'; import { map } from 'rxjs/operators'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; interface TimeColumn { exactTimestamp: string; @@ -51,6 +52,7 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { timestampText = ''; visibleFooterTimeInterval = 1; pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; resultsLength = 0; organizationId: number | undefined; isLoadingResults = false; diff --git a/src/app/gateway/gateway-table/gateway-table.component.html b/src/app/gateway/gateway-table/gateway-table.component.html index 873f244bf..b0f258892 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.html +++ b/src/app/gateway/gateway-table/gateway-table.component.html @@ -93,6 +93,6 @@ - + -
\ No newline at end of file + diff --git a/src/app/gateway/gateway-table/gateway-table.component.ts b/src/app/gateway/gateway-table/gateway-table.component.ts index aeae7b691..6cafd6e34 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.ts +++ b/src/app/gateway/gateway-table/gateway-table.component.ts @@ -17,6 +17,7 @@ import { MatSort } from '@angular/material/sort'; import { MatTableDataSource } from '@angular/material/table'; import { tableSorter } from '@shared/helpers/table-sorting.helper'; import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-gateway-table', @@ -38,6 +39,7 @@ export class GatewayTableComponent implements AfterViewInit { data: Gateway[] = []; dataSource: MatTableDataSource; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; faExclamationTriangle = faExclamationTriangle; faCheckCircle = faCheckCircle; diff --git a/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.html b/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.html index 171e44f4d..6ed5a45f8 100644 --- a/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.html +++ b/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.html @@ -36,6 +36,6 @@ - + - \ No newline at end of file + diff --git a/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.ts b/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.ts index 0359bc7f5..549dcc34d 100644 --- a/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.ts +++ b/src/app/payload-decoder/payload-decoder-detail/iot-device-minimal-table/iot-device-minimal-table.component.ts @@ -11,6 +11,8 @@ import { SharedVariableService } from '@shared/shared-variable/shared-variable.s import { Observable, of as observableOf } from 'rxjs'; import { startWith, switchMap, map, catchError } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; +import { environment } from '@environments/environment'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-iot-device-minimal-table', @@ -25,6 +27,8 @@ export class IoTDeviceMinimalTableComponent implements AfterViewInit { resultsLength = 0; isLoadingResults = true; + public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; @ViewChild(MatPaginator) paginator: MatPaginator; diff --git a/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.html b/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.html index 298e82229..3e9d173fa 100644 --- a/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.html +++ b/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.html @@ -65,7 +65,7 @@ - diff --git a/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.ts b/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.ts index 1e1d4f071..7755db562 100644 --- a/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.ts +++ b/src/app/payload-decoder/payload-decoder-list/payload-decoder-table/payload-decoder-table.component.ts @@ -19,6 +19,7 @@ import { SharedVariableService } from '@shared/shared-variable/shared-variable.s import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; import { TranslateService } from '@ngx-translate/core'; import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-payload-decoder-table', @@ -31,6 +32,7 @@ export class PayloadDecoderTableComponent @ViewChild(MatSort) sort: MatSort; displayedColumns: string[] = ['name', 'id', 'organizationID', 'menu']; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; data: PayloadDecoder[] = []; diff --git a/src/app/search/search-table/search-table.component.html b/src/app/search/search-table/search-table.component.html index 0549e5a85..32a116cb8 100644 --- a/src/app/search/search-table/search-table.component.html +++ b/src/app/search/search-table/search-table.component.html @@ -89,7 +89,7 @@

; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; isLoadingResults = true; subscription: Subscription; diff --git a/src/app/shared/constants/page.constants.ts b/src/app/shared/constants/page.constants.ts new file mode 100644 index 000000000..365700797 --- /dev/null +++ b/src/app/shared/constants/page.constants.ts @@ -0,0 +1 @@ +export const DefaultPageSizeOptions: number[] = [25, 50, 100]; diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html index 820e26d4d..6ca580148 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html @@ -18,5 +18,5 @@ - - \ No newline at end of file + + diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts index a997c0a3b..97adbdc6f 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts @@ -6,6 +6,7 @@ import { environment } from '@environments/environment'; import { TranslateService } from '@ngx-translate/core'; import { SigfoxDeviceType } from '@shared/models/sigfox-device-type.model'; import { SigfoxGroup } from '@shared/models/sigfox-group.model'; +import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; @Component({ selector: 'app-sigfox-device-type-table', @@ -20,6 +21,7 @@ export class SigfoxDeviceTypeTableComponent implements OnInit, OnChanges { @ViewChild(MatPaginator) paginator: MatPaginator; displayedColumns: string[] = ['name', 'alertEmail']; public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; @Input() isLoadingResults: boolean; resultsLength: number;