IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Ver código fonte

Improvements to field tables.

pull/1/head
Stanislaw Adaszewski 4 anos atrás
pai
commit
7b317f169d
4 arquivos alterados com 16 adições e 6 exclusões
  1. +2
    -0
      frontend/src/js/component/wb-common-fields.js
  2. +2
    -1
      frontend/src/js/component/wb-container-request-fields.js
  3. +6
    -3
      frontend/src/js/component/wb-name-and-uuid.js
  4. +6
    -2
      frontend/src/js/widget/wb-table.js

+ 2
- 0
frontend/src/js/component/wb-common-fields.js Ver arquivo

@@ -84,6 +84,8 @@ class WBCommonFields extends Component {
return (
rows ? (
<WBTable columns={ [ "Name", "Value" ] }
headerClasses={ [ "col-sm-2", "col-sm-4" ] }
verticalHeader={ true }
rows={ rows } />
) : (
<div>Loading...</div>


+ 2
- 1
frontend/src/js/component/wb-container-request-fields.js Ver arquivo

@@ -113,7 +113,8 @@ class WBContainerRequestFields extends Component {
rows ? (
<WBTable columns={ [ "Name", "Value" ] }
headerClasses={ [ "col-sm-2", "col-sm-4" ] }
rows={ rows } />
rows={ rows }
verticalHeader={ true } />
) : (
<div>Loading...</div>
)


+ 6
- 3
frontend/src/js/component/wb-name-and-uuid.js Ver arquivo

@@ -44,6 +44,9 @@ class WBNameAndUuid extends Component {
prom = prom.then(xhr => this.setState({
'item': xhr.response
}));
prom = prom.catch(xhr => this.setState({
'error': 'Unable to retrieve: ' + xhr.status + ' (' + xhr.statusText + ')'
}));
} else {
this.setState({
@@ -54,7 +57,7 @@ class WBNameAndUuid extends Component {
}
}
render({ uuid }, { item }) {
render({ uuid }, { error, item }) {
if (!uuid)
return (
<div><i>{ String(uuid) }</i></div>
@@ -63,9 +66,9 @@ class WBNameAndUuid extends Component {
return (
<div>
<div>
{ item ? (
{ error ? error : (item ? (
<a href={ urlForObject(item) }>{ arvadosObjectName(item) }</a>
) : 'Loading...' }
) : 'Loading...') }
</div>
<div>
{ uuid }


+ 6
- 2
frontend/src/js/widget/wb-table.js Ver arquivo

@@ -1,7 +1,7 @@
import { h, Component } from 'preact';
class WBTable extends Component {
render({ columns, rows, headerClasses }) {
render({ columns, rows, headerClasses, verticalHeader }) {
return (
<table class="table table-striped table-hover">
<thead class="thead-light">
@@ -13,7 +13,11 @@ class WBTable extends Component {
{ rows.map(r => (
<tr>
{ columns.map((_, idx) => (
<td>{ r[idx] }</td>
(idx == 0 && verticalHeader) ? (
<th scope="row">{ r[idx] }</th>
) : (
<td>{ r[idx] }</td>
)
)) }
</tr>
)) }


Carregando…
Cancelar
Salvar