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