mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-8677] refresh document list after file version restore (#4063)
This commit is contained in:
committed by
GitHub
parent
6450d6b451
commit
14b017358f
@@ -58,6 +58,7 @@ import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dial
|
|||||||
import { MatSnackBarModule, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBarModule, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
|
||||||
import { Node, NodeEntry, VersionPaging } from '@alfresco/js-api';
|
import { Node, NodeEntry, VersionPaging } from '@alfresco/js-api';
|
||||||
import {
|
import {
|
||||||
|
DocumentListService,
|
||||||
FileModel,
|
FileModel,
|
||||||
NewVersionUploaderDataAction,
|
NewVersionUploaderDataAction,
|
||||||
NewVersionUploaderService,
|
NewVersionUploaderService,
|
||||||
@@ -74,6 +75,7 @@ describe('ContentManagementService', () => {
|
|||||||
let contentManagementService: ContentManagementService;
|
let contentManagementService: ContentManagementService;
|
||||||
let notificationService: NotificationService;
|
let notificationService: NotificationService;
|
||||||
let nodeActions: NodeActionsService;
|
let nodeActions: NodeActionsService;
|
||||||
|
let documentListService: DocumentListService;
|
||||||
let translationService: TranslationService;
|
let translationService: TranslationService;
|
||||||
let nodesApiService: NodesApiService;
|
let nodesApiService: NodesApiService;
|
||||||
let nodeAspectService: NodeAspectService;
|
let nodeAspectService: NodeAspectService;
|
||||||
@@ -97,6 +99,7 @@ describe('ContentManagementService', () => {
|
|||||||
showInfoSpy = spyOn(notificationService, 'showInfo');
|
showInfoSpy = spyOn(notificationService, 'showInfo');
|
||||||
showWarningSpy = spyOn(notificationService, 'showWarning');
|
showWarningSpy = spyOn(notificationService, 'showWarning');
|
||||||
nodeActions = TestBed.inject(NodeActionsService);
|
nodeActions = TestBed.inject(NodeActionsService);
|
||||||
|
documentListService = TestBed.inject(DocumentListService);
|
||||||
translationService = TestBed.inject(TranslationService);
|
translationService = TestBed.inject(TranslationService);
|
||||||
nodesApiService = TestBed.inject(NodesApiService);
|
nodesApiService = TestBed.inject(NodesApiService);
|
||||||
nodeAspectService = TestBed.inject(NodeAspectService);
|
nodeAspectService = TestBed.inject(NodeAspectService);
|
||||||
@@ -1578,10 +1581,12 @@ describe('ContentManagementService', () => {
|
|||||||
expect(spyOnOpenUploadNewVersionDialog['calls'].argsFor(0)[2]).toEqual(elementToFocusSelector);
|
expect(spyOnOpenUploadNewVersionDialog['calls'].argsFor(0)[2]).toEqual(elementToFocusSelector);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should dispatch RefreshPreviewAction if dialog emit refresh action', () => {
|
it('should dispatch RefreshPreviewAction and reload document list if dialog emit refresh action', () => {
|
||||||
spyOnOpenUploadNewVersionDialog.and.returnValue(of({ action: NewVersionUploaderDataAction.refresh, node: fakeNodeIsFile }));
|
spyOnOpenUploadNewVersionDialog.and.returnValue(of({ action: NewVersionUploaderDataAction.refresh, node: fakeNodeIsFile }));
|
||||||
|
spyOn(documentListService, 'reload');
|
||||||
contentManagementService.manageVersions(fakeNodeIsFile);
|
contentManagementService.manageVersions(fakeNodeIsFile);
|
||||||
|
|
||||||
|
expect(documentListService.reload).toHaveBeenCalled();
|
||||||
expect(spyOnDispatch).toHaveBeenCalledOnceWith(new RefreshPreviewAction(fakeNodeIsFile));
|
expect(spyOnDispatch).toHaveBeenCalledOnceWith(new RefreshPreviewAction(fakeNodeIsFile));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -578,6 +578,7 @@ export class ContentManagementService {
|
|||||||
next: (newVersionUploaderData) => {
|
next: (newVersionUploaderData) => {
|
||||||
switch (newVersionUploaderData.action) {
|
switch (newVersionUploaderData.action) {
|
||||||
case NewVersionUploaderDataAction.refresh:
|
case NewVersionUploaderDataAction.refresh:
|
||||||
|
this.documentListService.reload();
|
||||||
this.store.dispatch(new RefreshPreviewAction(newVersionUploaderData.node));
|
this.store.dispatch(new RefreshPreviewAction(newVersionUploaderData.node));
|
||||||
break;
|
break;
|
||||||
case NewVersionUploaderDataAction.view:
|
case NewVersionUploaderDataAction.view:
|
||||||
|
Reference in New Issue
Block a user