[ACA-1532] make Preview command available to extensions (#502)

* view file action and effect

* integrate view action with search input/row

* deprecate old ViewNode action/effect

* preview file command as extension

* reorder commands
This commit is contained in:
Denys Vuika
2018-07-09 15:56:33 +01:00
committed by GitHub
parent 7a95485a05
commit 382b459ac8
7 changed files with 104 additions and 59 deletions

View File

@@ -30,7 +30,7 @@ import { Store } from '@ngrx/store';
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
import { takeUntil } from 'rxjs/operators';
import { Subject, Subscription } from 'rxjs/Rx';
import { ViewNodeAction, SetSelectedNodesAction, DownloadNodesAction } from '../store/actions';
import { SetSelectedNodesAction, DownloadNodesAction, ViewFileAction } from '../store/actions';
import { appSelection, sharedUrl, currentFolder } from '../store/selectors/app.selectors';
import { AppStore } from '../store/states/app.state';
import { SelectionState } from '../store/states/selection.state';
@@ -109,16 +109,8 @@ export abstract class PageComponent implements OnInit, OnDestroy {
showPreview(node: MinimalNodeEntity) {
if (node && node.entry) {
const { id, nodeId, name, isFile, isFolder } = node.entry;
const parentId = this.node ? this.node.id : null;
this.store.dispatch(new ViewNodeAction({
parentId,
id: nodeId || id,
name,
isFile,
isFolder
}));
this.store.dispatch(new ViewFileAction(node, parentId));
}
}