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

fix: removed hca specific config from lungmap (#4287) #4295

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 6 additions & 10 deletions site-config/lungmap/dev/config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { CategoryGroupConfig } from "@databiosphere/findable-ui/lib/config/entities";
import hcaConfig, {
import {
DATA_URL as HCA_DATA_URL,
PORTAL_URL as HCA_PORTAL_URL,
} from "site-config/hca-dcp/ma-dev/config";
import * as C from "../../../app/components/index";
import { FLATTEN, GIT_HUB_REPO_URL } from "../../common/constants";
import { SiteConfig } from "../../common/entities";
import { filesEntityConfig as hcaFilesEntityConfig } from "../../hca-dcp/dev/index/filesEntityConfig";
import { samplesEntityConfig as hcaSamplesEntityConfig } from "../../hca-dcp/dev/index/samplesEntityConfig";
import { exportConfig } from "./export/exportConfig";
import { CATEGORY_GROUPS } from "./index/common/category";
import { filesEntityConfig } from "./index/filesEntityConfig";
import { projectsEntityConfig } from "./index/projectsEntityConfig";
import { samplesEntityConfig } from "./index/samplesEntityConfig";
import { summary } from "./index/summary";
import { socialMedia } from "./socialMedia";

Expand Down Expand Up @@ -40,7 +40,7 @@ export function makeConfig(
authentication: undefined,
browserURL: browserUrl,
categoryGroupConfig: {
...(hcaConfig.categoryGroupConfig as CategoryGroupConfig),
categoryGroups: CATEGORY_GROUPS,
key: "lungmap",
},
contentDir: "lungmap",
Expand All @@ -53,11 +53,7 @@ export function makeConfig(
},
url: `${dataUrl}/`,
},
entities: [
projectsEntityConfig,
hcaSamplesEntityConfig,
hcaFilesEntityConfig,
],
entities: [projectsEntityConfig, samplesEntityConfig, filesEntityConfig],
explorerTitle: "Explore Data",
export: exportConfig,
exportToTerraUrl: EXPORT_TO_TERRA_URL,
Expand Down
8 changes: 6 additions & 2 deletions site-config/lungmap/dev/detail/project/exportMainColumn.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ALERT_PROPS } from "@databiosphere/findable-ui/lib/components/common/Alert/constants";
import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { SIZE } from "@databiosphere/findable-ui/lib/styles/common/constants/size";
import { ProjectsResponse } from "app/apis/azul/hca-dcp/common/responses";
import * as C from "../../../../../app/components";
import * as MDX from "../../../../../app/components/common/MDXContent/lungmap";
import { mainColumn as hcaExportMainColumn } from "../../../../hca-dcp/dev/detail/project/exportMainColumn";
import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";

export const mainColumn: ComponentConfig[] = [
{
Expand All @@ -14,5 +15,8 @@ export const mainColumn: ComponentConfig[] = [
size: SIZE.LARGE,
},
} as ComponentConfig<typeof MDX.AlertBatchCorrectionWarning>,
hcaExportMainColumn[1],
{
component: C.ExportToTerra,
viewBuilder: V.buildExportEntityToTerra,
} as ComponentConfig<typeof C.ExportToTerra, ProjectsResponse>,
];
85 changes: 61 additions & 24 deletions site-config/lungmap/dev/detail/project/mainColumn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,67 @@ import {
ComponentConfig,
ComponentsConfig,
} from "@databiosphere/findable-ui/lib/config/entities";
import { ProjectsResponse } from "app/apis/azul/hca-dcp/common/responses";
import * as C from "../../../../../app/components";
import * as MDX from "../../../../../app/components/common/MDXContent/lungmap";
import { mainColumn as hcaOverviewMainColumn } from "../../../../hca-dcp/dev/detail/project/overviewMainColumn";
import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";

// Data Release Policy
const DATA_RELEASE_POLICY: ComponentConfig = {
children: [
{
component: MDX.DataReleasePolicy,
} as ComponentConfig<typeof MDX.DataReleasePolicy>,
],
component: C.CollapsableSection,
props: {
collapsable: false,
title: "Data Access Policy",
},
};

/**
* Returns overview main column components.
* @returns overview main column components.
*/
export function getOverviewMainColumn(): ComponentsConfig {
const mainColumn = [...hcaOverviewMainColumn];
mainColumn.pop(); // Remove the last element (HCA Data Release Policy).
return [...mainColumn, DATA_RELEASE_POLICY];
}
export const mainColumn: ComponentsConfig = [
{
component: C.Description,
viewBuilder: V.buildDescription,
} as ComponentConfig<typeof C.Description, ProjectsResponse>,
{
component: C.Contacts,
viewBuilder: V.buildContacts,
} as ComponentConfig<typeof C.Contacts, ProjectsResponse>,
{
component: C.Publications,
viewBuilder: V.buildPublications,
} as ComponentConfig<typeof C.Publications, ProjectsResponse>,
{
component: C.Contributors,
viewBuilder: V.buildContributors,
} as ComponentConfig<typeof C.Contributors, ProjectsResponse>,
{
component: C.CollaboratingOrganizations,
viewBuilder: V.buildCollaboratingOrganizations,
} as ComponentConfig<typeof C.CollaboratingOrganizations, ProjectsResponse>,
{
component: C.DataCurators,
viewBuilder: V.buildDataCurators,
} as ComponentConfig<typeof C.DataCurators, ProjectsResponse>,
{
component: C.Citation,
viewBuilder: V.buildCitation,
} as ComponentConfig<typeof C.Citation, ProjectsResponse>,
{
component: C.SupplementaryLinks,
viewBuilder: V.buildSupplementaryLinks,
} as ComponentConfig<typeof C.SupplementaryLinks>,
{
children: [
{
component: C.KeyValuePairs,
viewBuilder: V.buildAccessions,
} as ComponentConfig<typeof C.KeyValuePairs, ProjectsResponse>,
],
component: C.CollapsableSection,
props: {
collapsable: true,
title: "Accessions",
},
} as ComponentConfig<typeof C.CollapsableSection>,
{
children: [
{
component: MDX.DataReleasePolicy,
} as ComponentConfig<typeof MDX.DataReleasePolicy>,
],
component: C.CollapsableSection,
props: {
collapsable: false,
title: "Data Access Policy",
},
} as ComponentConfig<typeof C.CollapsableSection>,
];
11 changes: 11 additions & 0 deletions site-config/lungmap/dev/detail/project/metadataMainColumn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { ProjectsResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses";
import * as C from "../../../../../app/components";
import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";

export const mainColumn: ComponentConfig[] = [
{
component: C.ManifestDownloadEntity,
viewBuilder: V.buildManifestDownloadEntity,
} as ComponentConfig<typeof C.ManifestDownloadEntity, ProjectsResponse>,
];
47 changes: 47 additions & 0 deletions site-config/lungmap/dev/detail/project/overviewSideColumn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { ProjectsResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses";
import * as C from "../../../../../app/components";
import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";

export const sideColumn: ComponentConfig[] = [
{
children: [
{
children: [
{
component: C.SectionTitle,
props: {
title: "Analysis Portals",
},
} as ComponentConfig<typeof C.SectionTitle>,
{
component: C.KeyValuePairs,
viewBuilder: V.buildAnalysisPortals,
} as ComponentConfig<typeof C.KeyValuePairs, ProjectsResponse>,
],
component: C.Grid,
props: {
gridSx: { gap: 4 },
},
} as ComponentConfig<typeof C.Grid>,
],
component: C.GridPaperSection,
} as ComponentConfig<typeof C.GridPaperSection>,
{
component: C.Details,
viewBuilder: V.buildDetails,
} as ComponentConfig<typeof C.Details>,
{
children: [
{
component: C.KeyValuePairs,
viewBuilder: V.buildFileCounts,
} as ComponentConfig<typeof C.KeyValuePairs, ProjectsResponse>,
],
component: C.CollapsableSection,
props: {
collapsable: true,
title: "File Counts",
},
} as ComponentConfig<typeof C.CollapsableSection>,
];
19 changes: 18 additions & 1 deletion site-config/lungmap/dev/export/exportConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
ExportConfig,
ExportMethodConfig,
} from "@databiosphere/findable-ui/lib/config/entities";
import * as C from "../../../../app/components";
import * as HCAViewModelBuilders from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";
import * as V from "../../../../app/viewModelBuilders/azul/lungmap/common/viewModelBuilders";
import {
ROUTE_BULK_DOWNLOAD,
Expand All @@ -17,7 +19,22 @@ export const exportConfig: ExportConfig = {
...getExportConfig(hcaExportConfig),
tabs: [
{
...hcaExportConfig.tabs[0],
label: "Choose Export Method",
mainColumn: [
{
component: C.ExportMethod,
viewBuilder: HCAViewModelBuilders.buildExportMethodBulkDownload,
} as ComponentConfig<typeof C.ExportMethod>,
{
component: C.ExportMethod,
viewBuilder: HCAViewModelBuilders.buildExportMethodManifestDownload,
} as ComponentConfig<typeof C.ExportMethod>,
{
component: C.ExportMethod,
viewBuilder: HCAViewModelBuilders.buildExportMethodTerra,
} as ComponentConfig<typeof C.ExportMethod>,
],
route: "/export",
sideColumn: [
...getExportCurrentQueryAndDataSummary(),
...getExportDataReleasePolicy(),
Expand Down
75 changes: 75 additions & 0 deletions site-config/lungmap/dev/index/common/category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { CategoryGroup } from "@databiosphere/findable-ui/lib/config/entities";
import {
ANALYSIS_PROTOCOL,
ANATOMICAL_ENTITY,
BIOLOGICAL_SEX,
CONTACT_NAME,
CONTENT_DESCRIPTION,
DEVELOPMENT_STAGE,
DONOR_DISEASE,
FILE_FORMAT,
FILE_SOURCE,
GENUS_SPECIES,
INSTITUTION,
INSTRUMENT_MANUFACTURER_MODEL,
LIBRARY_CONSTRUCTION_METHOD,
MODEL_ORGAN,
NUCLEIC_ACID_SOURCE,
ORGAN_PART,
PAIRED_END,
PRESERVATION_METHOD,
PROJECT_TITLE,
SAMPLE_ENTITY_TYPE,
SELECTED_CELL_TYPE,
SPECIMEN_DISEASE,
} from "../../../../hca-dcp/dev/index/common/category";

export const CATEGORY_GROUP: Record<string, CategoryGroup> = {
DONOR: {
categoryConfigs: [
BIOLOGICAL_SEX,
DEVELOPMENT_STAGE,
DONOR_DISEASE,
GENUS_SPECIES,
],
label: "Donor",
},
FILE: {
categoryConfigs: [CONTENT_DESCRIPTION, FILE_FORMAT, FILE_SOURCE],
label: "File",
},
PROJECT: {
categoryConfigs: [PROJECT_TITLE, CONTACT_NAME, INSTITUTION],
label: "Project",
},
PROTOCOL: {
categoryConfigs: [
ANALYSIS_PROTOCOL, // workflow
INSTRUMENT_MANUFACTURER_MODEL,
LIBRARY_CONSTRUCTION_METHOD,
NUCLEIC_ACID_SOURCE,
PAIRED_END,
],
label: "Protocol",
},
SAMPLE: {
categoryConfigs: [
ANATOMICAL_ENTITY, // specimenOrgan
ORGAN_PART,
PRESERVATION_METHOD,
MODEL_ORGAN,
SAMPLE_ENTITY_TYPE,
SELECTED_CELL_TYPE,
SPECIMEN_DISEASE,
],
label: "Sample",
},
};

export const CATEGORY_GROUPS: CategoryGroup[] = [
CATEGORY_GROUP.PROJECT,
CATEGORY_GROUP.DONOR,
CATEGORY_GROUP.SAMPLE,
CATEGORY_GROUP.PROTOCOL,
CATEGORY_GROUP.FILE,
];
Loading
Loading