#159 improved error reporting for document-list (#1180)

- 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:
Denys Vuika
2016-11-30 14:52:06 +00:00
committed by Eugenio Romano
parent da70a72bba
commit 7eab89c5ef
8 changed files with 171 additions and 60 deletions

View File

@@ -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) {