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:
@@ -192,6 +192,7 @@
|
|||||||
(success)="resetError()"
|
(success)="resetError()"
|
||||||
(ready)="emitReadyEvent($event)"
|
(ready)="emitReadyEvent($event)"
|
||||||
(preview)="showFile($event)"
|
(preview)="showFile($event)"
|
||||||
|
(folderChange)="onFolderChange($event)"
|
||||||
(permissionError)="handlePermissionError($event)">
|
(permissionError)="handlePermissionError($event)">
|
||||||
<empty-folder-content *ngIf="disableDragArea">
|
<empty-folder-content *ngIf="disableDragArea">
|
||||||
<ng-template>
|
<ng-template>
|
||||||
|
@@ -16,11 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Component, Input, OnInit, OnChanges, OnDestroy,
|
Component, Input, OnInit, OnChanges, OnDestroy, Optional,
|
||||||
EventEmitter, ViewChild, SimpleChanges, Output
|
EventEmitter, ViewChild, SimpleChanges, Output
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material';
|
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 { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, SiteEntry } from 'alfresco-js-api';
|
||||||
import {
|
import {
|
||||||
AuthenticationService, AppConfigService, ContentService, TranslationService,
|
AuthenticationService, AppConfigService, ContentService, TranslationService,
|
||||||
@@ -146,6 +146,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
permissionsStyle: PermissionStyleModel[] = [];
|
permissionsStyle: PermissionStyleModel[] = [];
|
||||||
infiniteScrolling: boolean;
|
infiniteScrolling: boolean;
|
||||||
supportedPages: number[];
|
supportedPages: number[];
|
||||||
|
currentSiteid = '';
|
||||||
|
|
||||||
private onCreateFolder: Subscription;
|
private onCreateFolder: Subscription;
|
||||||
private onEditFolder: Subscription;
|
private onEditFolder: Subscription;
|
||||||
@@ -159,6 +160,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
private preference: UserPreferencesService,
|
private preference: UserPreferencesService,
|
||||||
private appConfig: AppConfigService,
|
private appConfig: AppConfigService,
|
||||||
|
@Optional() private route: ActivatedRoute,
|
||||||
public authenticationService: AuthenticationService) {
|
public authenticationService: AuthenticationService) {
|
||||||
this.preference.select(UserPreferenceValues.SupportedPageSizes)
|
this.preference.select(UserPreferenceValues.SupportedPageSizes)
|
||||||
.subscribe((pages) => {
|
.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.disableDragArea = false;
|
||||||
this.uploadService.fileUploadComplete.asObservable().debounceTime(300).subscribe(value => this.onFileUploadEvent(value));
|
this.uploadService.fileUploadComplete.asObservable().debounceTime(300).subscribe(value => this.onFileUploadEvent(value));
|
||||||
this.uploadService.fileUploadDeleted.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) {
|
handlePermissionError(event: any) {
|
||||||
this.translateService.get('PERMISSON.LACKOF', {
|
this.translateService.get('PERMISSON.LACKOF', {
|
||||||
permission: event.permission,
|
permission: event.permission,
|
||||||
@@ -281,7 +295,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
|
|
||||||
emitReadyEvent(event: NodePaging) {
|
emitReadyEvent(event: NodePaging) {
|
||||||
this.documentListReady.emit(event);
|
this.documentListReady.emit(event);
|
||||||
this.router.navigate(['/files', event.list.source.id]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pageIsEmpty(node: NodePaging) {
|
pageIsEmpty(node: NodePaging) {
|
||||||
|
@@ -373,7 +373,9 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
|||||||
this.currentFolderId = changes.folderNode.currentValue.id;
|
this.currentFolderId = changes.folderNode.currentValue.id;
|
||||||
this.resetNewFolderPagination();
|
this.resetNewFolderPagination();
|
||||||
this.loadFolder();
|
this.loadFolder();
|
||||||
} else if (changes.currentFolderId && changes.currentFolderId.currentValue) {
|
} else if (changes.currentFolderId &&
|
||||||
|
changes.currentFolderId.currentValue &&
|
||||||
|
changes.currentFolderId.currentValue !== changes.currentFolderId.previousValue) {
|
||||||
this.resetNewFolderPagination();
|
this.resetNewFolderPagination();
|
||||||
this.loadFolder();
|
this.loadFolder();
|
||||||
} else if (this.data) {
|
} else if (this.data) {
|
||||||
@@ -740,6 +742,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
|||||||
this.currentFolderId = nodeId;
|
this.currentFolderId = nodeId;
|
||||||
this.resetNewFolderPagination();
|
this.resetNewFolderPagination();
|
||||||
this.loadFolder();
|
this.loadFolder();
|
||||||
|
this.folderChange.emit(new NodeEntryEvent({id: nodeId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private resetNewFolderPagination() {
|
private resetNewFolderPagination() {
|
||||||
|
Reference in New Issue
Block a user