[ADF-1805] rebased documentlist pagination removal (#2668)

* [ADF-1805] rebased documentlist pagination removal

* [ADF-1805] fixed some wrong changes]
This commit is contained in:
Vito
2017-11-20 10:40:05 +00:00
committed by Popovics András
parent 0f0f22634a
commit 141bc0f8b4
12 changed files with 198 additions and 249 deletions

View File

@@ -16,7 +16,7 @@
*/
import { Component, EventEmitter, Inject, Input, OnInit, Optional, Output, ViewChild, ViewEncapsulation } from '@angular/core';
import { ContentService, HighlightDirective, SiteModel } from '@alfresco/adf-core';
import { ContentService, HighlightDirective, SiteModel, UserPreferencesService } from '@alfresco/adf-core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { MinimalNodeEntryEntity, NodePaging, Pagination } from 'alfresco-js-api';
import { DocumentListComponent, PaginationStrategy } from '../document-list/components/document-list.component';
@@ -52,6 +52,7 @@ export class ContentNodeSelectorComponent implements OnInit {
paginationStrategy: PaginationStrategy;
pagination: Pagination;
skipCount: number = 0;
infiniteScroll: boolean = false;
@Input()
title: string;
@@ -66,7 +67,7 @@ export class ContentNodeSelectorComponent implements OnInit {
imageResolver: ImageResolver = null;
@Input()
pageSize: number = 10;
pageSize: number;
@Output()
select: EventEmitter<MinimalNodeEntryEntity[]> = new EventEmitter<MinimalNodeEntryEntity[]>();
@@ -79,6 +80,7 @@ export class ContentNodeSelectorComponent implements OnInit {
constructor(private contentNodeSelectorService: ContentNodeSelectorService,
private contentService: ContentService,
private preferences: UserPreferencesService,
@Optional() @Inject(MAT_DIALOG_DATA) data?: ContentNodeSelectorComponentData,
@Optional() private containingDialog?: MatDialogRef<ContentNodeSelectorComponent>) {
if (data) {
@@ -92,6 +94,7 @@ export class ContentNodeSelectorComponent implements OnInit {
if (this.containingDialog) {
this.inDialog = true;
}
this.pageSize = this.preferences.paginationSize;
}
ngOnInit() {
@@ -180,6 +183,7 @@ export class ContentNodeSelectorComponent implements OnInit {
* @param event Pagination object
*/
getNextPageOfSearch(event: Pagination): void {
this.infiniteScroll = true;
this.skipCount = event.skipCount;
this.querySearch();
}
@@ -245,14 +249,17 @@ export class ContentNodeSelectorComponent implements OnInit {
* Sets showingSearchResults state to be able to differentiate between search results or folder results
*/
onFolderChange(): void {
this.skipCount = 0;
this.infiniteScroll = false;
this.showingSearchResults = false;
}
/**
* Attempts to set the currently loaded node
*/
onFolderLoaded(): void {
onFolderLoaded(nodePage: NodePaging): void {
this.attemptNodeSelection(this.documentList.folderNode);
this.pagination = nodePage.list.pagination;
}
/**