Skip to content

Commit

Permalink
add UI for sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Woozl committed Aug 14, 2023
1 parent d287bf6 commit 0a958bf
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/pages/answer/resultsTable/AttributesTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,25 @@ const AttributesTable = ({ attributes, sources }) => (
Sources
</TableCell>
<TableCell>
<pre>
{JSON.stringify(sources, null, 2)}
</pre>
{Array.isArray(sources) && sources.map((source, i) => (
<section key={i}>
<p style={{ marginBottom: '0px', fontStyle: 'italic' }}>{source.resource_id}</p>
<p style={{ filter: 'opacity(0.75)', fontSize: '0.8em' }}>{source.resource_role}</p>
{Boolean(source.upstream_resource_ids) && Array.isArray(source.upstream_resource_ids) && (
<>
<p style={{ marginBottom: '0px' }}>Upstream resource ids:</p>
<ul>
{source.upstream_resource_ids.map((urid, j) => (
<li key={j}>
{urid}
</li>
))}
</ul>
</>
)}
{i === sources.length - 1 ? null : <hr />}
</section>
))}
</TableCell>
</TableRow>
</StyledTableBody>
Expand Down

0 comments on commit 0a958bf

Please sign in to comment.