Skip to content

Commit

Permalink
Merge pull request #964 from biomage-org/fix-bug-empty-experiments
Browse files Browse the repository at this point in the history
Fix rendering issues on no experiments user
  • Loading branch information
cosa65 authored Dec 18, 2023
2 parents a94cd25 + b9bbf12 commit b9f2147
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/components/data-management/SamplesTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,24 @@ const SamplesTable = forwardRef((props, ref) => {
const [samplesLoaded, setSamplesLoaded] = useState(false);

const initialTableColumns = useMemo(() => {
if (_.isNil(selectedTech)) return [];
const filesColumns = !_.isNil(selectedTech)
? fileUploadSpecifications[selectedTech].requiredFiles.map(
(requiredFile, indx) => ({
index: 2 + indx,
title: <center>{fileTypeToDisplay[requiredFile]}</center>,
key: requiredFile,
dataIndex: requiredFile,
width: 170,
onCell: () => ({ style: { margin: '0px', padding: '0px' } }),
render: (tableCellData) => tableCellData && (
<UploadCell
columnId={requiredFile}
sampleUuid={tableCellData.sampleUuid}
/>
),
}),
)
: [];

return ([
{
Expand All @@ -94,21 +111,7 @@ const SamplesTable = forwardRef((props, ref) => {
<SampleNameCell cellInfo={{ text, record, indx }} />
),
},
...fileUploadSpecifications[selectedTech].requiredFiles.map((requiredFile, indx) => ({
index: 2 + indx,
title: <center>{fileTypeToDisplay[requiredFile]}</center>,
key: requiredFile,
dataIndex: requiredFile,
width: 170,
onCell: () => ({ style: { margin: '0px', padding: '0px' } }),
render: (tableCellData) => tableCellData && (
<UploadCell
columnId={requiredFile}
sampleUuid={tableCellData.sampleUuid}
/>
),
})),

...filesColumns,
]);
}, [selectedTech]);

Expand Down

0 comments on commit b9f2147

Please sign in to comment.