mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-1301] Document List - page sizes (#299)
* pagination sizes * retire documentList supportedPageSizes * fix tests
This commit is contained in:
parent
10818633c5
commit
abf34a6b48
@ -7,6 +7,7 @@
|
||||
"headerColor": "#2196F3",
|
||||
"languagePicker": false,
|
||||
"pagination": {
|
||||
"size": 25,
|
||||
"supportedPageSizes": [
|
||||
25,
|
||||
50,
|
||||
|
@ -42,6 +42,7 @@ export class AppComponent implements OnInit {
|
||||
config: AppConfigService) {
|
||||
// TODO: remove once ADF 2.3.0 is out (needs bug fixes)
|
||||
preferences.defaults.supportedPageSizes = config.get('pagination.supportedPageSizes');
|
||||
preferences.defaults.paginationSize = config.get('pagination.size');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -59,6 +59,7 @@ import { NodePermanentDeleteDirective } from './common/directives/node-permanent
|
||||
import { NodeUnshareDirective } from './common/directives/node-unshare.directive';
|
||||
import { NodeInfoDirective } from './common/directives/node-info.directive';
|
||||
import { NodeVersionsDirective } from './common/directives/node-versions.directive';
|
||||
import { AppConfigPipe } from './common/pipes/app-config.pipe';
|
||||
import { VersionManagerDialogAdapterComponent } from './components/versions-dialog/version-manager-dialog-adapter.component';
|
||||
import { BrowsingFilesService } from './common/services/browsing-files.service';
|
||||
import { ContentManagementService } from './common/services/content-management.service';
|
||||
@ -112,6 +113,7 @@ import { SearchComponent } from './components/search/search.component';
|
||||
NodeUnshareDirective,
|
||||
NodeInfoDirective,
|
||||
NodeVersionsDirective,
|
||||
AppConfigPipe,
|
||||
VersionManagerDialogAdapterComponent,
|
||||
SearchComponent
|
||||
],
|
||||
|
39
src/app/common/pipes/app-config.pipe.ts
Normal file
39
src/app/common/pipes/app-config.pipe.ts
Normal file
@ -0,0 +1,39 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 Alfresco Software Limited
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
|
||||
@Pipe({
|
||||
name: 'appConfig',
|
||||
pure: true
|
||||
})
|
||||
export class AppConfigPipe implements PipeTransform {
|
||||
constructor(private config: AppConfigService) {}
|
||||
|
||||
transform(value: string, fallback: any): any {
|
||||
return this.config.get(value, fallback);
|
||||
}
|
||||
}
|
@ -171,6 +171,7 @@
|
||||
|
||||
<ng-container *ngIf="!documentList.isEmpty()">
|
||||
<adf-pagination
|
||||
[supportedPageSizes]="'pagination.supportedPageSizes' | appConfig"
|
||||
[target]="documentList"
|
||||
(changePageSize)="onChangePageSize($event)">
|
||||
</adf-pagination>
|
||||
|
@ -46,6 +46,7 @@ import { DocumentListService } from '@alfresco/adf-content-services';
|
||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||
import { NodeInfoDirective } from '../../common/directives/node-info.directive';
|
||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
||||
|
||||
import { FavoritesComponent } from './favorites.component';
|
||||
|
||||
@ -105,7 +106,8 @@ describe('Favorites Routed Component', () => {
|
||||
NodeFavoriteDirective,
|
||||
NodeInfoDirective,
|
||||
DocumentListComponent,
|
||||
FavoritesComponent
|
||||
FavoritesComponent,
|
||||
AppConfigPipe
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: {
|
||||
|
@ -172,7 +172,7 @@
|
||||
|
||||
<ng-container *ngIf="!isEmpty">
|
||||
<adf-pagination
|
||||
[supportedPageSizes]="documentList.supportedPageSizes"
|
||||
[supportedPageSizes]="'pagination.supportedPageSizes' | appConfig"
|
||||
[pagination]="pagination"
|
||||
(change)="load(true, $event)"
|
||||
(changePageSize)="onChangePageSize($event)">
|
||||
|
@ -47,6 +47,7 @@ import { BrowsingFilesService } from '../../common/services/browsing-files.servi
|
||||
import { NodeActionsService } from '../../common/services/node-actions.service';
|
||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||
import { NodeInfoDirective } from '../../common/directives/node-info.directive';
|
||||
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
||||
|
||||
import { FilesComponent } from './files.component';
|
||||
|
||||
@ -84,7 +85,8 @@ describe('FilesComponent', () => {
|
||||
NodeFavoriteDirective,
|
||||
NodeInfoDirective,
|
||||
DocumentListComponent,
|
||||
FileSizePipe
|
||||
FileSizePipe,
|
||||
AppConfigPipe
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: {
|
||||
|
@ -68,6 +68,7 @@
|
||||
|
||||
<ng-container *ngIf="!documentList.isEmpty()">
|
||||
<adf-pagination
|
||||
[supportedPageSizes]="'pagination.supportedPageSizes' | appConfig"
|
||||
[target]="documentList"
|
||||
(changePageSize)="onChangePageSize($event)">
|
||||
</adf-pagination>
|
||||
|
@ -42,6 +42,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { MatMenuModule, MatSnackBarModule, MatIconModule } from '@angular/material';
|
||||
import { DocumentListService } from '@alfresco/adf-content-services';
|
||||
import { ShareDataTableAdapter } from '@alfresco/adf-content-services';
|
||||
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
||||
|
||||
import { LibrariesComponent } from './libraries.component';
|
||||
|
||||
@ -87,7 +88,8 @@ describe('Libraries Routed Component', () => {
|
||||
NodeNameTooltipPipe,
|
||||
NodeFavoriteDirective,
|
||||
DocumentListComponent,
|
||||
LibrariesComponent
|
||||
LibrariesComponent,
|
||||
AppConfigPipe
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: {
|
||||
|
@ -159,6 +159,7 @@
|
||||
|
||||
<ng-container *ngIf="!documentList.isEmpty()">
|
||||
<adf-pagination
|
||||
[supportedPageSizes]="'pagination.supportedPageSizes' | appConfig"
|
||||
[target]="documentList"
|
||||
(changePageSize)="onChangePageSize($event)">
|
||||
</adf-pagination>
|
||||
|
@ -42,6 +42,7 @@ import { MatMenuModule, MatSnackBarModule, MatIconModule } from '@angular/materi
|
||||
import { DocumentListService } from '@alfresco/adf-content-services';
|
||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||
import { NodeInfoDirective } from '../../common/directives/node-info.directive';
|
||||
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
||||
|
||||
import { RecentFilesComponent } from './recent-files.component';
|
||||
|
||||
@ -83,7 +84,8 @@ describe('RecentFiles Routed Component', () => {
|
||||
NodeFavoriteDirective,
|
||||
NodeInfoDirective,
|
||||
DocumentListComponent,
|
||||
RecentFilesComponent
|
||||
RecentFilesComponent,
|
||||
AppConfigPipe
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: {
|
||||
|
@ -176,6 +176,7 @@
|
||||
|
||||
<ng-container *ngIf="!documentList.isEmpty()">
|
||||
<adf-pagination
|
||||
[supportedPageSizes]="'pagination.supportedPageSizes' | appConfig"
|
||||
[target]="documentList"
|
||||
(changePageSize)="onChangePageSize($event)">
|
||||
</adf-pagination>
|
||||
|
@ -43,6 +43,7 @@ import { DocumentListService } from '@alfresco/adf-content-services';
|
||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||
import { NodeInfoDirective } from '../../common/directives/node-info.directive';
|
||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
||||
|
||||
import { SharedFilesComponent } from './shared-files.component';
|
||||
|
||||
@ -83,7 +84,8 @@ describe('SharedFilesComponent', () => {
|
||||
NodeFavoriteDirective,
|
||||
NodeInfoDirective,
|
||||
DocumentListComponent,
|
||||
SharedFilesComponent
|
||||
SharedFilesComponent,
|
||||
AppConfigPipe
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: {
|
||||
|
@ -100,6 +100,7 @@
|
||||
|
||||
<ng-container *ngIf="!documentList.isEmpty()">
|
||||
<adf-pagination
|
||||
[supportedPageSizes]="'pagination.supportedPageSizes' | appConfig"
|
||||
[target]="documentList"
|
||||
(changePageSize)="onChangePageSize($event)">
|
||||
</adf-pagination>
|
||||
|
@ -42,6 +42,7 @@ import { MatMenuModule, MatSnackBarModule, MatIconModule } from '@angular/materi
|
||||
import { DocumentListService } from '@alfresco/adf-content-services';
|
||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||
import { NodeInfoDirective } from '../../common/directives/node-info.directive';
|
||||
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
||||
|
||||
import { TrashcanComponent } from './trashcan.component';
|
||||
|
||||
@ -79,7 +80,8 @@ describe('TrashcanComponent', () => {
|
||||
NodeFavoriteDirective,
|
||||
NodeInfoDirective,
|
||||
DocumentListComponent,
|
||||
TrashcanComponent
|
||||
TrashcanComponent,
|
||||
AppConfigPipe
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user