mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user