|
|
@@ -13,6 +13,7 @@ class WBCollectionListing extends Component { |
|
|
|
super(...args);
|
|
|
|
this.state.rows = [];
|
|
|
|
this.state.numPages = 0;
|
|
|
|
this.state.orderStream = uuid.v4();
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
@@ -65,7 +66,8 @@ class WBCollectionListing extends Component { |
|
|
|
let prom = makeArvadosRequest(arvHost, arvToken,
|
|
|
|
'/arvados/v1/collections?filters=' + encodeURIComponent(JSON.stringify(filters)) +
|
|
|
|
'&limit=' + encodeURIComponent(itemsPerPage) +
|
|
|
|
'&offset=' + encodeURIComponent(itemsPerPage * activePage));
|
|
|
|
'&offset=' + encodeURIComponent(itemsPerPage * activePage),
|
|
|
|
{ 'orderStream': this.state.orderStream });
|
|
|
|
|
|
|
|
let collections;
|
|
|
|
let numPages
|
|
|
@@ -106,8 +108,14 @@ class WBCollectionListing extends Component { |
|
|
|
prom = prom.then(ownerLookup =>
|
|
|
|
this.setState({
|
|
|
|
'numPages': numPages,
|
|
|
|
'rows': this.prepareRows(collections, ownerLookup)
|
|
|
|
'rows': this.prepareRows(collections, ownerLookup),
|
|
|
|
'error': null
|
|
|
|
}));
|
|
|
|
|
|
|
|
prom = prom.catch(() => this.setState({
|
|
|
|
'error': 'An error occured querying the Arvados API',
|
|
|
|
'rows': []
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps, nextState) {
|
|
|
@@ -115,9 +123,13 @@ class WBCollectionListing extends Component { |
|
|
|
this.fetchItems();
|
|
|
|
}
|
|
|
|
|
|
|
|
render({ app, ownerUuid, activePage, getPageUrl }, { rows, numPages }) {
|
|
|
|
render({ app, ownerUuid, activePage, getPageUrl }, { rows, numPages, error }) {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
{ error ? (<div class="alert alert-danger" role="alert">
|
|
|
|
{ error }
|
|
|
|
</div>) : null }
|
|
|
|
|
|
|
|
<WBTable columns={ [ 'Name', 'Description', 'Owner', 'File Count', 'Total Size', 'Actions' ] }
|
|
|
|
rows={ rows } />
|
|
|
|
|
|
|
|