Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Platform] Use React for state management in literature section #416

Open
wants to merge 17 commits into
base: ot-literature-section
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions apps/platform/src/pages/DiseasePage/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@ import {
SectionLoader,
} from "ui";

import OntologySummary from "sections/src/disease/Ontology/Summary";
import KnownDrugsSummary from "sections/src/disease/KnownDrugs/Summary";
// import OntologySummary from "sections/src/disease/Ontology/Summary";
// import KnownDrugsSummary from "sections/src/disease/KnownDrugs/Summary";

import BibliographySummary from "sections/src/disease/Bibliography/Summary";
import PhenotypesSummary from "sections/src/disease/Phenotypes/Summary";
import OTProjectsSummary from "sections/src/disease/OTProjects/Summary";
// import PhenotypesSummary from "sections/src/disease/Phenotypes/Summary";
// import OTProjectsSummary from "sections/src/disease/OTProjects/Summary";

import client from "../../client";
import ProfileHeader from "./ProfileHeader";

const OntologySection = lazy(() => import("sections/src/disease/Ontology/Body"));
const KnownDrugsSection = lazy(() => import("sections/src/disease/KnownDrugs/Body"));
// const OntologySection = lazy(() => import("sections/src/disease/Ontology/Body"));
// const KnownDrugsSection = lazy(() => import("sections/src/disease/KnownDrugs/Body"));
const BibliographySection = lazy(() => import("sections/src/disease/Bibliography/Body"));
const PhenotypesSection = lazy(() => import("sections/src/disease/Phenotypes/Body"));
const OTProjectsSection = lazy(() => import("sections/src/disease/OTProjects/Body"));
const BibliographySectionOld = lazy(() => import("sections/src/disease/BibliographyOld/Body"));
// const PhenotypesSection = lazy(() => import("sections/src/disease/Phenotypes/Body"));
// const OTProjectsSection = lazy(() => import("sections/src/disease/OTProjects/Body"));

const summaries = [
OntologySummary,
KnownDrugsSummary,
// OntologySummary,
// KnownDrugsSummary,
BibliographySummary,
PhenotypesSummary,
OTProjectsSummary,
// PhenotypesSummary,
// OTProjectsSummary,
];

const DISEASE = "disease";
Expand All @@ -57,33 +59,36 @@ function Profile({ efoId, name }) {
>
<ProfileHeader />
<SummaryContainer>
<OntologySummary />
{/* <OntologySummary />
<KnownDrugsSummary />
<PhenotypesSummary />
<PhenotypesSummary /> */}
<BibliographySummary />
<PrivateWrapper>
{/* <PrivateWrapper>
<OTProjectsSummary />
</PrivateWrapper>
</PrivateWrapper> */}
</SummaryContainer>

<SectionContainer>
<Suspense fallback={<SectionLoader />}>
{/* <Suspense fallback={<SectionLoader />}>
<OntologySection id={efoId} label={name} entity={DISEASE} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
<KnownDrugsSection id={efoId} label={name} entity={DISEASE} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
<PhenotypesSection id={efoId} label={name} entity={DISEASE} />
</Suspense>
</Suspense> */}
<Suspense fallback={<SectionLoader />}>
<BibliographySection id={efoId} label={name} entity={DISEASE} />
</Suspense>
<PrivateWrapper>
<Suspense fallback={<SectionLoader />}>
<BibliographySectionOld id={efoId} label={name} entity={DISEASE} />
</Suspense>
{/* <PrivateWrapper>
<Suspense fallback={<SectionLoader />}>
<OTProjectsSection id={efoId} label={name} entity={DISEASE} />
</Suspense>
</PrivateWrapper>
</PrivateWrapper> */}
</SectionContainer>
</PlatformApiProvider>
);
Expand Down
47 changes: 25 additions & 22 deletions apps/platform/src/pages/DrugPage/Profile.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import { gql } from "@apollo/client";
import { PlatformApiProvider, SectionContainer, SummaryContainer, summaryUtils } from "ui";
import MechanismsOfActionSummary from "sections/src/drug/MechanismsOfAction/Summary";
import IndicationsSummary from "sections/src/drug/Indications/Summary";
import KnownDrugsSummary from "sections/src/drug/KnownDrugs/Summary";
import DrugWarningsSummary from "sections/src/drug/DrugWarnings/Summary";
import PharmacogenomicsSummary from "sections/src/drug/Pharmacogenomics/Summary";
import AdverseEventsSummary from "sections/src/drug/AdverseEvents/Summary";
// import MechanismsOfActionSummary from "sections/src/drug/MechanismsOfAction/Summary";
// import IndicationsSummary from "sections/src/drug/Indications/Summary";
// import KnownDrugsSummary from "sections/src/drug/KnownDrugs/Summary";
// import DrugWarningsSummary from "sections/src/drug/DrugWarnings/Summary";
// import PharmacogenomicsSummary from "sections/src/drug/Pharmacogenomics/Summary";
// import AdverseEventsSummary from "sections/src/drug/AdverseEvents/Summary";
import BibliographySummary from "sections/src/drug/Bibliography/Summary";

