Skip to content

Commit

Permalink
backoffice: tables
Browse files Browse the repository at this point in the history
* removed resultsList from PatronsSearch, DocumentRequestsSearch, EItemsSearch, ItemSearch, SeriesSearch, LoansSearch
* cleaned extra width for ID column
* fixed titles for documents
* adjustable header according to headerActions
* overview tables
* table content adjustment
* closes #219, #337
  • Loading branch information
topless authored and kpsherva committed Oct 14, 2019
1 parent 27e56fc commit 179cc86
Show file tree
Hide file tree
Showing 103 changed files with 6,041 additions and 7,055 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ export class ResultsTable extends Component {
return (
<Table
striped
compact
selectable
{...(singleLine ? { singleLine: true } : {})}
{...(fixed ? { fixed: true } : {})}
selectable
>
<ResultsTableHeader
columns={columns}
withRowAction={this.props.rowActionClickHandler ? true : false}
/>
<ResultsTableHeader columns={columns} />
<ResultsTableBody
columns={columns}
rows={showAllResults ? rows : rows.slice(0, showMaxRows)}
Expand Down Expand Up @@ -67,7 +65,10 @@ export class ResultsTable extends Component {
return (
<Grid>
<Grid.Row>
<Grid.Column width={8} verticalAlign={'middle'}>
<Grid.Column
width={headerActionComponent ? 8 : 16}
verticalAlign="middle"
>
{header}
</Grid.Column>
<Grid.Column width={8} textAlign={'right'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ export default class ResultsTableBody extends Component {
return rows.map(row => {
const withRowAction = this.props.rowActionClickHandler ? (
<Button
circular
compact
icon="eye"
icon="info"
onClick={() => {
this.props.rowActionClickHandler(row);
}}
Expand All @@ -42,9 +41,8 @@ export default class ResultsTableBody extends Component {
};

render() {
const { columns, rows, detailsURL } = this.props;

return <Table.Body>{this.renderRow(columns, rows, detailsURL)}</Table.Body>;
const { columns, rows } = this.props;
return <Table.Body>{this.renderRow(columns, rows)}</Table.Body>;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,15 @@ import PropTypes from 'prop-types';
import { Table } from 'semantic-ui-react';

export default class ResultsTableHeader extends Component {
renderHeaderCell = cellName => {
if (cellName === 'ID') {
return (
<Table.HeaderCell width={2} key={cellName}>
{cellName}
</Table.HeaderCell>
);
} else {
return <Table.HeaderCell key={cellName}>{cellName}</Table.HeaderCell>;
}
};

render() {
const { columns, withRowAction } = this.props;
const headerColumns = columns.map(column => this.renderHeaderCell(column));
const { columns } = this.props;
return (
<Table.Header>
<Table.Row data-test="header">
<Table.HeaderCell width={withRowAction ? 2 : 1} collapsing />
{headerColumns}
<Table.HeaderCell />
{columns.map(col => (
<Table.HeaderCell key={col}>{col}</Table.HeaderCell>
))}
</Table.Row>
</Table.Header>
);
Expand Down
Loading

0 comments on commit 179cc86

Please sign in to comment.