mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
added new action to refresh(re-render) the current node (#1913)
This commit is contained in:
@@ -32,6 +32,7 @@ export enum ViewerActionTypes {
|
|||||||
ViewNodeVersion = 'VIEW_NODE_VERSION',
|
ViewNodeVersion = 'VIEW_NODE_VERSION',
|
||||||
FullScreen = 'FULLSCREEN_VIEWER',
|
FullScreen = 'FULLSCREEN_VIEWER',
|
||||||
ClosePreview = 'CLOSE_PREVIEW',
|
ClosePreview = 'CLOSE_PREVIEW',
|
||||||
|
RefreshPreview = 'REFRESH_PREVIEW',
|
||||||
PluginPreview = 'PLUGIN_PREVIEW'
|
PluginPreview = 'PLUGIN_PREVIEW'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +70,11 @@ export class ClosePreviewAction implements Action {
|
|||||||
constructor(public payload?: MinimalNodeEntity) {}
|
constructor(public payload?: MinimalNodeEntity) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class RefreshPreviewAction implements Action {
|
||||||
|
readonly type = ViewerActionTypes.RefreshPreview;
|
||||||
|
constructor(public payload?: MinimalNodeEntity) {}
|
||||||
|
}
|
||||||
|
|
||||||
export class PluginPreviewAction implements Action {
|
export class PluginPreviewAction implements Action {
|
||||||
readonly type = ViewerActionTypes.PluginPreview;
|
readonly type = ViewerActionTypes.PluginPreview;
|
||||||
|
|
||||||
|
@@ -33,7 +33,8 @@ import {
|
|||||||
ViewerActionTypes,
|
ViewerActionTypes,
|
||||||
ViewNodeAction,
|
ViewNodeAction,
|
||||||
ReloadDocumentListAction,
|
ReloadDocumentListAction,
|
||||||
SetCurrentNodeVersionAction
|
SetCurrentNodeVersionAction,
|
||||||
|
RefreshPreviewAction
|
||||||
} from '@alfresco/aca-shared/store';
|
} from '@alfresco/aca-shared/store';
|
||||||
import { ContentActionRef, SelectionState } from '@alfresco/adf-extensions';
|
import { ContentActionRef, SelectionState } from '@alfresco/adf-extensions';
|
||||||
import { MinimalNodeEntryEntity, SearchRequest, VersionEntry } from '@alfresco/js-api';
|
import { MinimalNodeEntryEntity, SearchRequest, VersionEntry } from '@alfresco/js-api';
|
||||||
@@ -166,6 +167,12 @@ export class AppViewerComponent implements OnInit, OnDestroy {
|
|||||||
this.navigateToFileLocation();
|
this.navigateToFileLocation();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.actions$
|
||||||
|
.pipe(ofType<RefreshPreviewAction>(ViewerActionTypes.RefreshPreview), takeUntil(this.onDestroy$))
|
||||||
|
.subscribe((action: RefreshPreviewAction) => {
|
||||||
|
this.displayNode(action?.payload?.entry?.id);
|
||||||
|
});
|
||||||
|
|
||||||
this.content.nodesDeleted.pipe(takeUntil(this.onDestroy$)).subscribe(() => this.navigateToFileLocation());
|
this.content.nodesDeleted.pipe(takeUntil(this.onDestroy$)).subscribe(() => this.navigateToFileLocation());
|
||||||
|
|
||||||
this.uploadService.fileUploadDeleted.pipe(takeUntil(this.onDestroy$)).subscribe(() => this.navigateToFileLocation());
|
this.uploadService.fileUploadDeleted.pipe(takeUntil(this.onDestroy$)).subscribe(() => this.navigateToFileLocation());
|
||||||
|
Reference in New Issue
Block a user