import MechanismsOfActionSection from "sections/src/drug/MechanismsOfAction/Body";
import IndicationsSection from "sections/src/drug/Indications/Body";
import KnownDrugsSection from "sections/src/drug/KnownDrugs/Body";
import DrugWarningsSection from "sections/src/drug/DrugWarnings/Body";
import PharmacogenomicsSection from "sections/src/drug/Pharmacogenomics/Body";
import AdverseEventsSection from "sections/src/drug/AdverseEvents/Body";
// import MechanismsOfActionSection from "sections/src/drug/MechanismsOfAction/Body";
// import IndicationsSection from "sections/src/drug/Indications/Body";
// import KnownDrugsSection from "sections/src/drug/KnownDrugs/Body";
// import DrugWarningsSection from "sections/src/drug/DrugWarnings/Body";
// import PharmacogenomicsSection from "sections/src/drug/Pharmacogenomics/Body";
// import AdverseEventsSection from "sections/src/drug/AdverseEvents/Body";
import BibliographySection from "sections/src/drug/Bibliography/Body";
import BibliographySectionOld from "sections/src/drug/BibliographyOld/Body";

import client from "../../client";
import ProfileHeader from "./ProfileHeader";

const summaries = [
MechanismsOfActionSummary,
IndicationsSummary,
KnownDrugsSummary,
DrugWarningsSummary,
PharmacogenomicsSummary,
AdverseEventsSummary,
// MechanismsOfActionSummary,
// IndicationsSummary,
// KnownDrugsSummary,
// DrugWarningsSummary,
// PharmacogenomicsSummary,
// AdverseEventsSummary,
BibliographySummary,
];

Expand All @@ -44,6 +45,7 @@ const DRUG_PROFILE_QUERY = gql`
`;

