@@ -84,6 +84,8 @@ class WBCommonFields extends Component { | |||||
return ( | return ( | ||||
rows ? ( | rows ? ( | ||||
<WBTable columns={ [ "Name", "Value" ] } | <WBTable columns={ [ "Name", "Value" ] } | ||||
headerClasses={ [ "col-sm-2", "col-sm-4" ] } | |||||
verticalHeader={ true } | |||||
rows={ rows } /> | rows={ rows } /> | ||||
) : ( | ) : ( | ||||
<div>Loading...</div> | <div>Loading...</div> | ||||
@@ -113,7 +113,8 @@ class WBContainerRequestFields extends Component { | |||||
rows ? ( | rows ? ( | ||||
<WBTable columns={ [ "Name", "Value" ] } | <WBTable columns={ [ "Name", "Value" ] } | ||||
headerClasses={ [ "col-sm-2", "col-sm-4" ] } | headerClasses={ [ "col-sm-2", "col-sm-4" ] } | ||||
rows={ rows } /> | |||||
rows={ rows } | |||||
verticalHeader={ true } /> | |||||
) : ( | ) : ( | ||||
<div>Loading...</div> | <div>Loading...</div> | ||||
) | ) | ||||
@@ -44,6 +44,9 @@ class WBNameAndUuid extends Component { | |||||
prom = prom.then(xhr => this.setState({ | prom = prom.then(xhr => this.setState({ | ||||
'item': xhr.response | 'item': xhr.response | ||||
})); | })); | ||||
prom = prom.catch(xhr => this.setState({ | |||||
'error': 'Unable to retrieve: ' + xhr.status + ' (' + xhr.statusText + ')' | |||||
})); | |||||
} else { | } else { | ||||
this.setState({ | this.setState({ | ||||
@@ -54,7 +57,7 @@ class WBNameAndUuid extends Component { | |||||
} | } | ||||
} | } | ||||
render({ uuid }, { item }) { | |||||
render({ uuid }, { error, item }) { | |||||
if (!uuid) | if (!uuid) | ||||
return ( | return ( | ||||
<div><i>{ String(uuid) }</i></div> | <div><i>{ String(uuid) }</i></div> | ||||
@@ -63,9 +66,9 @@ class WBNameAndUuid extends Component { | |||||
return ( | return ( | ||||
<div> | <div> | ||||
<div> | <div> | ||||
{ item ? ( | |||||
{ error ? error : (item ? ( | |||||
<a href={ urlForObject(item) }>{ arvadosObjectName(item) }</a> | <a href={ urlForObject(item) }>{ arvadosObjectName(item) }</a> | ||||
) : 'Loading...' } | |||||
) : 'Loading...') } | |||||
</div> | </div> | ||||
<div> | <div> | ||||
{ uuid } | { uuid } | ||||
@@ -1,7 +1,7 @@ | |||||
import { h, Component } from 'preact'; | import { h, Component } from 'preact'; | ||||
class WBTable extends Component { | class WBTable extends Component { | ||||
render({ columns, rows, headerClasses }) { | |||||
render({ columns, rows, headerClasses, verticalHeader }) { | |||||
return ( | return ( | ||||
<table class="table table-striped table-hover"> | <table class="table table-striped table-hover"> | ||||
<thead class="thead-light"> | <thead class="thead-light"> | ||||
@@ -13,7 +13,11 @@ class WBTable extends Component { | |||||
{ rows.map(r => ( | { rows.map(r => ( | ||||
<tr> | <tr> | ||||
{ columns.map((_, idx) => ( | { columns.map((_, idx) => ( | ||||
<td>{ r[idx] }</td> | |||||
(idx == 0 && verticalHeader) ? ( | |||||
<th scope="row">{ r[idx] }</th> | |||||
) : ( | |||||
<td>{ r[idx] }</td> | |||||
) | |||||
)) } | )) } | ||||
</tr> | </tr> | ||||
)) } | )) } | ||||