Commit 39b7e362 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'UploadPage_EntrySelection' into 'v1.0.0'

Fix multi selection and datasets column

See merge request !454
parents a3a0b024 f13dc7ce
Pipeline #115337 passed with stages
in 28 minutes and 11 seconds
......@@ -342,7 +342,7 @@ const DatatableRow = React.memo(function DatatableRow({data, selected, uncollaps
if (selected === 'all') {
return [row]
}
const index = selected.indexOf(row)
const index = selected.map(selectedRow => selectedRow.entry_id).indexOf(row.entry_id)
if (index > -1) {
return [...selected.slice(0, index), ...selected.slice(index + 1)]
} else {
......@@ -452,7 +452,7 @@ export const DatatableTable = React.memo(function DatatableTable({children, acti
actions={actions}
details={details}
key={index}
selected={selected === 'all' || selected?.includes(row)}
selected={selected === 'all' || selected?.map(selectedRow => selectedRow.entry_id).includes(row.entry_id)}
uncollapsed={row === uncollapsedRow}
data={row}
onRowUncollapsed={setUncollapsedRow}
......@@ -636,7 +636,7 @@ export const Datatable = React.memo(function Datatable(props) {
)
const withSelectionFeature = !!contextProps.selected
const shownColumnsObjects = useMemo(() => (
columns.filter(column => shownColumns.includes(column))
columns.filter(column => shownColumns.map(shownColumn => shownColumn.key).includes(column.key))
), [columns, shownColumns])
const context = {
......
......@@ -69,7 +69,7 @@ const columns = [
render: entry => {
const datasets = entry.datasets || []
if (datasets.length > 0) {
return datasets.map(dataset => dataset.name).join(', ')
return datasets.map(dataset => dataset.dataset_name).join(', ')
} else {
return <i>no datasets</i>
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment