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!
Преглед на файлове

Improvements to field tables.

pull/1/head
Stanislaw Adaszewski преди 4 години
родител
ревизия
7b317f169d
променени са 4 файла, в които са добавени 16 реда и са изтрити 6 реда
  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 Целия файл

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


+ 2
- 1
frontend/src/js/component/wb-container-request-fields.js Целия файл

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


+ 6
- 3
frontend/src/js/component/wb-name-and-uuid.js Целия файл

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


+ 6
- 2
frontend/src/js/widget/wb-table.js Целия файл

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


Loading…
Отказ
Запис