Skip to content

Commit

Permalink
Merge pull request #793 from the-good-boy/collectionWorkTableFix
Browse files Browse the repository at this point in the history
fix(Collection): conditionally render author name column in the Work Table component
  • Loading branch information
MonkeyDo committed Mar 4, 2022
2 parents 0358100 + 4c7f5f3 commit b919b95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/components/pages/entities/work-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function WorkTableRow({showAddedAtColumn, work, showCheckboxes, selectedEntities
<a href={`/work/${work.bbid}`}>{name}</a>
{disambiguation}
</td>
<td>{authorData.length ? renderAuthors(authorData) : '?'}</td>
{authorData && <td>{authorData.length ? renderAuthors(authorData) : '?'}</td>}
<td>{languages}</td>
<td>{workType}</td>
{showAddedAtColumn ? <td>{addedAt}</td> : null}
Expand All @@ -88,14 +88,15 @@ WorkTableRow.defaultProps = {
function WorkTable({entity, showAddedAtColumn, works, showAdd, showCheckboxes, selectedEntities, onToggleRow}) {
let tableContent;
if (works.length) {
const showAuthors = works[0].authorsData;
tableContent = (
<React.Fragment>
<Table striped>
<thead>
<tr>
{works[0].displayNumber && <th style={{width: '10%'}}>#</th>}
<th>Name</th>
<th>Author</th>
{showAuthors && <th>Author</th>}
<th>Languages</th>
<th>Type</th>
{
Expand Down

0 comments on commit b919b95

Please sign in to comment.