Skip to content

Commit

Permalink
Allow for an array of paths in InputDatasetTable
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed May 29, 2024
1 parent da608ca commit be51f5d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion app/src/components/tables/InputDatasetTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ const InputDatasetTable = function({ config, caption, rows, groups, actions }) {
const allOpen = filteredGroups.every(group => !group.closed)
const allToggle = () => toggleGroups(filteredGroups, allOpen)

const getPath = (row) => {
const path = filterField(config, row.path)
if (Array.isArray(path)) {
return path.map((p, index) => <code className="d-block" key={index}>{p}</code>)
} else {
return <code>{path}</code>
}
}

const getResolutions = (row) => {
const resolution = filterField(config, row.resolution)
if (Array.isArray(resolution)) {
Expand Down Expand Up @@ -68,7 +77,7 @@ const InputDatasetTable = function({ config, caption, rows, groups, actions }) {
</p>}
</td>
<td colSpan="4">
{row.path && <code>{filterField(config, row.path)}</code>}
{getPath(row)}
{row.url && <a href={row.url} target="_blank">{row.url}</a>}
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion assets/app.js

Large diffs are not rendered by default.

0 comments on commit be51f5d

Please sign in to comment.