mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
[ACA-1078] next/prev navigation for the Viewer (#187)
* basic navigation through the folder * carousel mode for libraries * code polishing * save and restore sorting settings * get user sorting preferences into account * sorting fixes * full test coverage
This commit is contained in:
committed by
Cilibiu Bogdan
parent
34e322e9f6
commit
3cff48cac5
@@ -49,19 +49,25 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
private nodePath: PathElement[];
|
||||
private subscriptions: Subscription[] = [];
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private zone: NgZone,
|
||||
private route: ActivatedRoute,
|
||||
private nodesApi: NodesApiService,
|
||||
private nodeActionsService: NodeActionsService,
|
||||
private uploadService: UploadService,
|
||||
private contentManagementService: ContentManagementService,
|
||||
private browsingFilesService: BrowsingFilesService,
|
||||
private contentService: ContentService,
|
||||
private apiService: AlfrescoApiService,
|
||||
preferences: UserPreferencesService) {
|
||||
sorting = [ 'modifiedAt', 'desc' ];
|
||||
|
||||
constructor(private router: Router,
|
||||
private zone: NgZone,
|
||||
private route: ActivatedRoute,
|
||||
private nodesApi: NodesApiService,
|
||||
private nodeActionsService: NodeActionsService,
|
||||
private uploadService: UploadService,
|
||||
private contentManagementService: ContentManagementService,
|
||||
private browsingFilesService: BrowsingFilesService,
|
||||
private contentService: ContentService,
|
||||
private apiService: AlfrescoApiService,
|
||||
preferences: UserPreferencesService) {
|
||||
super(preferences);
|
||||
|
||||
const sortingKey = preferences.get('personal-files.sorting.key') || 'modifiedAt';
|
||||
const sortingDirection = preferences.get('personal-files.sorting.direction') || 'desc';
|
||||
|
||||
this.sorting = [sortingKey, sortingDirection];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -71,8 +77,8 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
this.routeData = data;
|
||||
this.title = data.i18nTitle;
|
||||
|
||||
route.params.subscribe(({ id }: Params) => {
|
||||
const nodeId = id || data.defaultNodeId;
|
||||
route.params.subscribe(({ folderId }: Params) => {
|
||||
const nodeId = folderId || data.defaultNodeId;
|
||||
this.isLoading = true;
|
||||
|
||||
this.fetchNode(nodeId)
|
||||
@@ -301,4 +307,9 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
onSortingChanged(event: CustomEvent) {
|
||||
this.preferences.set('personal-files.sorting.key', event.detail.key || 'modifiedAt');
|
||||
this.preferences.set('personal-files.sorting.direction', event.detail.direction || 'desc');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user