Skip to content

Commit

Permalink
return string version of the array to the experiments table to match CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Jun 2, 2022
1 parent 12d7d52 commit f7249d7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
16 changes: 16 additions & 0 deletions webview/src/experiments/util/buildDynamicColumns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ describe('buildDynamicColumns', () => {
},
{
columns: [
{
columns: [
{
id: joinColumnPath(
ColumnType.PARAMS,
'params.yaml',
'code_names'
)
}
],
id: joinColumnPath(
ColumnType.PARAMS,
'params.yaml',
'code_names_previous_placeholder'
)
},
{
columns: [
{
Expand Down
9 changes: 7 additions & 2 deletions webview/src/experiments/util/buildDynamicColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ const Header: React.FC<{ column: TableColumn<Experiment> }> = ({
}

const buildAccessor: (valuePath: string[]) => Accessor<Experiment> =
pathArray => originalRow =>
get(originalRow, pathArray)
pathArray => originalRow => {
const value = get(originalRow, pathArray)
if (!Array.isArray(value)) {
return value
}
return JSON.stringify(value)
}

const buildDynamicColumns = (
properties: Column[],
Expand Down

0 comments on commit f7249d7

Please sign in to comment.