diff --git a/ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts b/ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts index 3c6fce7fc4..fe8a1064b5 100644 --- a/ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts @@ -29,8 +29,8 @@ export abstract class ContactBasedComponent> exten protected constructor(protected store: Store, protected fb: FormBuilder, protected entityValue: T, - protected entitiesTableConfig: EntityTableConfig) { - super(store, fb, entityValue, entitiesTableConfig); + protected entitiesTableConfigValue: EntityTableConfig) { + super(store, fb, entityValue, entitiesTableConfigValue); } buildForm(entity: T): FormGroup { diff --git a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html index 50f71d0459..ba5b1303a0 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html @@ -25,7 +25,7 @@ @@ -227,11 +227,12 @@ fxLayoutAlign="center center" class="no-data-found" translate>{{ translations.noEntities }} - - + + [pageSizeOptions]="pageSizeOptions"> diff --git a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts index af202a3a03..5cf613cfa1 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts @@ -19,7 +19,7 @@ import { ChangeDetectionStrategy, Component, ComponentFactoryResolver, - ElementRef, + ElementRef, EventEmitter, Input, OnChanges, OnInit, SimpleChanges, ViewChild @@ -27,14 +27,14 @@ import { import { PageComponent } from '@shared/components/page.component'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { PageLink, TimePageLink } from '@shared/models/page/page-link'; +import { MAX_SAFE_PAGE_SIZE, PageLink, TimePageLink } from '@shared/models/page/page-link'; import { MatDialog } from '@angular/material/dialog'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { EntitiesDataSource } from '@home/models/datasource/entity-datasource'; import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators'; import { Direction, SortOrder } from '@shared/models/page/sort-order'; -import { forkJoin, fromEvent, merge, Observable } from 'rxjs'; +import { forkJoin, fromEvent, merge, Observable, Subscription } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { BaseData, HasId } from '@shared/models/base-data'; import { ActivatedRoute } from '@angular/router'; @@ -87,12 +87,16 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn selectionEnabled; + defaultPageSize = 10; + displayPagination = true; + pageSizeOptions; pageLink: PageLink; textSearchMode = false; timewindow: Timewindow; dataSource: EntitiesDataSource>; isDetailsOpen = false; + detailsPanelOpened = new EventEmitter(); @ViewChild('entityTableHeader', {static: true}) entityTableHeaderAnchor: TbAnchorComponent; @@ -101,6 +105,10 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; + private sortSubscription: Subscription; + private updateDataSubscription: Subscription; + private viewInited = false; + constructor(protected store: Store, private route: ActivatedRoute, public translate: TranslateService, @@ -183,6 +191,10 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn }; } + this.displayPagination = this.entitiesTableConfig.displayPagination; + this.defaultPageSize = this.entitiesTableConfig.defaultPageSize; + this.pageSizeOptions = [this.defaultPageSize, this.defaultPageSize * 2, this.defaultPageSize * 3]; + if (this.entitiesTableConfig.useTimePageLink) { this.timewindow = historyInterval(DAY); const currentTime = Date.now(); @@ -191,6 +203,7 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn } else { this.pageLink = new PageLink(10, 0, null, sortOrder); } + this.pageLink.pageSize = this.displayPagination ? this.defaultPageSize : MAX_SAFE_PAGE_SIZE; this.dataSource = this.entitiesTableConfig.dataSource(() => { this.dataLoaded(); }); @@ -200,6 +213,11 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn if (this.entitiesTableConfig.loadDataOnInit) { this.dataSource.loadEntities(this.pageLink); } + if (this.viewInited) { + setTimeout(() => { + this.updatePaginationSubscriptions(); + }, 0); + } } ngAfterViewInit() { @@ -209,15 +227,31 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn debounceTime(150), distinctUntilChanged(), tap(() => { - this.paginator.pageIndex = 0; + if (this.displayPagination) { + this.paginator.pageIndex = 0; + } this.updateData(); }) ) .subscribe(); - this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); + this.updatePaginationSubscriptions(); + this.viewInited = true; + } - merge(this.sort.sortChange, this.paginator.page) + private updatePaginationSubscriptions() { + if (this.sortSubscription) { + this.sortSubscription.unsubscribe(); + this.sortSubscription = null; + } + if (this.updateDataSubscription) { + this.updateDataSubscription.unsubscribe(); + this.updateDataSubscription = null; + } + if (this.displayPagination) { + this.sortSubscription = this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); + } + this.updateDataSubscription = (this.displayPagination ? merge(this.sort.sortChange, this.paginator.page) : this.sort.sortChange) .pipe( tap(() => this.updateData()) ) @@ -232,8 +266,12 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn if (closeDetails) { this.isDetailsOpen = false; } - this.pageLink.page = this.paginator.pageIndex; - this.pageLink.pageSize = this.paginator.pageSize; + if (this.displayPagination) { + this.pageLink.page = this.paginator.pageIndex; + this.pageLink.pageSize = this.paginator.pageSize; + } else { + this.pageLink.page = 0; + } if (this.sort.active) { this.pageLink.sortOrder = { property: this.sort.active, @@ -264,6 +302,12 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn } onRowClick($event: Event, entity) { + if (!this.entitiesTableConfig.handleRowClick($event, entity)) { + this.toggleEntityDetails($event, entity); + } + } + + toggleEntityDetails($event: Event, entity) { if ($event) { $event.stopPropagation(); } @@ -272,6 +316,7 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn } else { this.isDetailsOpen = !this.isDetailsOpen; } + this.detailsPanelOpened.emit(this.isDetailsOpen); } addEntity($event: Event) { @@ -371,16 +416,20 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn exitFilterMode() { this.textSearchMode = false; this.pageLink.textSearch = null; - this.paginator.pageIndex = 0; + if (this.displayPagination) { + this.paginator.pageIndex = 0; + } this.updateData(); } resetSortAndFilter(update: boolean = true) { this.pageLink.textSearch = null; if (this.entitiesTableConfig.useTimePageLink) { - this.timewindow = historyInterval(24 * 60 * 60 * 1000); + this.timewindow = historyInterval(DAY); + } + if (this.displayPagination) { + this.paginator.pageIndex = 0; } - this.paginator.pageIndex = 0; const sortable = this.sort.sortables.get(this.entitiesTableConfig.defaultSortOrder.property); this.sort.active = sortable.id; this.sort.direction = this.entitiesTableConfig.defaultSortOrder.direction === Direction.ASC ? 'asc' : 'desc'; diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts index 2295773040..7e79b0c16f 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts @@ -51,8 +51,6 @@ import { deepClone } from '@core/utils'; }) export class EntityDetailsPanelComponent extends PageComponent implements OnInit, AfterViewInit, OnDestroy { - @Input() entitiesTableConfig: EntityTableConfig>; - @Output() closeEntityDetails = new EventEmitter(); @@ -66,6 +64,7 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit entityTabsComponent: EntityTabsComponent>; detailsForm: NgForm; + entitiesTableConfigValue: EntityTableConfig>; isEditValue = false; selectedTab = 0; @@ -102,9 +101,26 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit } } + @Input() + set entitiesTableConfig(entitiesTableConfig: EntityTableConfig>) { + this.entitiesTableConfigValue = entitiesTableConfig; + if (this.entityComponent) { + this.entityComponent.entitiesTableConfig = entitiesTableConfig; + } + if (this.entityTabsComponent) { + this.entityTabsComponent.entitiesTableConfig = entitiesTableConfig; + } + } + + get entitiesTableConfig(): EntityTableConfig> { + return this.entitiesTableConfigValue; + } + set isEdit(val: boolean) { this.isEditValue = val; - this.entityComponent.isEdit = val; + if (this.entityComponent) { + this.entityComponent.isEdit = val; + } if (this.entityTabsComponent) { this.entityTabsComponent.isEdit = val; } diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts index a61f78ec3e..e24345bc7e 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-table-header.component.ts @@ -20,12 +20,25 @@ import { Input, OnInit, Directive } from '@angular/core'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; +import { PageLink } from '@shared/models/page/page-link'; @Directive() -export abstract class EntityTableHeaderComponent> extends PageComponent implements OnInit { +export abstract class EntityTableHeaderComponent, + P extends PageLink = PageLink, + L extends BaseData = T, + C extends EntityTableConfig = EntityTableConfig> + extends PageComponent implements OnInit { + + entitiesTableConfigValue: C; @Input() - entitiesTableConfig: EntityTableConfig; + set entitiesTableConfig(entitiesTableConfig: C) { + this.setEntitiesTableConfig(entitiesTableConfig); + } + + get entitiesTableConfig(): C { + return this.entitiesTableConfigValue; + } protected constructor(protected store: Store) { super(store); @@ -34,4 +47,8 @@ export abstract class EntityTableHeaderComponent> exte ngOnInit() { } + protected setEntitiesTableConfig(entitiesTableConfig: C) { + this.entitiesTableConfigValue = entitiesTableConfig; + } + } diff --git a/ui-ngx/src/app/modules/home/components/entity/entity.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity.component.ts index baa0e5e975..57ab9e18e2 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity.component.ts @@ -38,6 +38,15 @@ export abstract class EntityComponent, isEditValue: boolean; + @Input() + set entitiesTableConfig(entitiesTableConfig: C) { + this.entitiesTableConfigValue = entitiesTableConfig; + } + + get entitiesTableConfig(): C { + return this.entitiesTableConfigValue; + } + @Input() set isEdit(isEdit: boolean) { this.isEditValue = isEdit; @@ -72,7 +81,7 @@ export abstract class EntityComponent, protected constructor(protected store: Store, protected fb: FormBuilder, protected entityValue: T, - protected entitiesTableConfig: C) { + protected entitiesTableConfigValue: C) { super(store); this.entityForm = this.buildForm(this.entityValue); } diff --git a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts index 56712d9e3a..caa713cfb0 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts @@ -29,7 +29,6 @@ import { OnDestroy, OnInit, SimpleChanges, - Type, ViewChild, ViewContainerRef, ViewEncapsulation @@ -44,7 +43,8 @@ import { Widget, WidgetActionDescriptor, widgetActionSources, - WidgetActionType, WidgetComparisonSettings, + WidgetActionType, + WidgetComparisonSettings, WidgetResource, widgetType, WidgetTypeParameters @@ -90,27 +90,7 @@ import { DashboardService } from '@core/http/dashboard.service'; import { DatasourceService } from '@core/api/datasource.service'; import { WidgetSubscription } from '@core/api/widget-subscription'; import { EntityService } from '@core/http/entity.service'; -import { AssetService } from '@core/http/asset.service'; -import { DialogService } from '@core/services/dialog.service'; -import { CustomDialogService } from '@home/components/widget/dialog/custom-dialog.service'; -import { DatePipe } from '@angular/common'; -import { AttributeService } from '@core/http/attribute.service'; -import { TranslateService } from '@ngx-translate/core'; -import { HttpClient } from '@angular/common/http'; -import { EntityRelationService } from '@app/core/http/entity-relation.service'; - -const ServicesMap = new Map>(); -ServicesMap.set('deviceService', DeviceService); -ServicesMap.set('assetService', AssetService); -ServicesMap.set('attributeService', AttributeService); -ServicesMap.set('entityRelationService', EntityRelationService); -ServicesMap.set('entityService', EntityService); -ServicesMap.set('dialogs', DialogService); -ServicesMap.set('customDialog', CustomDialogService); -ServicesMap.set('date', DatePipe); -ServicesMap.set('utils', UtilsService); -ServicesMap.set('translate', TranslateService); -ServicesMap.set('http', HttpClient); +import { ServicesMap } from '@home/models/services.map'; @Component({ selector: 'tb-widget', diff --git a/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts b/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts index 3f27937eab..d8533dd98b 100644 --- a/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts +++ b/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts @@ -39,6 +39,7 @@ export type EntityByIdOperation> = (id: HasUUID) => Ob export type EntityIdOneWayOperation = (id: HasUUID) => Observable; export type EntityActionFunction> = (action: EntityAction) => boolean; export type CreateEntityOperation> = () => Observable; +export type EntityRowClickFunction> = (event: Event, entity: T) => boolean; export type CellContentFunction> = (entity: T, key: string) => string; export type CellTooltipFunction> = (entity: T, key: string) => string | undefined; @@ -147,12 +148,14 @@ export class EntityTableConfig, P extends PageLink = P entityTabsComponent: Type>; addDialogStyle = {}; defaultSortOrder: SortOrder = {property: 'createdTime', direction: Direction.ASC}; + displayPagination = true; + defaultPageSize = 10; columns: Array> = []; cellActionDescriptors: Array> = []; groupActionDescriptors: Array> = []; headerActionDescriptors: Array = []; addActionDescriptors: Array = []; - headerComponent: Type>; + headerComponent: Type>; addEntity: CreateEntityOperation = null; dataSource: (dataLoadedFunction: () => void) => EntitiesDataSource = (dataLoadedFunction: () => void) => { return new EntitiesDataSource(this.entitiesFetchFunction, this.entitySelectionEnabled, dataLoadedFunction); @@ -169,6 +172,7 @@ export class EntityTableConfig, P extends PageLink = P deleteEntity: EntityIdOneWayOperation = () => of(); entitiesFetchFunction: EntitiesFetchFunction = () => of(emptyPageData()); onEntityAction: EntityActionFunction = () => false; + handleRowClick: EntityRowClickFunction = () => false; entityTitle: EntityStringFunction = (entity) => entity?.name; } diff --git a/ui-ngx/src/app/modules/home/models/services.map.ts b/ui-ngx/src/app/modules/home/models/services.map.ts new file mode 100644 index 0000000000..2c786783e1 --- /dev/null +++ b/ui-ngx/src/app/modules/home/models/services.map.ts @@ -0,0 +1,44 @@ +/// +/// Copyright © 2016-2020 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { Type } from '@angular/core'; +import { DeviceService } from '@core/http/device.service'; +import { AssetService } from '@core/http/asset.service'; +import { AttributeService } from '@core/http/attribute.service'; +import { EntityRelationService } from '@core/http/entity-relation.service'; +import { EntityService } from '@core/http/entity.service'; +import { DialogService } from '@core/services/dialog.service'; +import { CustomDialogService } from '@home/components/widget/dialog/custom-dialog.service'; +import { DatePipe } from '@angular/common'; +import { UtilsService } from '@core/services/utils.service'; +import { TranslateService } from '@ngx-translate/core'; +import { HttpClient } from '@angular/common/http'; + +export const ServicesMap = new Map>( + [ + ['deviceService', DeviceService], + ['assetService', AssetService], + ['attributeService', AttributeService], + ['entityRelationService', EntityRelationService], + ['entityService', EntityService], + ['dialogs', DialogService], + ['customDialog', CustomDialogService], + ['date', DatePipe], + ['utils', UtilsService], + ['translate', TranslateService], + ['http', HttpClient] + ] +); diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts index 2dc444114a..5c3fd44a8e 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts @@ -40,9 +40,9 @@ export class AssetComponent extends EntityComponent { constructor(protected store: Store, protected translate: TranslateService, @Inject('entity') protected entityValue: AssetInfo, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } ngOnInit() { diff --git a/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts b/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts index 5581a33091..5d58d2be2c 100644 --- a/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts +++ b/ui-ngx/src/app/modules/home/pages/customer/customer.component.ts @@ -35,9 +35,9 @@ export class CustomerComponent extends ContactBasedComponent { constructor(protected store: Store, protected translate: TranslateService, @Inject('entity') protected entityValue: Customer, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, protected fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } hideDelete() { diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts index d089c4dd34..a84f335831 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts @@ -47,9 +47,9 @@ export class DashboardFormComponent extends EntityComponent { protected translate: TranslateService, private dashboardService: DashboardService, @Inject('entity') protected entityValue: Dashboard, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } ngOnInit() { diff --git a/ui-ngx/src/app/modules/home/pages/device/device.component.ts b/ui-ngx/src/app/modules/home/pages/device/device.component.ts index a064e17aef..d187c8bf0c 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device.component.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device.component.ts @@ -44,9 +44,9 @@ export class DeviceComponent extends EntityComponent { private deviceService: DeviceService, private clipboardService: ClipboardService, @Inject('entity') protected entityValue: DeviceInfo, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } ngOnInit() { diff --git a/ui-ngx/src/app/modules/home/pages/entity-view/entity-view.component.ts b/ui-ngx/src/app/modules/home/pages/entity-view/entity-view.component.ts index 642021e4d8..1a1895dada 100644 --- a/ui-ngx/src/app/modules/home/pages/entity-view/entity-view.component.ts +++ b/ui-ngx/src/app/modules/home/pages/entity-view/entity-view.component.ts @@ -52,9 +52,9 @@ export class EntityViewComponent extends EntityComponent { constructor(protected store: Store, protected translate: TranslateService, @Inject('entity') protected entityValue: EntityViewInfo, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } ngOnInit() { diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts index 559f8451a5..8cd88e548f 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts @@ -34,9 +34,9 @@ export class RuleChainComponent extends EntityComponent { constructor(protected store: Store, protected translate: TranslateService, @Inject('entity') protected entityValue: RuleChain, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } hideDelete() { diff --git a/ui-ngx/src/app/modules/home/pages/tenant/tenant.component.ts b/ui-ngx/src/app/modules/home/pages/tenant/tenant.component.ts index a89e753523..b2809b980d 100644 --- a/ui-ngx/src/app/modules/home/pages/tenant/tenant.component.ts +++ b/ui-ngx/src/app/modules/home/pages/tenant/tenant.component.ts @@ -34,9 +34,9 @@ export class TenantComponent extends ContactBasedComponent { constructor(protected store: Store, protected translate: TranslateService, @Inject('entity') protected entityValue: Tenant, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, protected fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } hideDelete() { diff --git a/ui-ngx/src/app/modules/home/pages/user/user.component.ts b/ui-ngx/src/app/modules/home/pages/user/user.component.ts index d9a32b3fb4..bb1b1d272e 100644 --- a/ui-ngx/src/app/modules/home/pages/user/user.component.ts +++ b/ui-ngx/src/app/modules/home/pages/user/user.component.ts @@ -42,9 +42,9 @@ export class UserComponent extends EntityComponent { constructor(protected store: Store, @Inject('entity') protected entityValue: User, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } hideDelete() { diff --git a/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle.component.ts b/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle.component.ts index 64f6be086a..1e70668556 100644 --- a/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle.component.ts +++ b/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle.component.ts @@ -31,9 +31,9 @@ export class WidgetsBundleComponent extends EntityComponent { constructor(protected store: Store, @Inject('entity') protected entityValue: WidgetsBundle, - @Inject('entitiesTableConfig') protected entitiesTableConfig: EntityTableConfig, + @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder) { - super(store, fb, entityValue, entitiesTableConfig); + super(store, fb, entityValue, entitiesTableConfigValue); } hideDelete() { diff --git a/ui-ngx/src/app/shared/models/page/page-link.ts b/ui-ngx/src/app/shared/models/page/page-link.ts index a883c7cdb3..ee0f2c8fda 100644 --- a/ui-ngx/src/app/shared/models/page/page-link.ts +++ b/ui-ngx/src/app/shared/models/page/page-link.ts @@ -19,6 +19,8 @@ import { emptyPageData, PageData } from '@shared/models/page/page-data'; import { getDescendantProp, isObject } from '@core/utils'; import { SortDirection } from '@angular/material/sort'; +export const MAX_SAFE_PAGE_SIZE = 2147483647; + export type PageLinkSearchFunction = (entity: T, textSearch: string) => boolean; const defaultPageLinkSearchFunction: PageLinkSearchFunction =