[ADF-2723] preventing document list to restart always from -my- folder (#3200)

* [ADF-2723] preventing document list to restart always from -my- folder

* [ADF-2723] fixed condition

* [ADF-2723] removed commented line
This commit is contained in:
Vito
2018-04-16 21:03:03 +01:00
committed by Eugenio Romano
parent 460e33ccdb
commit a6b8e16391
3 changed files with 21 additions and 4 deletions

View File

@@ -16,11 +16,11 @@
*/
import {
Component, Input, OnInit, OnChanges, OnDestroy,
Component, Input, OnInit, OnChanges, OnDestroy, Optional,
EventEmitter, ViewChild, SimpleChanges, Output
} from '@angular/core';
import { MatDialog } from '@angular/material';
import { Router } from '@angular/router';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, SiteEntry } from 'alfresco-js-api';
import {
AuthenticationService, AppConfigService, ContentService, TranslationService,
@@ -146,6 +146,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
permissionsStyle: PermissionStyleModel[] = [];
infiniteScrolling: boolean;
supportedPages: number[];
currentSiteid = '';
private onCreateFolder: Subscription;
private onEditFolder: Subscription;
@@ -159,6 +160,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
private logService: LogService,
private preference: UserPreferencesService,
private appConfig: AppConfigService,
@Optional() private route: ActivatedRoute,
public authenticationService: AuthenticationService) {
this.preference.select(UserPreferenceValues.SupportedPageSizes)
.subscribe((pages) => {
@@ -187,6 +189,14 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
};
}
if (this.route) {
this.route.params.forEach((params: Params) => {
if (params['id'] && this.currentFolderId !== params['id']) {
this.currentFolderId = params['id'];
}
});
}
// this.disableDragArea = false;
this.uploadService.fileUploadComplete.asObservable().debounceTime(300).subscribe(value => this.onFileUploadEvent(value));
this.uploadService.fileUploadDeleted.subscribe((value) => this.onFileUploadEvent(value));
@@ -262,6 +272,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
}
onFolderChange($event) {
this.router.navigate(['/files', $event.value.id]);
}
handlePermissionError(event: any) {
this.translateService.get('PERMISSON.LACKOF', {
permission: event.permission,
@@ -281,7 +295,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
emitReadyEvent(event: NodePaging) {
this.documentListReady.emit(event);
this.router.navigate(['/files', event.list.source.id]);
}
pageIsEmpty(node: NodePaging) {