mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
- expose ‘error’ event - change path only on successful navigation - extend demo shell with error handling and reporting - additional unit tests for document-list
This commit is contained in:
committed by
Eugenio Romano
parent
da70a72bba
commit
7eab89c5ef
@@ -203,21 +203,29 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid
|
||||
this.setSorting(sorting);
|
||||
}
|
||||
|
||||
loadPath(path: string) {
|
||||
if (path && this.documentListService) {
|
||||
this.currentPath = path;
|
||||
this.documentListService
|
||||
.getFolder(path, {
|
||||
maxItems: this._maxItems,
|
||||
skipCount: this._skipCount,
|
||||
rootPath: this.rootPath
|
||||
})
|
||||
.subscribe(val => {
|
||||
this.loadPage(<NodePaging>val);
|
||||
this.dataLoaded.emit(null);
|
||||
},
|
||||
error => console.error(error));
|
||||
}
|
||||
loadPath(path: string): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (path && this.documentListService) {
|
||||
this.documentListService
|
||||
.getFolder(path, {
|
||||
maxItems: this._maxItems,
|
||||
skipCount: this._skipCount,
|
||||
rootPath: this.rootPath
|
||||
})
|
||||
.subscribe(val => {
|
||||
this.currentPath = path;
|
||||
this.loadPage(<NodePaging>val);
|
||||
this.dataLoaded.emit(null);
|
||||
resolve(true);
|
||||
},
|
||||
error => {
|
||||
reject(error);
|
||||
});
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
setFilter(filter: RowFilter) {
|
||||
|
Reference in New Issue
Block a user