Commit b67a7f29 authored by Alejandro De Maria Antolinos's avatar Alejandro De Maria Antolinos
Browse files

Merge branch '520-search-problem-with-parcels' into 'master'

Resolve "Search problem with parcels"

Closes #520

See merge request !538
parents 0c12d10d 9f1702a5
Pipeline #51183 passed with stages
in 13 minutes and 23 seconds
......@@ -115,6 +115,7 @@ export function beamlineFormatter(investigation) {
}
export function nameFormatter(investigation, showLink, section = 'datasets') {
console.log(investigation);
const { id, name } = investigation;
if (!showLink) {
......
......@@ -39,7 +39,15 @@ const ParcelColumns = [
{
text: 'Proposal',
dataField: 'experiment',
formatter: (_, parcel) => nameFormatter(parcel.investigation, true),
formatter: (_, parcel) => {
console.log(parcel);
return nameFormatter(
parcel.investigation
? parcel.investigation
: { name: parcel.investigationName, id: parcel.investigationId },
true
);
},
sort: true,
responsiveHeaderStyle: {
xs: { width: 150, hidden: UI.userPortal.isLinkEnabled },
......@@ -76,7 +84,7 @@ const ParcelColumns = [
if (!parcel.investigation) {
return false;
}
const beamline = parcel.investigation.instrument.name;
const beamline = parcel.investigation?.instrument?.name;
return !!beamline && beamline.toLowerCase().includes(searchText);
},
sort: true,
......
Markdown is supported
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