mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2444] supportedPageSize is used only via input parameter (#3087)
* [ADF-2444] supportedPageSize is used only via input parameter * [ADF-2444] removed white space * [ADF-2444] added deprecation to supportedPageSize attribute of paginated interface
This commit is contained in:
@@ -33,7 +33,7 @@ import {
|
||||
AuthenticationService, ContentService, TranslationService,
|
||||
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
|
||||
UploadService, DataColumn, DataRow, UserPreferencesService,
|
||||
PaginationComponent, FormValues, DisplayMode
|
||||
PaginationComponent, FormValues, DisplayMode, UserPreferenceValues
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import { DocumentListComponent, PermissionStyleModel } from '@alfresco/adf-content-services';
|
||||
@@ -159,6 +159,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
private preference: UserPreferencesService,
|
||||
@Optional() private route: ActivatedRoute,
|
||||
public authenticationService: AuthenticationService) {
|
||||
this.preference.select(UserPreferenceValues.SupportedPageSizes)
|
||||
.subscribe((pages) => {
|
||||
this.supportedPages = pages;
|
||||
});
|
||||
}
|
||||
|
||||
showFile(event) {
|
||||
@@ -205,7 +209,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.contentService.folderCreated.subscribe(value => this.onFolderCreated(value));
|
||||
this.onCreateFolder = this.contentService.folderCreate.subscribe(value => this.onFolderAction(value));
|
||||
this.onEditFolder = this.contentService.folderEdit.subscribe(value => this.onFolderAction(value));
|
||||
this.supportedPages = this.preference.getDefaultPageSizes();
|
||||
this.supportedPages = this.supportedPages ? this.supportedPages : this.preference.getDefaultPageSizes();
|
||||
|
||||
// this.permissionsStyle.push(new PermissionStyleModel('document-list__create', PermissionsEnum.CREATE));
|
||||
// this.permissionsStyle.push(new PermissionStyleModel('document-list__disable', PermissionsEnum.NOT_CREATE, false, true));
|
||||
|
@@ -22,6 +22,10 @@ import { PaginationQueryParams } from './pagination-query-params.interface';
|
||||
|
||||
export interface PaginatedComponent {
|
||||
pagination: BehaviorSubject<Pagination>;
|
||||
/**
|
||||
* @deprecated : the supported page size should be retrieved via the user preferences
|
||||
* and given to the pagination component, and not retrieved by the paginated object
|
||||
*/
|
||||
supportedPageSizes: number[];
|
||||
updatePagination(params: PaginationQueryParams);
|
||||
}
|
||||
|
@@ -95,7 +95,6 @@ export class PaginationComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
if (this.target) {
|
||||
this.supportedPageSizes = this.target.supportedPageSizes;
|
||||
this.paginationSubscription = this.target.pagination.subscribe(page => {
|
||||
this.pagination = page;
|
||||
this.cdr.detectChanges();
|
||||
|
Reference in New Issue
Block a user