mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[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:
committed by
Eugenio Romano
parent
69cae2f4d4
commit
ad886f608c
@@ -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;
|
||||
|
Reference in New Issue
Block a user