mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
[ACA-1631] more application ngrx actions (#540)
* delete action * library path evaluator * extension for sharing files * upload actions * delete library * use extensions for experimental library actions * unshare nodes * fix icons and titles * "create menu" backed by core extension * support for descriptions, update upload selector * update code and tests * support disabled tooltips for navbar * fix selector * [ACA-1486] remove double fetch call * migrate to trashcan actions, element IDs * cleanup code, remove deprecated directives * add/remove favorite * improve rendering performance * update favorites without reload * support for adding Sites to favorites * disable favorites for Libraries for now * copy action * move node * manage versions and permissions * cleanup code * toggle info drawer * card view mode * use extension layer for favorites toolbar * fix menu tooltips * fix 'remove as favorite' tests * update tests * test fixes * fix edit folder for favorites * fix test * cleanup favorites layout * upgrade recent files layout * update evaluators for shared nodes * test fixes * test fixes * restore recent files layout * workaround for "favorite" toggle and recent files * upgrade shared files page * upgrade files page layout * fix library evaluator * workaround for shared files and permissions * cleanup code * upgrade search results * upgrade sidebar and viewer actions * code cleanup * code cleanup * code cleanup
This commit is contained in:
@@ -27,8 +27,7 @@ import { FileUploadEvent, UploadService } from '@alfresco/adf-core';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging, PathElement, PathElementEntity } from 'alfresco-js-api';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, PathElement, PathElementEntity } from 'alfresco-js-api';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { NodeActionsService } from '../../services/node-actions.service';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
@@ -68,19 +67,21 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
route.params.subscribe(({ folderId }: Params) => {
|
||||
const nodeId = folderId || data.defaultNodeId;
|
||||
|
||||
this.contentApi.getNode(nodeId)
|
||||
.map(node => node.entry)
|
||||
.do(node => {
|
||||
if (node.isFolder) {
|
||||
this.updateCurrentNode(node);
|
||||
} else {
|
||||
this.router.navigate(['/personal-files', node.parentId], { replaceUrl: true });
|
||||
}
|
||||
})
|
||||
.skipWhile(node => !node.isFolder)
|
||||
.flatMap(node => this.fetchNodes(node.id))
|
||||
this.contentApi
|
||||
.getNode(nodeId)
|
||||
.subscribe(
|
||||
() => this.isValidPath = true,
|
||||
node => {
|
||||
this.isValidPath = true;
|
||||
|
||||
if (node.entry && node.entry.isFolder) {
|
||||
this.updateCurrentNode(node.entry);
|
||||
} else {
|
||||
this.router.navigate(
|
||||
['/personal-files', node.entry.parentId],
|
||||
{ replaceUrl: true }
|
||||
);
|
||||
}
|
||||
},
|
||||
() => this.isValidPath = false
|
||||
);
|
||||
});
|
||||
@@ -102,10 +103,6 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
this.store.dispatch(new SetCurrentFolderAction(null));
|
||||
}
|
||||
|
||||
fetchNodes(parentNodeId?: string): Observable<NodePaging> {
|
||||
return this.contentApi.getNodeChildren(parentNodeId);
|
||||
}
|
||||
|
||||
navigate(nodeId: string = null) {
|
||||
const commands = [ './' ];
|
||||
|
||||
|
Reference in New Issue
Block a user