diff --git a/src/app/components/favorites/favorites.component.html b/src/app/components/favorites/favorites.component.html index 39df9ec91..aaf50b5cb 100644 --- a/src/app/components/favorites/favorites.component.html +++ b/src/app/components/favorites/favorites.component.html @@ -141,6 +141,9 @@ - + + diff --git a/src/app/components/favorites/favorites.component.ts b/src/app/components/favorites/favorites.component.ts index 90f35f0a4..6216a8e3a 100644 --- a/src/app/components/favorites/favorites.component.ts +++ b/src/app/components/favorites/favorites.component.ts @@ -20,7 +20,7 @@ import { Router } from '@angular/router'; import { Subscription } from 'rxjs/Rx'; import { MinimalNodeEntryEntity, MinimalNodeEntity, PathElementEntity, PathInfo } from 'alfresco-js-api'; -import { ContentService, NodesApiService } from '@alfresco/adf-core'; +import { ContentService, NodesApiService, UserPreferencesService } from '@alfresco/adf-core'; import { DocumentListComponent } from '@alfresco/adf-content-services'; import { ContentManagementService } from '../../common/services/content-management.service'; @@ -40,8 +40,9 @@ export class FavoritesComponent extends PageComponent implements OnInit, OnDestr private router: Router, private nodesApi: NodesApiService, private contentService: ContentService, - private content: ContentManagementService) { - super(); + private content: ContentManagementService, + preferences: UserPreferencesService) { + super(preferences); } ngOnInit() { diff --git a/src/app/components/files/files.component.html b/src/app/components/files/files.component.html index fd696572a..b2b693d66 100644 --- a/src/app/components/files/files.component.html +++ b/src/app/components/files/files.component.html @@ -143,8 +143,10 @@ + (change)="load(true, $event)" + (changePageSize)="onChangePageSize($event)"> diff --git a/src/app/components/files/files.component.ts b/src/app/components/files/files.component.ts index 5946bc86a..7b8847f02 100644 --- a/src/app/components/files/files.component.ts +++ b/src/app/components/files/files.component.ts @@ -19,7 +19,10 @@ import { Observable, Subscription } from 'rxjs/Rx'; import { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core'; import { Router, ActivatedRoute, Params } from '@angular/router'; import { MinimalNodeEntity, MinimalNodeEntryEntity, PathElementEntity, NodePaging, PathElement } from 'alfresco-js-api'; -import { UploadService, FileUploadEvent, NodesApiService, ContentService, AlfrescoApiService } from '@alfresco/adf-core'; +import { + UploadService, FileUploadEvent, NodesApiService, + ContentService, AlfrescoApiService, UserPreferencesService +} from '@alfresco/adf-core'; import { BrowsingFilesService } from '../../common/services/browsing-files.service'; import { ContentManagementService } from '../../common/services/content-management.service'; @@ -47,8 +50,9 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy { private contentManagementService: ContentManagementService, private browsingFilesService: BrowsingFilesService, private contentService: ContentService, - private apiService: AlfrescoApiService) { - super(); + private apiService: AlfrescoApiService, + preferences: UserPreferencesService) { + super(preferences); } ngOnInit() { diff --git a/src/app/components/libraries/libraries.component.html b/src/app/components/libraries/libraries.component.html index 72d3ffe9d..076fb6d81 100644 --- a/src/app/components/libraries/libraries.component.html +++ b/src/app/components/libraries/libraries.component.html @@ -64,6 +64,9 @@ - + + diff --git a/src/app/components/libraries/libraries.component.ts b/src/app/components/libraries/libraries.component.ts index ccf5a111a..e6b141bc5 100644 --- a/src/app/components/libraries/libraries.component.ts +++ b/src/app/components/libraries/libraries.component.ts @@ -17,7 +17,7 @@ import { Component, ViewChild } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; -import { NodesApiService } from '@alfresco/adf-core'; +import { NodesApiService, UserPreferencesService } from '@alfresco/adf-core'; import { DocumentListComponent, ShareDataRow } from '@alfresco/adf-content-services'; import { PageComponent } from '../page.component'; @@ -33,8 +33,9 @@ export class LibrariesComponent extends PageComponent { constructor( private nodesApi: NodesApiService, private route: ActivatedRoute, - private router: Router) { - super(); + private router: Router, + preferences: UserPreferencesService) { + super(preferences); } makeLibraryTooltip(library: any): string { diff --git a/src/app/components/page.component.spec.ts b/src/app/components/page.component.spec.ts index fa45ed439..f8f922dff 100644 --- a/src/app/components/page.component.spec.ts +++ b/src/app/components/page.component.spec.ts @@ -23,7 +23,7 @@ class TestClass extends PageComponent { node: any; constructor() { - super(); + super(null); } fetchNodes(parentNodeId?: string, options?: any) { diff --git a/src/app/components/page.component.ts b/src/app/components/page.component.ts index 133ae97c7..5b19a8f1d 100644 --- a/src/app/components/page.component.ts +++ b/src/app/components/page.component.ts @@ -16,6 +16,7 @@ */ import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging, Pagination } from 'alfresco-js-api'; +import { UserPreferencesService } from '@alfresco/adf-core'; export abstract class PageComponent { @@ -31,6 +32,9 @@ export abstract class PageComponent { abstract fetchNodes(parentNodeId?: string, options?: any): void; + constructor(private preferences: UserPreferencesService) { + } + onFetchError(error: any) { this.isLoading = false; } @@ -121,4 +125,8 @@ export abstract class PageComponent { return false; } + + onChangePageSize(event: Pagination): void { + this.preferences.paginationSize = event.maxItems; + } } diff --git a/src/app/components/recent-files/recent-files.component.html b/src/app/components/recent-files/recent-files.component.html index f6f64625d..e6373f5a3 100644 --- a/src/app/components/recent-files/recent-files.component.html +++ b/src/app/components/recent-files/recent-files.component.html @@ -130,6 +130,9 @@ - + + diff --git a/src/app/components/recent-files/recent-files.component.ts b/src/app/components/recent-files/recent-files.component.ts index 6a32a6d6c..4444fe829 100644 --- a/src/app/components/recent-files/recent-files.component.ts +++ b/src/app/components/recent-files/recent-files.component.ts @@ -19,6 +19,7 @@ import { Subscription } from 'rxjs/Rx'; import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { MinimalNodeEntryEntity } from 'alfresco-js-api'; +import { UserPreferencesService } from '@alfresco/adf-core'; import { DocumentListComponent } from '@alfresco/adf-content-services'; import { ContentManagementService } from '../../common/services/content-management.service'; @@ -36,8 +37,9 @@ export class RecentFilesComponent extends PageComponent implements OnInit, OnDes constructor( private router: Router, - private content: ContentManagementService) { - super(); + private content: ContentManagementService, + preferences: UserPreferencesService) { + super(preferences); } ngOnInit() { diff --git a/src/app/components/shared-files/shared-files.component.html b/src/app/components/shared-files/shared-files.component.html index 662bd616e..898f606ba 100644 --- a/src/app/components/shared-files/shared-files.component.html +++ b/src/app/components/shared-files/shared-files.component.html @@ -138,6 +138,9 @@ - + + diff --git a/src/app/components/shared-files/shared-files.component.ts b/src/app/components/shared-files/shared-files.component.ts index 129c885e7..47079bb0e 100644 --- a/src/app/components/shared-files/shared-files.component.ts +++ b/src/app/components/shared-files/shared-files.component.ts @@ -19,7 +19,7 @@ import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { Subscription } from 'rxjs/Rx'; import { MinimalNodeEntity } from 'alfresco-js-api'; -import { AlfrescoApiService } from '@alfresco/adf-core'; +import { AlfrescoApiService, UserPreferencesService } from '@alfresco/adf-core'; import { DocumentListComponent } from '@alfresco/adf-content-services'; import { ContentManagementService } from '../../common/services/content-management.service'; @@ -38,8 +38,9 @@ export class SharedFilesComponent extends PageComponent implements OnInit, OnDes constructor( private router: Router, private content: ContentManagementService, - private apiService: AlfrescoApiService) { - super(); + private apiService: AlfrescoApiService, + preferences: UserPreferencesService) { + super(preferences); } ngOnInit() { diff --git a/src/app/components/trashcan/trashcan.component.html b/src/app/components/trashcan/trashcan.component.html index e91fc0bac..3ac971eea 100644 --- a/src/app/components/trashcan/trashcan.component.html +++ b/src/app/components/trashcan/trashcan.component.html @@ -94,6 +94,9 @@ - + + diff --git a/src/app/components/trashcan/trashcan.component.ts b/src/app/components/trashcan/trashcan.component.ts index 9dc0040b1..1301e41d9 100644 --- a/src/app/components/trashcan/trashcan.component.ts +++ b/src/app/components/trashcan/trashcan.component.ts @@ -17,7 +17,8 @@ import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core'; import { Subscription } from 'rxjs/Rx'; - +import { Pagination } from 'alfresco-js-api'; +import { UserPreferencesService } from '@alfresco/adf-core'; import { DocumentListComponent } from '@alfresco/adf-content-services'; import { ContentManagementService } from '../../common/services/content-management.service'; @@ -29,7 +30,9 @@ export class TrashcanComponent implements OnInit, OnDestroy { @ViewChild(DocumentListComponent) documentList; - constructor(private contentManagementService: ContentManagementService) {} + constructor( + private contentManagementService: ContentManagementService, + private preferences: UserPreferencesService) {} ngOnInit() { this.subscriptions.push(this.contentManagementService.restoreNode.subscribe(() => this.refresh())); @@ -43,4 +46,8 @@ export class TrashcanComponent implements OnInit, OnDestroy { ngOnDestroy() { this.subscriptions.forEach(s => s.unsubscribe()); } + + onChangePageSize(event: Pagination): void { + this.preferences.paginationSize = event.maxItems; + } }