mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2391] skipCount is not reset on document-list when choosing a custom source from adf-sites-dropdown, nor the currentFolderId and folderNode (#3012)
* [ADF-2391] skipCount is not reset on document-list when choosing a custom source from adf-sites-dropdown, nor the currentFolderId and folderNode fix and tests added * [ADF-2391] refactor code & took into account merge parameter
This commit is contained in:
committed by
Eugenio Romano
parent
f41498658b
commit
0a748ac555
@@ -468,6 +468,14 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
this.folderChange.emit(new NodeEntryEvent(node.entry));
|
||||
}
|
||||
|
||||
updateCustomSourceData(nodeId: string, merge: boolean): void {
|
||||
this.folderNode = null;
|
||||
this.currentFolderId = nodeId;
|
||||
if (!merge) {
|
||||
this.skipCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked when executing content action for a document or folder.
|
||||
* @param node Node to be the context of the execution.
|
||||
@@ -589,6 +597,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
|
||||
private loadTrashcan(merge: boolean = false): void {
|
||||
this.updateCustomSourceData('-trashcan-', merge);
|
||||
|
||||
const options = {
|
||||
include: ['path', 'properties'],
|
||||
maxItems: this.maxItems,
|
||||
@@ -600,6 +610,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
|
||||
private loadSharedLinks(merge: boolean = false): void {
|
||||
this.updateCustomSourceData('-sharedlinks-', merge);
|
||||
|
||||
const options = {
|
||||
include: ['properties', 'allowableOperations', 'path'],
|
||||
maxItems: this.maxItems,
|
||||
@@ -611,6 +623,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
|
||||
private loadSites(merge: boolean = false): void {
|
||||
this.updateCustomSourceData('-sites-', merge);
|
||||
|
||||
const options = {
|
||||
include: ['properties'],
|
||||
maxItems: this.maxItems,
|
||||
@@ -631,6 +645,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
|
||||
private loadMemberSites(merge: boolean = false): void {
|
||||
this.updateCustomSourceData('-mysites-', merge);
|
||||
|
||||
const options = {
|
||||
include: ['properties'],
|
||||
maxItems: this.maxItems,
|
||||
@@ -659,6 +675,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
|
||||
private loadFavorites(merge: boolean = false): void {
|
||||
this.updateCustomSourceData('-favorites-', merge);
|
||||
|
||||
const options = {
|
||||
maxItems: this.maxItems,
|
||||
skipCount: this.skipCount,
|
||||
@@ -690,6 +708,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
|
||||
private loadRecent(merge: boolean = false): void {
|
||||
this.updateCustomSourceData('-recent-', merge);
|
||||
|
||||
this.getRecentFiles('-me-')
|
||||
.then((page: NodePaging) => this.onPageLoaded(page, merge))
|
||||
.catch(error => this.error.emit(error));
|
||||
|
Reference in New Issue
Block a user