Skip to content
Snippets Groups Projects
Commit 2a8d1c92 authored by David Mendez's avatar David Mendez
Browse files

Report card structure: improve way of determining if sections are included

parent 951bb788
No related branches found
No related tags found
1 merge request!80Add multiplex data visualisation
......@@ -15,150 +15,78 @@ const methods = {
isChemicalProbe,
isNegativeControl
) {
if (isChemicalProbe) {
return {
title: prefName,
entityName: EntityNames.EubopenCompound.singularEntityName,
sections: [
{
id: 'Summary',
title: 'Summary',
component: Summary,
index: 0,
},
{
id: 'ProbeMechanism',
title: 'Mechanism of Action',
component: ProbeMechanism,
index: 1,
},
{
id: 'ControlStructuresAndUse',
title: 'Negative Controls',
component: ControlStructuresAndUse,
index: 2,
},
{
id: 'ProbeProfile',
title: 'Activity Profile',
component: ProbeProfile,
index: 3,
},
{
id: 'CellViabilityAndHealthData',
title: 'Cell Viability And Health Data',
component: CellViabilityAndHealthData,
index: 4,
},
{
id: 'CalculatedProperties',
title: 'Calculated Properties',
component: CalculatedProperties,
componentParams: {
entityID: EntityNames.EubopenCompound.entityID,
},
const basePageStructure = [
{
id: 'Summary',
title: 'Summary',
component: Summary,
include: true,
},
{
id: 'ProbeMechanism',
title: 'Mechanism of Action',
component: ProbeMechanism,
include: true,
},
{
id: 'ControlStructuresAndUse',
title: 'Negative Controls',
component: ControlStructuresAndUse,
include: isChemicalProbe,
},
{
id: 'ProbesForThisCompound',
title: 'Related Probes',
component: ProbesForThisCompound,
include: isNegativeControl,
},
index: 5,
},
{
id: 'CrystalStructures',
title: 'PBD Ligand Codes',
component: CompoundCrystalStructures,
index: 6,
},
],
}
{
id: 'ProbeProfile',
title: 'Activity Profile',
component: ProbeProfile,
include: true,
},
{
id: 'CellViabilityAndHealthData',
title: 'Cell Viability And Health Data',
component: CellViabilityAndHealthData,
include: true,
},
{
id: 'CalculatedProperties',
title: 'Calculated Properties',
component: CalculatedProperties,
componentParams: {
entityID: EntityNames.EubopenCompound.entityID,
},
include: true,
},
{
id: 'CrystalStructures',
title: 'PBD Ligand Codes',
component: CompoundCrystalStructures,
include: true,
},
]
const finalPageStructure = {
title: prefName,
entityName: EntityNames.EubopenCompound.singularEntityName,
sections: [],
}
if (isNegativeControl) {
return {
title: prefName,
entityName: EntityNames.EubopenCompound.singularEntityName,
sections: [
{
id: 'Summary',
title: 'Summary',
component: Summary,
index: 0,
},
{
id: 'ProbeMechanism',
title: 'Mechanism of Action',
component: ProbeMechanism,
index: 1,
},
{
id: 'ProbesForThisCompound',
title: 'Related Probes',
component: ProbesForThisCompound,
index: 2,
},
{
id: 'ProbeProfile',
title: 'Activity Profile',
component: ProbeProfile,
index: 3,
},
{
id: 'CalculatedProperties',
title: 'Calculated Properties',
component: CalculatedProperties,
componentParams: {
entityID: EntityNames.EubopenCompound.entityID,
},
let index = 0
index: 4,
},
{
id: 'CrystalStructures',
title: 'PBD Ligand Codes',
component: CompoundCrystalStructures,
index: 5,
},
],
for (const section of basePageStructure) {
if (section.include) {
section.index = index
finalPageStructure.sections.push(section)
index++
}
}
return {
title: prefName,
entityName: EntityNames.EubopenCompound.singularEntityName,
sections: [
{
id: 'Summary',
title: 'Summary',
component: Summary,
index: 0,
},
{
id: 'ProbeMechanism',
title: 'Mechanism of Action',
component: ProbeMechanism,
index: 1,
},
{
id: 'ProbeProfile',
title: 'Activity Profile',
component: ProbeProfile,
index: 2,
},
{
id: 'CalculatedProperties',
title: 'Calculated Properties',
component: CalculatedProperties,
componentParams: {
entityID: EntityNames.EubopenCompound.entityID,
},
index: 3,
},
{
id: 'CrystalStructures',
title: 'PBD Ligand Codes',
component: CompoundCrystalStructures,
index: 4,
},
],
}
return finalPageStructure
},
}
......
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