[ACS-6587] ACA: Viewer does not update after restoring version and the toolbar disappears (#3669)

* [ACS-6587] update after restoring version

* [ACS-6587] update tests

* [ACS-6587] add tests and fixes

* resolve conflicts content-management.service.spec.ts
This commit is contained in:
tamaragruszka
2024-03-11 11:54:27 +01:00
committed by GitHub
parent b5d2193416
commit a9780b352d
5 changed files with 75 additions and 10 deletions

View File

@@ -34,7 +34,7 @@ import {
NavigateToParentFolder,
NodeActionTypes,
PurgeDeletedNodesAction,
ReloadDocumentListAction,
RefreshPreviewAction,
RestoreDeletedNodesAction,
SetSelectedNodesAction,
ShareNodeAction,
@@ -1608,10 +1608,11 @@ describe('ContentManagementService', () => {
expect(spyOnOpenUploadNewVersionDialog['calls'].argsFor(0)[2]).toEqual(elementToFocusSelector);
});
it('should dispatch ReloadDocumentListAction if dialog emit refresh action', () => {
spyOnOpenUploadNewVersionDialog.and.returnValue(of({ action: NewVersionUploaderDataAction.refresh }));
it('should dispatch RefreshPreviewAction if dialog emit refresh action', () => {
spyOnOpenUploadNewVersionDialog.and.returnValue(of({ action: NewVersionUploaderDataAction.refresh, node: fakeNodeIsFile }));
contentManagementService.manageVersions(fakeNodeIsFile);
expect(spyOnDispatch).toHaveBeenCalledOnceWith(new ReloadDocumentListAction());
expect(spyOnDispatch).toHaveBeenCalledOnceWith(new RefreshPreviewAction(fakeNodeIsFile));
});
it('should dispatch ReloadDocumentListAction if dialog emit view action', () => {

View File

@@ -32,6 +32,7 @@ import {
NavigateRouteAction,
NavigateToParentFolder,
NodeInfo,
RefreshPreviewAction,
ReloadDocumentListAction,
SetSelectedNodesAction,
ShowLoaderAction,
@@ -581,7 +582,7 @@ export class ContentManagementService {
next: (newVersionUploaderData: NewVersionUploaderData) => {
switch (newVersionUploaderData.action) {
case NewVersionUploaderDataAction.refresh:
this.store.dispatch(new ReloadDocumentListAction());
this.store.dispatch(new RefreshPreviewAction(newVersionUploaderData.node));
break;
case NewVersionUploaderDataAction.view:
this.store.dispatch(