function Profile({ chemblId, name }) {

return (
<PlatformApiProvider
entity={DRUG}
Expand All @@ -54,23 +56,24 @@ function Profile({ chemblId, name }) {
<ProfileHeader chemblId={chemblId} />

<SummaryContainer>
<MechanismsOfActionSummary />
{/* <MechanismsOfActionSummary />
<IndicationsSummary />
<KnownDrugsSummary />
<DrugWarningsSummary />
<PharmacogenomicsSummary />
<AdverseEventsSummary />
<AdverseEventsSummary /> */}
<BibliographySummary />
</SummaryContainer>

<SectionContainer>
<MechanismsOfActionSection id={chemblId} label={name} entity={DRUG} />
{/* <MechanismsOfActionSection id={chemblId} label={name} entity={DRUG} />
<IndicationsSection id={chemblId} label={name} entity={DRUG} />
<KnownDrugsSection id={chemblId} label={name} entity={DRUG} />
<DrugWarningsSection id={chemblId} label={name} entity={DRUG} />
<PharmacogenomicsSection id={chemblId} label={name} entity={DRUG} />
<AdverseEventsSection id={chemblId} label={name} entity={DRUG} />
<AdverseEventsSection id={chemblId} label={name} entity={DRUG} /> */}
<BibliographySection id={chemblId} label={name} entity={DRUG} />
<BibliographySectionOld id={chemblId} label={name} entity={DRUG} />
</SectionContainer>
</PlatformApiProvider>
);
Expand Down
122 changes: 63 additions & 59 deletions apps/platform/src/pages/TargetPage/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,69 @@ import {
SectionLoader,
} from "ui";

import KnownDrugsSummary from "sections/src/target/KnownDrugs/Summary";
import TractabilitySummary from "sections/src/target/Tractability/Summary";
import SafetySummary from "sections/src/target/Safety/Summary";
import PharmacogenomicsSummary from "sections/src/target/Pharmacogenomics/Summary";
import ChemicalProbesSummary from "sections/src/target/ChemicalProbes/Summary";
import BaselineExpressionSummary from "sections/src/target/Expression/Summary";
import DepMapSummary from "sections/src/target/DepMap/Summary";
import GeneOntologySummary from "sections/src/target/GeneOntology/Summary";
import GeneticConstraintSummary from "sections/src/target/GeneticConstraint/Summary";
import ProtVistaSummary from "sections/src/target/ProtVista/Summary";
import MolecularInteractionsSummary from "sections/src/target/MolecularInteractions/Summary";
import PathwaysSummary from "sections/src/target/Pathways/Summary";
import CancerHallmarksSummary from "sections/src/target/CancerHallmarks/Summary";
import MousePhenotypesSummary from "sections/src/target/MousePhenotypes/Summary";
import ComparativeGenomicsSummary from "sections/src/target/ComparativeGenomics/Summary";
import SubcellularLocationSummary from "sections/src/target/SubcellularLocation/Summary";
// import KnownDrugsSummary from "sections/src/target/KnownDrugs/Summary";
// import TractabilitySummary from "sections/src/target/Tractability/Summary";
// import SafetySummary from "sections/src/target/Safety/Summary";
// import PharmacogenomicsSummary from "sections/src/target/Pharmacogenomics/Summary";
// import ChemicalProbesSummary from "sections/src/target/ChemicalProbes/Summary";
// import BaselineExpressionSummary from "sections/src/target/Expression/Summary";
// import DepMapSummary from "sections/src/target/DepMap/Summary";
// import GeneOntologySummary from "sections/src/target/GeneOntology/Summary";
// import GeneticConstraintSummary from "sections/src/target/GeneticConstraint/Summary";
// import ProtVistaSummary from "sections/src/target/ProtVista/Summary";
// import MolecularInteractionsSummary from "sections/src/target/MolecularInteractions/Summary";
// import PathwaysSummary from "sections/src/target/Pathways/Summary";
// import CancerHallmarksSummary from "sections/src/target/CancerHallmarks/Summary";
// import MousePhenotypesSummary from "sections/src/target/MousePhenotypes/Summary";
// import ComparativeGenomicsSummary from "sections/src/target/ComparativeGenomics/Summary";
// import SubcellularLocationSummary from "sections/src/target/SubcellularLocation/Summary";
import BibliographySummary from "sections/src/target/Bibliography/Summary";

import ProfileHeader from "./ProfileHeader";
import client from "../../client";

const KnownDrugsSection = lazy(() => import("sections/src/target/KnownDrugs/Body"));
const TractabilitySection = lazy(() => import("sections/src/target/Tractability/Body"));
const SafetySection = lazy(() => import("sections/src/target/Safety/Body"));
const PharmacogenomicsSection = lazy(() => import("sections/src/target/Pharmacogenomics/Body"));
const ChemicalProbesSection = lazy(() => import("sections/src/target/ChemicalProbes/Body"));
const BaselineExpressionSection = lazy(() => import("sections/src/target/Expression/Body"));
const DepMapSection = lazy(() => import("sections/src/target/DepMap/Body"));
const GeneOntologySection = lazy(() => import("sections/src/target/GeneOntology/Body"));
const GeneticConstraintSection = lazy(() => import("sections/src/target/GeneticConstraint/Body"));
const ProtVistaSection = lazy(() => import("sections/src/target/ProtVista/Body"));
const MolecularInteractionsSection = lazy(() =>
import("sections/src/target/MolecularInteractions/Body")
);
const PathwaysSection = lazy(() => import("sections/src/target/Pathways/Body"));
const CancerHallmarksSection = lazy(() => import("sections/src/target/CancerHallmarks/Body"));
const MousePhenotypesSection = lazy(() => import("sections/src/target/MousePhenotypes/Body"));
const ComparativeGenomicsSection = lazy(() =>
import("sections/src/target/ComparativeGenomics/Body")
);
const SubcellularLocationSection = lazy(() =>
import("sections/src/target/SubcellularLocation/Body")
);
// const KnownDrugsSection = lazy(() => import("sections/src/target/KnownDrugs/Body"));
// const TractabilitySection = lazy(() => import("sections/src/target/Tractability/Body"));
// const SafetySection = lazy(() => import("sections/src/target/Safety/Body"));
// const PharmacogenomicsSection = lazy(() => import("sections/src/target/Pharmacogenomics/Body"));
// const ChemicalProbesSection = lazy(() => import("sections/src/target/ChemicalProbes/Body"));
// const BaselineExpressionSection = lazy(() => import("sections/src/target/Expression/Body"));
// const DepMapSection = lazy(() => import("sections/src/target/DepMap/Body"));
// const GeneOntologySection = lazy(() => import("sections/src/target/GeneOntology/Body"));
// const GeneticConstraintSection = lazy(() => import("sections/src/target/GeneticConstraint/Body"));
// const ProtVistaSection = lazy(() => import("sections/src/target/ProtVista/Body"));
// const MolecularInteractionsSection = lazy(() =>
// import("sections/src/target/MolecularInteractions/Body")
// );
// const PathwaysSection = lazy(() => import("sections/src/target/Pathways/Body"));
// const CancerHallmarksSection = lazy(() => import("sections/src/target/CancerHallmarks/Body"));
// const MousePhenotypesSection = lazy(() => import("sections/src/target/MousePhenotypes/Body"));
// const ComparativeGenomicsSection = lazy(() =>
// import("sections/src/target/ComparativeGenomics/Body")
// );
// const SubcellularLocationSection = lazy(() =>
// import("sections/src/target/SubcellularLocation/Body")
// );
const BibliographySection = lazy(() => import("sections/src/target/Bibliography/Body"));
const BibliographySectionOld = lazy(() => import("sections/src/target/BibliographyOld/Body"));

const summaries = [
KnownDrugsSummary,
TractabilitySummary,
SafetySummary,
PharmacogenomicsSummary,
ChemicalProbesSummary,
BaselineExpressionSummary,
DepMapSummary,
GeneOntologySummary,
GeneticConstraintSummary,
ProtVistaSummary,
MolecularInteractionsSummary,
PathwaysSummary,
CancerHallmarksSummary,
MousePhenotypesSummary,
ComparativeGenomicsSummary,
SubcellularLocationSummary,
// KnownDrugsSummary,
// TractabilitySummary,
// SafetySummary,
// PharmacogenomicsSummary,
// ChemicalProbesSummary,
// BaselineExpressionSummary,
// DepMapSummary,
// GeneOntologySummary,
// GeneticConstraintSummary,
// ProtVistaSummary,
// MolecularInteractionsSummary,
// PathwaysSummary,
// CancerHallmarksSummary,
// MousePhenotypesSummary,
// ComparativeGenomicsSummary,
// SubcellularLocationSummary,
BibliographySummary,
];

Expand Down Expand Up @@ -97,7 +98,7 @@ function Profile({ ensgId, symbol }) {
>
<ProfileHeader />
<SummaryContainer>
<KnownDrugsSummary />
{/* <KnownDrugsSummary />
<TractabilitySummary />
<SafetySummary />
<PharmacogenomicsSummary />
Expand All @@ -112,12 +113,12 @@ function Profile({ ensgId, symbol }) {
<PathwaysSummary />
<CancerHallmarksSummary />
<MousePhenotypesSummary />
<ComparativeGenomicsSummary />
<ComparativeGenomicsSummary /> */}
<BibliographySummary />
</SummaryContainer>

<SectionContainer>
<Suspense fallback={<SectionLoader />}>
{/* <Suspense fallback={<SectionLoader />}>
<KnownDrugsSection id={ensgId} label={symbol} entity={TARGET} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
Expand Down Expand Up @@ -164,13 +165,16 @@ function Profile({ ensgId, symbol }) {
</Suspense>
<Suspense fallback={<SectionLoader />}>
<ComparativeGenomicsSection id={ensgId} label={symbol} entity={TARGET} />
</Suspense>
</Suspense> */}
<Suspense fallback={<SectionLoader />}>
<BibliographySection id={ensgId} label={symbol} entity={TARGET} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
<BibliographySectionOld id={ensgId} label={symbol} entity={TARGET} />
</Suspense>
</SectionContainer>
</PlatformApiProvider>
);
}

export default Profile;
export default Profile;
Loading
Loading