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!
Parcourir la source

Improvements to field tables.

pull/1/head
Stanislaw Adaszewski il y a 4 ans
Parent
révision
7b317f169d
4 fichiers modifiés avec 16 ajouts et 6 suppressions
  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 Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

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


Chargement…
Annuler
Enregistrer