[ADF-] update library to use new js-api 3.0.0 (#4097)

This commit is contained in:
Eugenio Romano
2019-01-06 23:57:01 +01:00
committed by Eugenio Romano
parent 2acd1b4e26
commit 3ef7d3b7ea
430 changed files with 1966 additions and 2149 deletions

View File

@@ -17,7 +17,7 @@
import { ContentService, TranslationService } from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
import { MinimalNodeEntity } from 'alfresco-js-api';
import { NodeEntry } from '@alfresco/js-api';
import { Observable, Subject, throwError } from 'rxjs';
import { ContentActionHandler } from '../models/content-action.model';
import { PermissionModel } from '../models/permissions.model';
@@ -77,8 +77,8 @@ export class DocumentActionsService {
* @param obj Item to receive an action
* @returns True if the action can be executed on this item, false otherwise
*/
canExecuteAction(obj: any): boolean {
return this.documentListService && obj && obj.entry.isFile === true;
canExecuteAction(nodeEntry: NodeEntry): boolean {
return this.documentListService && nodeEntry && nodeEntry.entry.isFile === true;
}
private setupActionHandlers() {
@@ -89,21 +89,21 @@ export class DocumentActionsService {
this.handlers['lock'] = this.lockNode.bind(this);
}
private lockNode(node: MinimalNodeEntity, target?: any, permission?: string) {
private lockNode(node: NodeEntry, target?: any, permission?: string) {
return this.contentNodeDialogService.openLockNodeDialog(node.entry);
}
private downloadNode(obj: MinimalNodeEntity, target?: any, permission?: string) {
private downloadNode(obj: NodeEntry, target?: any, permission?: string) {
this.nodeActionsService.downloadNode(obj);
}
private copyNode(node: MinimalNodeEntity, target?: any, permission?: string) {
private copyNode(node: NodeEntry, target?: any, permission?: string) {
const actionObservable = this.nodeActionsService.copyContent(node.entry, permission);
this.prepareHandlers(actionObservable, 'content', 'copy', target, permission);
return actionObservable;
}
private moveNode(node: MinimalNodeEntity, target?: any, permission?: string) {
private moveNode(node: NodeEntry, target?: any, permission?: string) {
const actionObservable = this.nodeActionsService.moveContent(node.entry, permission);
this.prepareHandlers(actionObservable, 'content', 'move', target, permission);
return actionObservable;
@@ -118,7 +118,7 @@ export class DocumentActionsService {
);
}
private deleteNode(node: MinimalNodeEntity, target?: any, permission?: string): Observable<any> {
private deleteNode(node: NodeEntry, target?: any, permission?: string): Observable<any> {
let handlerObservable;
if (this.canExecuteAction(node)) {