mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-1328] Use ADF Pagination in Personal Files and Libraries (#340)
This commit is contained in:
committed by
Denys Vuika
parent
e40b7f7489
commit
549abeb557
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user