diff --git a/src/components/CollapsibleTable.js b/src/components/CollapsibleTable.js index 01f6129e0..8f84199e0 100644 --- a/src/components/CollapsibleTable.js +++ b/src/components/CollapsibleTable.js @@ -164,15 +164,7 @@ const CollapsibleRow = (props) => { {row.data.map((cell, i) => { - return cell?.truncate ? ( - - {cell.value} - - ) : ( - - {cell.value} - - ); + return ; })} {/* subtable */} @@ -201,11 +193,9 @@ const CollapsibleRow = (props) => { checked={isSelected(subRow.id)} /> - {subRow.data.map((cell, k) => ( - - {cell.value} - - ))} + {subRow.data.map((cell, k) => { + return ; + })} ))} @@ -268,3 +258,43 @@ export const CollapsibleTable = (props) => { }; export default CollapsibleTable; + +const TableCellRenderer = ({ cell }) => { + + if (cell?.truncate && cell?.increaseWidth) { + return + {cell.value} + ; + } + + if (cell?.truncate) { + return + {cell.value} + ; + } + + if (cell?.increaseWidth) { + return + {cell.value} + ; + } + + // Default case: + return + {cell.value} + ; +}; + +const SubtableCellRenderer = ({ cell }) => { + + if (cell?.increaseWidth) { + return + {cell.value} + ; + } + + // Default case: + return + {cell.value} + ; +}; diff --git a/src/components/data_search/DatasetSearchTable.js b/src/components/data_search/DatasetSearchTable.js index 565ef24d3..79545488e 100644 --- a/src/components/data_search/DatasetSearchTable.js +++ b/src/components/data_search/DatasetSearchTable.js @@ -115,6 +115,7 @@ export const DatasetSearchTable = (props) => { { value: entry[0].study.studyName, truncate: true, + increaseWidth: true }, { value: entry[0].study.description, @@ -152,6 +153,7 @@ export const DatasetSearchTable = (props) => { data: [ { value: dataset.datasetIdentifier, + increaseWidth: true }, { value: dataset.dataUse?.primary.map((use) => use.code).join(', ')