reload active doclist via NgRx actions (#978)

* doclist reload action and effect

* deprecate folderEdited event

* deprecate "favoriteToggle" event

* deprecate "favoriteRemoved" event

* update docs

* unified reload function

* deprecate "nodesRestored" event

* deprecate "nodesPurged" event

* test fixes

* deprecate "nodesMoved" event

* reduce the use of "nodesDeleted"
This commit is contained in:
Denys Vuika
2019-02-27 13:45:55 +00:00
committed by GitHub
parent 0b5555d2fc
commit a25385049d
18 changed files with 89 additions and 289 deletions

View File

@@ -73,7 +73,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
ngOnInit() {
super.ngOnInit();
const { route, content, nodeActionsService, uploadService } = this;
const { route, nodeActionsService, uploadService } = this;
const { data } = route.snapshot;
this.title = data.title;
@@ -101,11 +101,6 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
nodeActionsService.contentCopied.subscribe(nodes =>
this.onContentCopied(nodes)
),
content.folderCreated.subscribe(() => this.documentList.reload()),
content.folderEdited.subscribe(() => this.documentList.reload()),
content.nodesDeleted.subscribe(() => this.documentList.reload()),
content.nodesMoved.subscribe(() => this.documentList.reload()),
content.nodesRestored.subscribe(() => this.documentList.reload()),
uploadService.fileUploadComplete
.pipe(debounceTime(300))
.subscribe(file => this.onFileUploadedEvent(file)),
@@ -178,7 +173,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
// check root and child nodes
if (node && node.entry && node.entry.parentId === this.getParentNodeId()) {
this.documentList.reload();
this.reload();
return;
}
@@ -215,7 +210,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
if (alreadyDisplayedParentFolder) {
return;
}
this.documentList.reload();
this.reload();
}
onContentCopied(nodes: MinimalNodeEntity[]) {
@@ -225,7 +220,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
);
});
if (newNode) {
this.documentList.reload();
this.reload();
}
}