[ADF-571] upload feature rework (#1922)

* upload feature rework

lots of improvements for upload dialog and underlying services

* readme update

- readme cleanup
- remove some old comments from code
- update readme with new events for Upload Service

* restore prerequisites section in readme
This commit is contained in:
Denys Vuika
2017-06-02 14:05:55 +01:00
committed by Eugenio Romano
parent 69cae2f4d4
commit ad886f608c
4 changed files with 35 additions and 31 deletions

View File

@@ -190,6 +190,7 @@ export class UploadButtonComponent implements OnInit, OnChanges {
error => this.onError.emit(error)
);
}
return 'Error';
}
// TODO: move to AlfrescoContentService
@@ -210,6 +211,23 @@ export class UploadButtonComponent implements OnInit, OnChanges {
return Observable.throw(error || 'Server error');
}
getFolderNode(nodeId: string): Observable<MinimalNodeEntryEntity> {
let opts: any = {
includeSource: true,
include: ['allowableOperations']
};
return Observable.fromPromise(this.apiService.getInstance().nodes.getNodeInfo(nodeId, opts))
.catch(err => this.handleError(err));
}
private handleError(error: Response) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
this.logService.error(error);
return Observable.throw(error || 'Server error');
}
private hasCreatePermission(node: any): boolean {
if (node && node.allowableOperations) {
return node.allowableOperations.find(permision => permision === 'create') ? true : false;