[ACA-1328] Use ADF Pagination in Personal Files and Libraries (#340)

This commit is contained in:
Cilibiu Bogdan
2018-04-30 17:14:52 +03:00
committed by Denys Vuika
parent e40b7f7489
commit 549abeb557
11 changed files with 114 additions and 297 deletions

View File

@@ -23,21 +23,13 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging, Pagination } from 'alfresco-js-api';
import { MinimalNodeEntity, MinimalNodeEntryEntity, Pagination } from 'alfresco-js-api';
import { UserPreferencesService } from '@alfresco/adf-core';
import { ShareDataRow } from '@alfresco/adf-content-services';
export abstract class PageComponent {
title = 'Page';
isLoading = false;
isEmpty = true;
infoDrawerOpened = false;
paging: NodePaging;
pagination: Pagination;
node: MinimalNodeEntryEntity;
static isLockedNode(node) {
@@ -49,25 +41,10 @@ export abstract class PageComponent {
constructor(protected preferences: UserPreferencesService) {
}
onFetchError(error: any) {
this.isLoading = false;
}
getParentNodeId(): string {
return this.node ? this.node.id : null;
}
onPaginationChange(pagination: any) {
this.fetchNodes(this.getParentNodeId(), pagination);
}
onPageLoaded(page: NodePaging) {
this.isLoading = false;
this.paging = page;
this.pagination = { ...page.list.pagination };
this.isEmpty = !(page.list.entries && page.list.entries.length > 0);
}
hasSelection(selection: Array<MinimalNodeEntity>): boolean {
return selection && selection.length > 0;
}