fix static default pagination (#4288)

This commit is contained in:
Eugenio Romano
2019-02-08 01:58:06 +00:00
committed by GitHub
parent 8fa335aced
commit d884c1099b
4 changed files with 15 additions and 10 deletions

View File

@@ -16,7 +16,13 @@
*/
import { Component, EventEmitter, Input, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core';
import { HighlightDirective, UserPreferencesService, PaginationModel, UserPreferenceValues, InfinitePaginationComponent } from '@alfresco/adf-core';
import {
HighlightDirective,
UserPreferencesService,
PaginationModel,
UserPreferenceValues,
InfinitePaginationComponent
} from '@alfresco/adf-core';
import { FormControl } from '@angular/forms';
import { Node, NodePaging, Pagination, SiteEntry, SitePaging } from '@alfresco/js-api';
import { DocumentListComponent } from '../document-list/components/document-list.component';
@@ -40,7 +46,7 @@ const defaultValidation = () => true;
})
export class ContentNodeSelectorPanelComponent implements OnInit {
static DEFAULT_PAGINATION: Pagination = new Pagination({
DEFAULT_PAGINATION: Pagination = new Pagination({
maxItems: 25,
skipCount: 0,
totalItems: 0,
@@ -111,7 +117,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
/** Number of items shown per page in the list. */
@Input()
pageSize: number = ContentNodeSelectorPanelComponent.DEFAULT_PAGINATION.maxItems;
pageSize: number = this.DEFAULT_PAGINATION.maxItems;
/** Function used to decide if the selected node has permission to be selected.
* Default value is a function that always returns true.
@@ -146,7 +152,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
_chosenNode: Node = null;
folderIdToShow: string | null = null;
pagination: PaginationModel = ContentNodeSelectorPanelComponent.DEFAULT_PAGINATION;
pagination: PaginationModel = this.DEFAULT_PAGINATION;
@ViewChild(InfinitePaginationComponent)
infinitePaginationComponent: InfinitePaginationComponent;

View File

@@ -70,7 +70,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
static SINGLE_CLICK_NAVIGATION: string = 'click';
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
static DEFAULT_PAGINATION: Pagination = new Pagination({
DEFAULT_PAGINATION: Pagination = new Pagination({
hasMoreItems: false,
skipCount: 0,
maxItems: 25,
@@ -248,7 +248,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
/** Default value is stored into user preference settings use it only if you are not using the pagination */
@Input()
maxItems: number = DocumentListComponent.DEFAULT_PAGINATION.maxItems;
maxItems: number = this.DEFAULT_PAGINATION.maxItems;
/** Emitted when the user clicks a list node */
@Output()
@@ -290,8 +290,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
// @deprecated 3.0.0
folderNode: Node;
private _pagination: PaginationModel = DocumentListComponent.DEFAULT_PAGINATION;
pagination: BehaviorSubject<PaginationModel> = new BehaviorSubject<PaginationModel>(DocumentListComponent.DEFAULT_PAGINATION);
private _pagination: PaginationModel = this.DEFAULT_PAGINATION;
pagination: BehaviorSubject<PaginationModel> = new BehaviorSubject<PaginationModel>(this.DEFAULT_PAGINATION);
private layoutPresets = {};
private subscriptions: Subscription[] = [];

View File

@@ -425,7 +425,6 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.12em;
}
/* query for Microsoft IE 11*/

View File

@@ -70,7 +70,7 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
ngOnInit() {
if (this.target) {
this.paginationSubscription = this.target.pagination.subscribe((pagination) => {
this.paginationSubscription = this.target.pagination.subscribe((pagination: PaginationModel) => {
this.isLoading = false;
this.pagination = pagination;