diff --git a/README.md b/README.md index f677a8322..ed67e3db0 100644 --- a/README.md +++ b/README.md @@ -37,5 +37,5 @@ To update HCA scripts in the HCA Data Explorer, navigate to the `explorer` direc ```bash npm run get-cellxgene-projects-hca ``` -This will save any updates to `explorer/site-config/hca-dcp/dev/scripts/out/cellxgene-projects.json` based on HCA links provided by CELLxGENE. +This will save any updates to `explorer/site-config/hca-dcp/ma-dev/scripts/out/cellxgene-projects.json` based on HCA links provided by CELLxGENE. diff --git a/app/config/config.ts b/app/config/config.ts index b91ee4e15..b210f8ac4 100644 --- a/app/config/config.ts +++ b/app/config/config.ts @@ -6,11 +6,8 @@ import anvilCmgCCDev from "../../site-config/anvil-cmg/cc-dev/config"; import anvilCmgDev from "../../site-config/anvil-cmg/dev/config"; import anvilCmgProd from "../../site-config/anvil-cmg/prod/config"; import anvilCmgTempdev from "../../site-config/anvil-cmg/tempdev/config"; -import hcaDcpCCMaDev from "../../site-config/hca-dcp/cc-ma-dev/config"; -import hcaDcpDev from "../../site-config/hca-dcp/dev/config"; import hcaDcpMaDev from "../../site-config/hca-dcp/ma-dev/config"; import hcaDcpMaProd from "../../site-config/hca-dcp/ma-prod/config"; -import hcaDcpProd from "../../site-config/hca-dcp/prod/config"; import lungMapDev from "../../site-config/lungmap/dev/config"; import lungMapProd from "../../site-config/lungmap/prod/config"; @@ -21,11 +18,8 @@ const CONFIGS: { [k: string]: SiteConfig } = { "anvil-cmg-dev": anvilCmgDev, "anvil-cmg-prod": anvilCmgProd, "anvil-cmg-tempdev": anvilCmgTempdev, - "hca-dcp-cc-ma-dev": hcaDcpCCMaDev, - "hca-dcp-dev": hcaDcpDev, "hca-dcp-ma-dev": hcaDcpMaDev, "hca-dcp-ma-prod": hcaDcpMaProd, - "hca-dcp-prod": hcaDcpProd, "lungmap-dev": lungMapDev, "lungmap-prod": lungMapProd, }; diff --git a/app/viewModelBuilders/azul/hca-dcp/common/projectMapper/projectEdits/projectEdits.ts b/app/viewModelBuilders/azul/hca-dcp/common/projectMapper/projectEdits/projectEdits.ts index c37d55d31..490bcdf5d 100644 --- a/app/viewModelBuilders/azul/hca-dcp/common/projectMapper/projectEdits/projectEdits.ts +++ b/app/viewModelBuilders/azul/hca-dcp/common/projectMapper/projectEdits/projectEdits.ts @@ -1,4 +1,4 @@ -import cellxgeneProjects from "../../../../../../../site-config/hca-dcp/dev/scripts/out/cellxgene-projects.json"; +import cellxgeneProjects from "../../../../../../../site-config/hca-dcp/ma-dev/scripts/out/cellxgene-projects.json"; import { baseProjectEdits, CZ_CELLXGENE } from "./constants"; import { CellxGeneProjectMapping, ProjectEdit } from "./entities"; diff --git a/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts b/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts index 083a4f34a..d41b46544 100644 --- a/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts +++ b/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts @@ -54,11 +54,7 @@ import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL, } from "../../../../../site-config/hca-dcp/category"; -import { - ROUTE_BULK_DOWNLOAD, - ROUTE_EXPORT_TO_TERRA, - ROUTE_MANIFEST_DOWNLOAD, -} from "../../../../../site-config/hca-dcp/dev/export/constants"; +import { EXPORT_ROUTE } from "../../../../../site-config/hca-dcp/ma-dev/export/routes"; import { processAggregatedBooleanOrArrayValue, processAggregatedOrArrayValue, @@ -959,7 +955,7 @@ export const buildExportMethodBulkDownload = ( return { ...getExportMethodAccessibility(viewContext), description: "Obtain a curl command for downloading the selected data.", - route: ROUTE_BULK_DOWNLOAD, + route: EXPORT_ROUTE.BULK_DOWNLOAD, title: "Download Study Data and Metadata (Curl Command)", trackingId: "button-request-bulk-download", }; @@ -1030,7 +1026,7 @@ export const buildExportMethodManifestDownload = ( ...getExportMethodAccessibility(viewContext), description: "Request a file manifest for the current query containing the full list of selected files and the metadata for each file.", - route: ROUTE_MANIFEST_DOWNLOAD, + route: EXPORT_ROUTE.MANIFEST_DOWNLOAD, title: "Download a File Manifest with Metadata for the Selected Data", trackingId: "button-request-file-manifest", }; @@ -1050,7 +1046,7 @@ export const buildExportMethodTerra = ( ...getExportMethodAccessibility(viewContext), description: "Terra is a biomedical research platform to analyze data using workflows, Jupyter Notebooks, RStudio, and Galaxy.", - route: ROUTE_EXPORT_TO_TERRA, + route: EXPORT_ROUTE.EXPORT_TO_TERRA, title: "Export Study Data and Metadata to Terra Workspace", trackingId: "button-analyze-in-terra", }; @@ -1248,24 +1244,6 @@ export function getExportSelectedDataSummary( ]); } -/** - * Build props for project BackPageHero component from the given projects response. - * @param projectsResponse - Response model return from projects API. - * @param viewContext - View context. - * @returns model to be used as props for the BackPageHero component. - */ -export const buildHero = ( - projectsResponse: ProjectsResponse, - viewContext: ViewContext -): React.ComponentProps => { - return { - actions: getProjectCallToAction(projectsResponse), - breadcrumbs: getProjectBreadcrumbs(projectsResponse, viewContext), - subTitle: getProjectAggregateLastModifiedDate(projectsResponse), - title: processEntityValue(projectsResponse.projects, "projectTitle"), - }; -}; - /** * Build props for managed access BackPageHero component from the given projects response. * @param projectsResponse - Response model return from projects API. @@ -2164,7 +2142,7 @@ export function getProjectBreadcrumbs( * @param projectsResponse - Response model return from projects API. * @returns model to be used as props for the BackPageHeroActions component. */ -function getProjectCallToAction( +export function getProjectCallToAction( projectsResponse: ProjectsResponse ): ReactElement | null { const isReady = isResponseReady(projectsResponse); diff --git a/app/viewModelBuilders/azul/lungmap/common/viewModelBuilders.ts b/app/viewModelBuilders/azul/lungmap/common/viewModelBuilders.ts index da2ca49d3..78ae15665 100644 --- a/app/viewModelBuilders/azul/lungmap/common/viewModelBuilders.ts +++ b/app/viewModelBuilders/azul/lungmap/common/viewModelBuilders.ts @@ -5,6 +5,7 @@ import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL, } from "../../../../../site-config/hca-dcp/category"; +import { processEntityValue } from "../../../../apis/azul/common/utils"; import { ProjectsResponse } from "../../../../apis/azul/hca-dcp/common/responses"; import * as C from "../../../../components"; import * as MDX from "../../../../components/common/MDXContent/lungmap"; @@ -24,6 +25,9 @@ import { getGeneratedMatricesGenusSpeciesColumnDef, getGeneratedMatricesLibraryConstructionMethodColumnDef, getGeneratedMatricesMatrixCellCountColumnDef, + getProjectAggregateLastModifiedDate, + getProjectBreadcrumbs, + getProjectCallToAction, getProjectResponse, } from "../../hca-dcp/common/viewModelBuilders"; @@ -113,6 +117,24 @@ export const buildExportToTerra = ( }; }; +/** + * Build props for project BackPageHero component from the given projects response. + * @param projectsResponse - Response model return from projects API. + * @param viewContext - View context. + * @returns model to be used as props for the BackPageHero component. + */ +export const buildHero = ( + projectsResponse: ProjectsResponse, + viewContext: ViewContext +): React.ComponentProps => { + return { + actions: getProjectCallToAction(projectsResponse), + breadcrumbs: getProjectBreadcrumbs(projectsResponse, viewContext), + subTitle: getProjectAggregateLastModifiedDate(projectsResponse), + title: processEntityValue(projectsResponse.projects, "projectTitle"), + }; +}; + /** * Build props for ManifestDownload component. * @param _ - Unused. diff --git a/cc-dev-deploy-all.sh b/cc-dev-deploy-all.sh index 5fce11307..1c2d40e23 100755 --- a/cc-dev-deploy-all.sh +++ b/cc-dev-deploy-all.sh @@ -6,7 +6,6 @@ scripts=( "./cc-data-browser.lungmap.dev.clevercanary.com-deploy.sh" "./cc-explore.anvilproject.dev.clevercanary.com-deploy.sh" "./cc-explore.data.humancellatlas.dev.clevercanary.com-deploy.sh" - "./cc-ma-pilot.explore.data.humancellatlas.dev.clevercanary.com-deploy.sh" ) diff --git a/cc-explore.data.humancellatlas.dev.clevercanary.com-deploy.sh b/cc-explore.data.humancellatlas.dev.clevercanary.com-deploy.sh index 124d39cc7..2d5376b07 100755 --- a/cc-explore.data.humancellatlas.dev.clevercanary.com-deploy.sh +++ b/cc-explore.data.humancellatlas.dev.clevercanary.com-deploy.sh @@ -9,7 +9,7 @@ n 22.12.0 npm ci # Build -npm run build-dev:hca-dcp +npm run build-ma-dev:hca-dcp export BUCKET=s3://tha-explore.data.humancellatlas.dev/ export SRCDIR=out/ diff --git a/cc-ma-pilot.explore.data.humancellatlas.dev.clevercanary.com-deploy.sh b/cc-ma-pilot.explore.data.humancellatlas.dev.clevercanary.com-deploy.sh deleted file mode 100755 index 1d05ead66..000000000 --- a/cc-ma-pilot.explore.data.humancellatlas.dev.clevercanary.com-deploy.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# Set the script to exit immediately on error -set -e - -echo \"Deleting ./out/\" -rm -rf ./out - -n 22.12.0 -npm ci - -# Build -npm run build-cc-ma-dev:hca-dcp - -export BUCKET=s3://x0g-ma-pilot.humancellatlas.dev/ -export SRCDIR=out/ - -aws s3 sync $SRCDIR $BUCKET --delete --profile excira -aws cloudfront create-invalidation --distribution-id E161Q2J7BBR3M1 --paths "/*" --profile excira diff --git a/package.json b/package.json index 7795b9bb6..a370eee92 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev:anvil-catalog": "./scripts/dev.sh anvil-catalog dev && ./scripts/set-version.sh dev && next dev", - "build-dev:anvil-catalog": "scripts/common-build.sh anvil-catalog dev && ./scripts/set-version.sh && next build && npm run postbuild", + "build-dev:anvil-catalog": "scripts/common-build.sh anvil-catalog dev && ./scripts/set-version.sh && next build && npm run postbuild", "build-prod:anvil-catalog": "./scripts/common-build.sh anvil-catalog prod && ./scripts/set-version.sh && next build && npm run postbuild", "dev:lungmap": "./scripts/dev.sh lungmap dev && ./scripts/set-version.sh dev && next dev", "build-dev:lungmap": "./scripts/common-build.sh lungmap dev && ./scripts/set-version.sh && next build && npm run postbuild", @@ -12,13 +12,9 @@ "dev:anvil-cmg": "./scripts/dev.sh anvil-cmg dev && ./scripts/set-version.sh dev && next dev", "build:anvil-cmg": "./scripts/build.sh anvil-cmg && ./scripts/set-version.sh && next build && npm run postbuild", "build-cc-dev:anvil-cmg": "./scripts/common-build.sh anvil-cmg cc-dev && ./scripts/set-version.sh && next build && npm run postbuild", - "dev:hca-dcp": "./scripts/dev.sh hca-dcp dev && ./scripts/set-version.sh dev && next dev", - "dev:cc-ma-dev:hca-dcp": "./scripts/dev.sh hca-dcp cc-ma-dev && ./scripts/set-version.sh dev && next dev", - "build-dev:hca-dcp": "./scripts/common-build.sh hca-dcp dev && ./scripts/set-version.sh && next build && npm run postbuild", - "build-cc-ma-dev:hca-dcp": "./scripts/common-build.sh hca-dcp cc-ma-dev && ./scripts/set-version.sh && next build && npm run postbuild", - "build-ma-dev:hca-dcp": "./scripts/common-build.sh hca-dcp ma-dev && ./scripts/set-version.sh && next build && npm run postbuild", - "build-ma-prod:hca-dcp": "./scripts/common-build.sh hca-dcp ma-prod && ./scripts/set-version.sh && next build && npm run postbuild", - "build-prod:hca-dcp": "./scripts/build.sh hca-dcp prod && ./scripts/set-version.sh && next build && npm run postbuild", + "dev:hca-dcp": "./scripts/dev.sh hca-dcp ma-dev && ./scripts/set-version.sh dev && next dev", + "build-ma-dev:hca-dcp": "./scripts/common-build.sh hca-dcp ma-dev && ./scripts/set-version.sh && next build && npm run postbuild", + "build-ma-prod:hca-dcp": "./scripts/common-build.sh hca-dcp ma-prod && ./scripts/set-version.sh && next build && npm run postbuild", "postbuild": "next-sitemap --config next-sitemap.config.mjs", "start": "npx serve out", "lint": "next lint --dir .", @@ -26,7 +22,7 @@ "prepare": "husky", "test": "jest --watch", "test:e2e": "playwright test", - "get-cellxgene-projects-hca": "esrun ./site-config/hca-dcp/dev/scripts/get-cellxgene-projects.ts ", + "get-cellxgene-projects-hca": "esrun ./site-config/hca-dcp/ma-dev/scripts/get-cellxgene-projects.ts ", "test:anvil-cmg": "playwright test -c playwright_anvil.config.ts --trace retain-on-failure", "test:anvil-catalog": "playwright test -c playwright_anvil-catalog.config.ts --trace retain-on-failure", "check-system-status:anvil-cmg": "esrun e2e/anvil/anvil-check-system-status.ts" diff --git a/site-config/hca-dcp/cc-ma-dev/.env b/site-config/hca-dcp/cc-ma-dev/.env deleted file mode 100644 index 542e8d78a..000000000 --- a/site-config/hca-dcp/cc-ma-dev/.env +++ /dev/null @@ -1,2 +0,0 @@ -NEXT_PUBLIC_SITE_CONFIG='hca-dcp-cc-ma-dev' -NEXT_PUBLIC_SITEMAP_DOMAIN='https://ma-pilot.explore.data.humancellatlas.dev.clevercanary.com' diff --git a/site-config/hca-dcp/cc-ma-dev/authentication/authentication.ts b/site-config/hca-dcp/cc-ma-dev/authentication/authentication.ts deleted file mode 100644 index b2f3334d2..000000000 --- a/site-config/hca-dcp/cc-ma-dev/authentication/authentication.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AuthenticationConfig } from "@databiosphere/findable-ui/lib/config/entities"; -import * as MDX from "../../../../app/components/common/MDXContent/hca-dcp"; -import { GOOGLE_PROVIDER, TERRA_SERVICE } from "./constants"; - -export function getAuthenticationConfig(): AuthenticationConfig { - return { - providers: [GOOGLE_PROVIDER], - services: [TERRA_SERVICE], - termsOfService: MDX.LoginTermsOfService({}), - text: MDX.LoginText({}), - title: "Sign in to your account", - }; -} diff --git a/site-config/hca-dcp/cc-ma-dev/authentication/constants.ts b/site-config/hca-dcp/cc-ma-dev/authentication/constants.ts deleted file mode 100644 index 50ab95e03..000000000 --- a/site-config/hca-dcp/cc-ma-dev/authentication/constants.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { - OAUTH_FLOW, - OAuthProvider, -} from "@databiosphere/findable-ui/lib/config/entities"; -import { GOOGLE_SIGN_IN_PROVIDER } from "@databiosphere/findable-ui/lib/google/config"; -import { GoogleProfile } from "@databiosphere/findable-ui/lib/google/types"; - -import { OAUTH_GOOGLE_SIGN_IN } from "../../../common/authentication"; - -const CLIENT_ID = - "713613812354-ckf448r07ahvh8o1hjfj38tp91j9gpq8.apps.googleusercontent.com"; - -export const GOOGLE_PROVIDER: OAuthProvider = { - ...GOOGLE_SIGN_IN_PROVIDER, - ...OAUTH_GOOGLE_SIGN_IN, - clientId: CLIENT_ID, - flow: OAUTH_FLOW.IMPLICIT, -}; - -export const TERRA_SERVICE = { - endpoint: { - profile: "https://sam.dsde-dev.broadinstitute.org/register/user/v1", - tos: "https://sam.dsde-dev.broadinstitute.org/register/user/v2/self/termsOfServiceDetails", - }, - id: "terra", -}; diff --git a/site-config/hca-dcp/cc-ma-dev/config.ts b/site-config/hca-dcp/cc-ma-dev/config.ts deleted file mode 100644 index a8c8e1c01..000000000 --- a/site-config/hca-dcp/cc-ma-dev/config.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { GIT_HUB_REPO_URL } from "../../common/constants"; -import { SiteConfig } from "../../common/entities"; -import { makeConfig } from "../dev/config"; -import { getAuthenticationConfig } from "./authentication/authentication"; -import { getMAExportConfig } from "./export/export"; -import { - getMACategoryGroupConfig, - getMAEntitiesConfig, -} from "./index/projectsEntityConfig"; - -// Template constants -const BROWSER_URL = - "https://ma-pilot.explore.data.humancellatlas.dev.clevercanary.com"; -const CATALOG = "dcp3"; -const DATA_URL = "https://service.dev.singlecell.gi.ucsc.edu"; -const PORTAL_URL = "https://data.humancellatlas.dev.clevercanary.com"; - -const config: SiteConfig = { - ...makeManagedAccessConfig( - makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL, GIT_HUB_REPO_URL, CATALOG) - ), -}; - -/** - * Returns managed access config. - * @param config - Site config. - * @returns managed access config. - */ -export function makeManagedAccessConfig(config: SiteConfig): SiteConfig { - // Clone config. - const cloneConfig = { ...config }; - - // Add authentication to the config. - cloneConfig.authentication = getAuthenticationConfig(); - - // Update categoryGroupConfig. - cloneConfig.categoryGroupConfig = getMACategoryGroupConfig( - cloneConfig.categoryGroupConfig - ); - - // Adding authentication to the header. - const header = { ...cloneConfig.layout.header }; - cloneConfig.layout.header = { ...header, authenticationEnabled: true }; - - // Update entities. - cloneConfig.entities = getMAEntitiesConfig(cloneConfig.entities); - - // Update export. - if (cloneConfig.export) { - cloneConfig.export = getMAExportConfig(cloneConfig.export); - } - - return cloneConfig; -} - -export default config; diff --git a/site-config/hca-dcp/cc-ma-dev/detail/project/mainColumn.ts b/site-config/hca-dcp/cc-ma-dev/detail/project/mainColumn.ts deleted file mode 100644 index 01ca55ae4..000000000 --- a/site-config/hca-dcp/cc-ma-dev/detail/project/mainColumn.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { - BackPageTabConfig, - 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 MDX from "../../../../../app/components/common/MDXContent/hca-dcp"; -import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { PROJECT_ENTITY_ROUTE } from "../../../dev/index/projectsEntityConfig"; - -const MAIN_COLUMN_WARNING: ComponentConfig[] = [ - { - /* Project is not accessible; render warning */ - children: [ - { - children: [ - { - component: MDX.Alert, - viewBuilder: V.buildAlertExportEntityWarning, - } as ComponentConfig, - ], - component: C.BackPageContentSingleColumn, - } as ComponentConfig, - ], - component: C.ConditionalComponent, - viewBuilder: V.renderExportEntityWarning, - } as ComponentConfig, -]; - -/** - * Returns managed access project detail tabs. - * @param tabs - Tabs config. - * @returns managed access project detail tabs. - */ -export function getMAProjectDetailTabs( - tabs: BackPageTabConfig[] -): BackPageTabConfig[] { - return [...tabs].map((tab) => { - if ( - tab.route === PROJECT_ENTITY_ROUTE.OVERVIEW || - tab.route === PROJECT_ENTITY_ROUTE.PROJECT_MATRICES - ) { - return tab; - } - const cloneTab = { ...tab }; - cloneTab.mainColumn = getMADetailMainColumn(tab); - cloneTab.sideColumn = undefined; - return cloneTab; - }); -} - -/** - * Returns the managed access detail main column components. - * @param tab - Tab config. - * @returns managed access detail main column components. - */ -function getMADetailMainColumn(tab: BackPageTabConfig): ComponentConfig[] { - return [ - /* Project is not accessible; render warning */ - ...MAIN_COLUMN_WARNING, - /* Project is accessible; render export entity */ - { - children: [ - /* mainColumn */ - { - children: [...(tab.mainColumn as ComponentConfig[])], - component: C.BackPageContentMainColumn, - } as ComponentConfig, - /* sideColumn */ - { - children: [...(tab.sideColumn as ComponentConfig[])], - component: C.BackPageContentSideColumn, - } as ComponentConfig, - ], - component: C.ConditionalComponent, - viewBuilder: V.renderExportEntity, - } as ComponentConfig, - ]; -} diff --git a/site-config/hca-dcp/cc-ma-dev/detail/project/top.ts b/site-config/hca-dcp/cc-ma-dev/detail/project/top.ts deleted file mode 100644 index ba4be899d..000000000 --- a/site-config/hca-dcp/cc-ma-dev/detail/project/top.ts +++ /dev/null @@ -1,36 +0,0 @@ -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 { Stack } from "../../../../../app/components/Detail/components/AccessibilityBadge/components/Stack/stack"; -import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; - -/** - * Returns managed access detail top components. - * @returns managed access detail top components. - */ -export function getMAProjectDetailTop(): ComponentConfig[] { - return [ - { - children: [ - { - children: [ - { - component: C.DXAccessibilityBadge, - viewBuilder: V.buildProjectAccessibilityBadge, - } as ComponentConfig< - typeof C.DXAccessibilityBadge, - ProjectsResponse - >, - { - component: C.SubTitle, - viewBuilder: V.buildAggregatedDateLastModifiedDate, - } as ComponentConfig, - ], - component: Stack, - } as ComponentConfig, - ], - component: C.BackPageHero, - viewBuilder: V.buildMAHero, - } as ComponentConfig, - ]; -} diff --git a/site-config/hca-dcp/cc-ma-dev/export/export.ts b/site-config/hca-dcp/cc-ma-dev/export/export.ts deleted file mode 100644 index 9e09f0093..000000000 --- a/site-config/hca-dcp/cc-ma-dev/export/export.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { - BackPageTabConfig, - ComponentConfig, - ExportConfig, - ExportMethodConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; -import * as C from "../../../../app/components"; -import * as MDX from "../../../../app/components/common/MDXContent/hca-dcp"; -import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; - -const MAIN_COLUMN_WARNING = [ - /* mainColumn - top section - warning */ - { - children: [ - { - component: MDX.AlertExportWarning, - viewBuilder: V.buildAlertExportWarning, - } as ComponentConfig, - ], - component: C.BackPageContentSingleColumn, - } as ComponentConfig, -]; - -/** - * Returns the managed access export config. - * @param exportConfig - Export config. - * @returns managed access export config. - */ -export function getMAExportConfig(exportConfig: ExportConfig): ExportConfig { - // Clone export config. - const cloneExportConfig = { ...exportConfig }; - // Update export methods. - cloneExportConfig.exportMethods = getMAExportMethods(exportConfig); - // Update tabs. - cloneExportConfig.tabs = getMAExportTabs(exportConfig.tabs); - return cloneExportConfig; -} - -/** - * Returns the managed access export method main column. - * @param exportConfig - Export config. - * @param exportMethod - Export method config. - * @returns managed access export method main column. - */ -function getMAExportMethodMainColumn( - exportConfig: ExportConfig, - exportMethod: ExportMethodConfig -): ComponentConfig[] { - return [ - /* mainColumn - top section - warning - some datasets are not available */ - ...MAIN_COLUMN_WARNING, - /* mainColumn */ - { - children: [...(exportMethod.mainColumn as ComponentConfig[])], - component: C.BackPageContentMainColumn, - } as ComponentConfig, - /* sideColumn */ - { - children: [...(exportConfig.tabs[0].sideColumn as ComponentConfig[])], - component: C.BackPageContentSideColumn, - } as ComponentConfig, - ]; -} - -/** - * Returns the managed access export methods. - * @param exportConfig - Export config. - * @returns managed access export methods. - */ -function getMAExportMethods(exportConfig: ExportConfig): ExportMethodConfig[] { - // Return managed access export methods. - return [...exportConfig.exportMethods].map((exportMethod) => { - const cloneExportMethod = { ...exportMethod }; - cloneExportMethod.mainColumn = getMAExportMethodMainColumn( - exportConfig, - exportMethod - ); - return cloneExportMethod; - }); -} - -/** - * Returns the managed access export tab. - * @param tab - Tab config. - * @returns managed access export tab. - */ -function getMAExportTab(tab: BackPageTabConfig): ComponentConfig[] { - return [ - /* mainColumn - top section - warning - some datasets are not available */ - ...MAIN_COLUMN_WARNING, - /* mainColumn */ - { - children: [...(tab.mainColumn as ComponentConfig[])], - component: C.BackPageContentMainColumn, - } as ComponentConfig, - /* sideColumn */ - { - children: [...(tab.sideColumn as ComponentConfig[])], - component: C.BackPageContentSideColumn, - } as ComponentConfig, - ]; -} - -/** - * Returns the managed access export tabs. - * @param tabs - Export tabs. - * @returns managed access export tabs. - */ -function getMAExportTabs(tabs: BackPageTabConfig[]): BackPageTabConfig[] { - return [...tabs].map((tab) => { - const cloneTab = { ...tab }; - // Update tab main column. - cloneTab.mainColumn = getMAExportTab(tab); - // Remove side column from tab. - cloneTab.sideColumn = undefined; - return cloneTab; - }); -} diff --git a/site-config/hca-dcp/cc-ma-dev/index/common/category.ts b/site-config/hca-dcp/cc-ma-dev/index/common/category.ts deleted file mode 100644 index 33a6c722b..000000000 --- a/site-config/hca-dcp/cc-ma-dev/index/common/category.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { CategoryConfig } from "@databiosphere/findable-ui/lib/common/categories/config/types"; -import { CategoryGroup } from "@databiosphere/findable-ui/lib/config/entities"; -import { mapSelectCategoryValue } from "../../../../../app/config/utils"; -import { - HCA_DCP_CATEGORY_KEY, - HCA_DCP_CATEGORY_LABEL, -} from "../../../category"; -import { CATEGORY_GROUP } from "../../../dev/index/common/category"; -import { mapAccessibleValue, mapDataUseRestrictionValue } from "./utils"; - -export const ACCESSIBLE: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.ACCESSIBLE, - label: HCA_DCP_CATEGORY_LABEL.ACCESSIBLE, - mapSelectCategoryValue: mapSelectCategoryValue(mapAccessibleValue), -}; - -export const DATA_USE_RESTRICTION: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.DATA_USE_RESTRICTION, - label: HCA_DCP_CATEGORY_LABEL.DATA_USE_RESTRICTION, - mapSelectCategoryValue: mapSelectCategoryValue(mapDataUseRestrictionValue), -}; - -export const MA_CATEGORY_GROUP: Record = { - PROJECT: { - ...CATEGORY_GROUP.PROJECT, - categoryConfigs: [ - ...CATEGORY_GROUP.PROJECT.categoryConfigs, - ACCESSIBLE, - DATA_USE_RESTRICTION, - ], - }, -}; - -export const CATEGORY_GROUPS: CategoryGroup[] = [ - MA_CATEGORY_GROUP.PROJECT, - CATEGORY_GROUP.DONOR, - CATEGORY_GROUP.SAMPLE, - CATEGORY_GROUP.PROTOCOL, - CATEGORY_GROUP.FILE, -]; diff --git a/site-config/hca-dcp/cc-ma-dev/index/common/column.ts b/site-config/hca-dcp/cc-ma-dev/index/common/column.ts deleted file mode 100644 index 379d51bb3..000000000 --- a/site-config/hca-dcp/cc-ma-dev/index/common/column.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - ColumnConfig, - ComponentConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; -import { FilesResponse } from "../../../../../app/apis/azul/anvil-cmg/common/responses"; -import { ProjectsResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; -import { PickSome } from "../../../../../app/common/types"; -import * as C from "../../../../../app/components"; -import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { - HCA_DCP_CATEGORY_KEY, - HCA_DCP_CATEGORY_LABEL, -} from "../../../category"; - -export const COLUMN: PickSome< - Record< - keyof typeof HCA_DCP_CATEGORY_KEY, - ColumnConfig - >, - "DATA_USE_RESTRICTION" -> = { - DATA_USE_RESTRICTION: { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildDataUseRestriction, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.DATA_USE_RESTRICTION, - id: HCA_DCP_CATEGORY_KEY.DATA_USE_RESTRICTION, - width: { max: "1fr", min: "124px" }, - }, -}; diff --git a/site-config/hca-dcp/cc-ma-dev/index/filesEntityConfig.ts b/site-config/hca-dcp/cc-ma-dev/index/filesEntityConfig.ts deleted file mode 100644 index 7107d5c2c..000000000 --- a/site-config/hca-dcp/cc-ma-dev/index/filesEntityConfig.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { - ComponentConfig, - EntityConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; -import * as C from "../../../../app/components"; -import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { COLUMN } from "./common/column"; - -/** - * Returns the entity config for managed access files. - * @param entitiesConfig - Entities config. - * @returns entity config for managed access files. - */ -export function getMAFilesEntityConfig( - entitiesConfig: EntityConfig -): EntityConfig { - // Clone files entity. - const cloneEntity = { ...entitiesConfig }; - // Clone list. - const cloneList = { ...cloneEntity.list }; - // Clone columns. - const cloneColumns = [...cloneList.columns]; - // Add data use restriction column. - cloneColumns.splice(2, 0, { - ...COLUMN.DATA_USE_RESTRICTION, - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDataUseRestriction, - } as ComponentConfig, - }); - cloneList.columns = cloneColumns; - cloneEntity.list = cloneList; - return cloneEntity; -} diff --git a/site-config/hca-dcp/cc-ma-dev/index/projects/column.ts b/site-config/hca-dcp/cc-ma-dev/index/projects/column.ts deleted file mode 100644 index f7cba9b6b..000000000 --- a/site-config/hca-dcp/cc-ma-dev/index/projects/column.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { - ColumnConfig, - ComponentConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; -import { ProjectsResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; -import { PickSome } from "../../../../../app/common/types"; -import * as C from "../../../../../app/components"; -import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { - HCA_DCP_CATEGORY_KEY, - HCA_DCP_CATEGORY_LABEL, -} from "../../../category"; - -export const COLUMN: PickSome< - Record>, - "ACCESSIBLE" -> = { - ACCESSIBLE: { - componentConfig: { - component: C.StatusBadge, - viewBuilder: V.buildProjectAccess, - } as ComponentConfig, - enableSorting: false, - header: HCA_DCP_CATEGORY_LABEL.ACCESSIBLE, - id: HCA_DCP_CATEGORY_KEY.ACCESSIBLE, - width: "auto", - }, -}; diff --git a/site-config/hca-dcp/cc-ma-dev/index/projectsEntityConfig.ts b/site-config/hca-dcp/cc-ma-dev/index/projectsEntityConfig.ts deleted file mode 100644 index 534498951..000000000 --- a/site-config/hca-dcp/cc-ma-dev/index/projectsEntityConfig.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { - EntityConfig, - SiteConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; -import { getMAProjectDetailTabs } from "../detail/project/mainColumn"; -import { getMAProjectDetailTop } from "../detail/project/top"; -import { entityListSlot } from "../ui/projectsEntityList"; -import { CATEGORY_GROUPS } from "./common/category"; -import { COLUMN } from "./common/column"; -import { getMAFilesEntityConfig } from "./filesEntityConfig"; -import { COLUMN as PROJECTS_COLUMN } from "./projects/column"; - -/** - * Returns managed access category group config. - * @param categoryGroupConfig - Category group config. - * @returns managed access category group config. - */ -export function getMACategoryGroupConfig( - categoryGroupConfig: SiteConfig["categoryGroupConfig"] -): SiteConfig["categoryGroupConfig"] { - if (categoryGroupConfig) { - return { - ...categoryGroupConfig, - categoryGroups: CATEGORY_GROUPS, - }; - } -} - -/** - * Returns managed access entity config. - * @param entities - Entities config. - * @returns managed access entity config. - */ -export function getMAEntitiesConfig( - entities: SiteConfig["entities"] -): SiteConfig["entities"] { - return [...entities].map((entity) => { - if (entity.route === "projects") { - return getMAProjectsEntityConfig(entity); - } - if (entity.route === "files") { - return getMAFilesEntityConfig(entity); - } - return entity; - }); -} - -/** - * Returns the entity config for managed access projects. - * @param entitiesConfig - Entities config. - * @returns entity config for managed access projects. - */ -export function getMAProjectsEntityConfig( - entitiesConfig: EntityConfig -): EntityConfig { - // Clone project entity. - const cloneEntity = { ...entitiesConfig }; - // Clone list. - const cloneList = { ...cloneEntity.list }; - // Clone columns. - const cloneColumns = [...cloneList.columns]; - // Add accessible column. - cloneColumns.splice(1, 0, PROJECTS_COLUMN.ACCESSIBLE); // Accessible column. - // Add data use restriction column. - cloneColumns.splice(2, 0, COLUMN.DATA_USE_RESTRICTION); // Data use restriction column. - cloneList.columns = cloneColumns; - cloneEntity.list = cloneList; - // Update entity ui. - cloneEntity.ui = { - ...cloneEntity.ui, - slots: { - ...cloneEntity.ui?.slots, - entityListSlot, - }, - }; - // Clone detail. - const cloneDetail = { ...cloneEntity.detail }; - // Update detail top. - cloneDetail.top = getMAProjectDetailTop(); - // Update detail tabs. - cloneDetail.tabs = getMAProjectDetailTabs(cloneDetail.tabs); - // Update detail. - cloneEntity.detail = cloneDetail; - return cloneEntity; -} diff --git a/site-config/hca-dcp/cc-ma-dev/ui/projectsEntityList.ts b/site-config/hca-dcp/cc-ma-dev/ui/projectsEntityList.ts deleted file mode 100644 index d89f182e1..000000000 --- a/site-config/hca-dcp/cc-ma-dev/ui/projectsEntityList.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ALERT_PROPS } from "@databiosphere/findable-ui/lib/components/common/Alert/constants"; -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/hca-dcp"; -import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; - -export const entityListSlot: ComponentsConfig = [ - { - children: [ - { - component: MDX.AlertLoginReminder, - props: { - ...ALERT_PROPS.STANDARD_WARNING, - component: C.FluidPaper, - }, - } as ComponentConfig, - ], - component: C.ConditionalComponent, - viewBuilder: V.renderWhenUnAuthenticated, - } as ComponentConfig, -]; diff --git a/site-config/hca-dcp/dev/.env b/site-config/hca-dcp/dev/.env deleted file mode 100644 index 38b523867..000000000 --- a/site-config/hca-dcp/dev/.env +++ /dev/null @@ -1,2 +0,0 @@ -NEXT_PUBLIC_SITE_CONFIG='hca-dcp-dev' -NEXT_PUBLIC_SITEMAP_DOMAIN='https://explore.data.humancellatlas.clevercanary.com' diff --git a/site-config/hca-dcp/dev/config.ts b/site-config/hca-dcp/dev/config.ts deleted file mode 100644 index df73534d5..000000000 --- a/site-config/hca-dcp/dev/config.ts +++ /dev/null @@ -1,213 +0,0 @@ -import { APIEndpoints } from "@databiosphere/findable-ui/lib/apis/azul/common/entities"; -import { FILTER_SORT } from "@databiosphere/findable-ui/lib/common/filters/sort/config/types"; -import { ANCHOR_TARGET } from "@databiosphere/findable-ui/lib/components/Links/common/entities"; -import { SystemStatusBindResponseFn } from "@databiosphere/findable-ui/lib/config/entities"; -import { TYPOGRAPHY_PROPS } from "@databiosphere/findable-ui/lib/styles/common/mui/typography"; -import * as C from "../../../app/components/index"; -import { bindSystemStatusResponse } from "../../../app/viewModelBuilders/azul/common/systemStatusMapper/systemStatusMapper"; -import { FLATTEN, GIT_HUB_REPO_URL } from "../../common/constants"; -import { SiteConfig } from "../../common/entities"; -import { announcements } from "./announcements/announcements"; -import { exportConfig } from "./export/export"; -import { CATEGORY_GROUPS } from "./index/common/category"; -import { filesEntityConfig } from "./index/filesEntityConfig"; -import { projectsEntityConfig } from "./index/projectsEntityConfig"; -import { samplesEntityConfig } from "./index/samplesEntityConfig"; -import { buildSummaries } from "./index/summaryViewModelBuilder"; -import { floating } from "./layout/floating"; - -// Template constants -const APP_TITLE = "HCA Data Explorer"; -const CATALOG = "dcp59"; -const BROWSER_URL = "https://explore.data.humancellatlas.dev.clevercanary.com"; -const DATA_URL = "https://service.azul.data.humancellatlas.org"; -const EXPORT_TO_TERRA_URL = "https://app.terra.bio"; -const FONT_FAMILY_DIN = "'din-2014', sans-serif"; -const HOME_PAGE_PATH = "/projects"; -const ORG_URL = "https://www.humancellatlas.org"; -const PAGINATION_PAGE_SIZE = "25"; -export const PORTAL_URL = "https://data.humancellatlas.dev.clevercanary.com"; - -export function makeConfig( - browserUrl: string, - portalUrl: string, - dataUrl: string, - gitHubUrl: string, - catalog: string = CATALOG -): SiteConfig { - return { - analytics: { - gtmAuth: "eQWri5eLUCDkm5SvLIv8eQ", // GTM environment-specific - gtmId: "GTM-M2J5NTJ", - gtmPreview: "env-186", - }, - appTitle: APP_TITLE, - authentication: undefined, - browserURL: browserUrl, - categoryGroupConfig: { - categoryGroups: CATEGORY_GROUPS, - key: "hca-dcp", - }, - dataSource: { - defaultListParams: { - size: PAGINATION_PAGE_SIZE, - }, - defaultParams: { - catalog, - }, - url: `${dataUrl}/`, - }, - enableEntitiesView: true, - entities: [projectsEntityConfig, samplesEntityConfig, filesEntityConfig], - export: exportConfig, - exportToTerraUrl: EXPORT_TO_TERRA_URL, - filterSort: { sortBy: FILTER_SORT.COUNT }, - gitHubUrl, - layout: { - floating, - footer: { - Branding: C.HCABranding({ - orgURL: ORG_URL, - portalURL: portalUrl, - }), - navLinks: [ - { - label: "About", - target: ANCHOR_TARGET.BLANK, - url: `${portalUrl}/about`, - }, - { - label: "Help", - target: ANCHOR_TARGET.BLANK, - url: `${portalUrl}/help`, - }, - { - label: "Privacy", - target: ANCHOR_TARGET.BLANK, - url: `${portalUrl}/privacy`, - }, - { - label: "Contact", - target: ANCHOR_TARGET.BLANK, - url: `${portalUrl}/contact`, - }, - ], - versionInfo: true, - }, - header: { - announcements, - authenticationEnabled: false, - logo: C.Logo({ - alt: APP_TITLE, - height: 32.5, - link: HOME_PAGE_PATH, - src: "/images/hcaExplorer.png", - }), - navigation: [ - undefined, - undefined, - [ - { - flatten: FLATTEN.XS_ONLY, - label: "Help & Documentation", - menuItems: [ - { - label: C.LabelIconMenuItem({ label: "Guides" }), - target: ANCHOR_TARGET.BLANK, - url: `${portalUrl}/guides`, - }, - { - label: C.LabelIconMenuItem({ label: "Privacy" }), - target: ANCHOR_TARGET.BLANK, - url: `${portalUrl}/privacy`, - }, - ], - url: "", - }, - ], - ], - searchEnabled: false, - searchURL: `${portalUrl}/search`, - }, - }, - portalURL: portalUrl, - redirectRootToPath: HOME_PAGE_PATH, - summaryConfig: { - apiPath: "index/summary", - mapResponse: buildSummaries, - }, - systemStatus: { - apiPath: `${dataUrl}${APIEndpoints.INDEX_STATUS}`, - bindResponse: bindSystemStatusResponse, - }, - themeOptions: { - palette: { - primary: { - dark: "#005EA9", - main: "#1C7CC7", - }, - }, - typography: { - [TYPOGRAPHY_PROPS.VARIANT.BODY_LARGE_500]: { - fontFamily: FONT_FAMILY_DIN, - fontSize: "18px", - fontWeight: 400, - }, - [TYPOGRAPHY_PROPS.VARIANT.HEADING]: { - fontFamily: FONT_FAMILY_DIN, - fontSize: "22px", - fontWeight: 400, - letterSpacing: "normal", - // eslint-disable-next-line sort-keys -- disabling key order for readability - "@media (min-width: 768px)": { - fontSize: "26px", - letterSpacing: "normal", - }, - }, - [TYPOGRAPHY_PROPS.VARIANT.HEADING_LARGE]: { - fontFamily: FONT_FAMILY_DIN, - fontSize: "26px", - fontWeight: 400, - letterSpacing: "normal", - lineHeight: "34px", - // eslint-disable-next-line sort-keys -- disabling key order for readability - "@media (min-width: 768px)": { - fontSize: "32px", - letterSpacing: "normal", - }, - }, - [TYPOGRAPHY_PROPS.VARIANT.HEADING_SMALL]: { - fontFamily: FONT_FAMILY_DIN, - fontSize: "20px", - fontWeight: 400, - letterSpacing: "normal", - // eslint-disable-next-line sort-keys -- disabling key order for readability - "@media (min-width: 768px)": { - fontSize: "22px", - letterSpacing: "normal", - }, - }, - [TYPOGRAPHY_PROPS.VARIANT.HEADING_XLARGE]: { - fontFamily: FONT_FAMILY_DIN, - fontSize: "32px", - fontWeight: 400, - letterSpacing: "normal", - // eslint-disable-next-line sort-keys -- disabling key order for readability - "@media (min-width: 768px)": { - fontSize: "42px", - letterSpacing: "-0.4px", - }, - }, - }, - }, - }; -} - -const config: SiteConfig = makeConfig( - BROWSER_URL, - PORTAL_URL, - DATA_URL, - GIT_HUB_REPO_URL -); - -export default config; diff --git a/site-config/hca-dcp/dev/export/constants.ts b/site-config/hca-dcp/dev/export/constants.ts deleted file mode 100644 index ae18ab80e..000000000 --- a/site-config/hca-dcp/dev/export/constants.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const ROUTE_BULK_DOWNLOAD = "/export/get-curl-command"; -export const ROUTE_EXPORT_TO_TERRA = "/export/export-to-terra"; -export const ROUTE_MANIFEST_DOWNLOAD = "/export/download-manifest"; diff --git a/site-config/hca-dcp/dev/index/common/category.ts b/site-config/hca-dcp/dev/index/common/category.ts deleted file mode 100644 index 516d8fc95..000000000 --- a/site-config/hca-dcp/dev/index/common/category.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { CategoryConfig } from "@databiosphere/findable-ui/lib/common/categories/config/types"; -import { CategoryGroup } from "@databiosphere/findable-ui/lib/config/entities"; -import { - HCA_DCP_CATEGORY_KEY, - HCA_DCP_CATEGORY_LABEL, -} from "../../../category"; - -export const ANALYSIS_PROTOCOL: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.ANALYSIS_PROTOCOL, - label: HCA_DCP_CATEGORY_LABEL.ANALYSIS_PROTOCOL, -}; - -export const ANATOMICAL_ENTITY: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, - label: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, -}; - -export const BIOLOGICAL_SEX: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, - label: HCA_DCP_CATEGORY_LABEL.BIOLOGICAL_SEX, -}; - -export const BIONETWORK_NAME: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.BIONETWORK_NAME, - label: HCA_DCP_CATEGORY_LABEL.BIONETWORK_NAME, -}; - -export const CONTACT_NAME: CategoryConfig = { - chart: { enable: false }, - key: HCA_DCP_CATEGORY_KEY.CONTACT_NAME, - label: HCA_DCP_CATEGORY_LABEL.CONTACT_NAME, -}; - -export const CONTENT_DESCRIPTION: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.CONTENT_DESCRIPTION, - label: HCA_DCP_CATEGORY_LABEL.CONTENT_DESCRIPTION, -}; - -export const DEVELOPMENT_STAGE: CategoryConfig = { - chart: { enable: false }, - key: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, - label: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, -}; - -export const DONOR_DISEASE: CategoryConfig = { - chart: { enable: false }, - key: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, - label: HCA_DCP_CATEGORY_LABEL.DONOR_DISEASE, -}; - -export const FILE_FORMAT: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.FILE_FORMAT, - label: HCA_DCP_CATEGORY_LABEL.FILE_FORMAT, -}; - -export const FILE_SOURCE: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.FILE_SOURCE, - label: HCA_DCP_CATEGORY_LABEL.FILE_SOURCE, -}; - -export const GENUS_SPECIES: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, - label: HCA_DCP_CATEGORY_LABEL.GENUS_SPECIES, -}; - -export const INSTITUTION: CategoryConfig = { - chart: { enable: false }, - key: HCA_DCP_CATEGORY_KEY.INSTITUTION, - label: HCA_DCP_CATEGORY_LABEL.INSTITUTION, -}; - -export const INSTRUMENT_MANUFACTURER_MODEL: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.INSTRUMENT_MANUFACTURER_MODEL, - label: HCA_DCP_CATEGORY_LABEL.INSTRUMENT_MANUFACTURER_MODEL, -}; - -export const LIBRARY_CONSTRUCTION_METHOD: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, - label: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, -}; - -export const MODEL_ORGAN: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, - label: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, -}; - -export const NUCLEIC_ACID_SOURCE: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, - label: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, -}; - -export const ORGAN_PART: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.ORGAN_PART, - label: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, -}; - -export const PAIRED_END: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.PAIRED_END, - label: HCA_DCP_CATEGORY_LABEL.PAIRED_END, -}; - -export const PRESERVATION_METHOD: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.PRESERVATION_METHOD, - label: HCA_DCP_CATEGORY_LABEL.PRESERVATION_METHOD, -}; - -export const PROJECT_TITLE: CategoryConfig = { - chart: { enable: false }, - key: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, - label: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, -}; - -export const SAMPLE_ENTITY_TYPE: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, - label: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, -}; - -export const SELECTED_CELL_TYPE: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, - label: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, -}; - -export const SPECIMEN_DISEASE: CategoryConfig = { - key: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, - label: HCA_DCP_CATEGORY_LABEL.SPECIMEN_DISEASE, -}; - -export const CATEGORY_GROUP: Record = { - 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, - BIONETWORK_NAME, - ], - 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, -]; diff --git a/site-config/hca-dcp/dev/index/filesEntityConfig.ts b/site-config/hca-dcp/dev/index/filesEntityConfig.ts deleted file mode 100644 index 33ebfdde5..000000000 --- a/site-config/hca-dcp/dev/index/filesEntityConfig.ts +++ /dev/null @@ -1,288 +0,0 @@ -import { - ComponentConfig, - EntityConfig, - ListConfig, - SORT_DIRECTION, -} from "@databiosphere/findable-ui/lib/config/entities"; -import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMode/types"; -import { FilesResponse } 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"; -import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL } from "../../category"; -import { entityViewSlot } from "../ui/entityView"; - -/** - * Entity config object responsible to config anything related to the /files route. - */ -export const filesEntityConfig: EntityConfig = { - apiPath: "index/files", - detail: { - detailOverviews: [], - staticLoad: false, - tabs: [], - top: [], - }, - exploreMode: EXPLORE_MODE.SS_FETCH_SS_FILTERING, - label: "Files", - list: { - columns: [ - { - componentConfig: { - component: C.AzulFileDownload, - viewBuilder: V.buildFileDownload, - } as ComponentConfig, - enableHiding: false, - enableSorting: false, - header: HCA_DCP_CATEGORY_LABEL.AZUL_FILE_DOWNLOAD, - id: HCA_DCP_CATEGORY_KEY.AZUL_FILE_DOWNLOAD, - width: { max: "auto", min: "76px" }, - }, - { - columnPinned: true, - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildFileName, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.FILE_NAME, - id: HCA_DCP_CATEGORY_KEY.FILE_NAME, - width: { max: "2fr", min: "240px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildFileFormat, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.FILE_FORMAT, - id: HCA_DCP_CATEGORY_KEY.FILE_FORMAT, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildFileSize, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.FILE_SIZE, - id: HCA_DCP_CATEGORY_KEY.FILE_SIZE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolWorkflow, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.WORKFLOW, - id: HCA_DCP_CATEGORY_KEY.WORKFLOW, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildFileContentDescriptions, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.CONTENT_DESCRIPTION, - id: HCA_DCP_CATEGORY_KEY.CONTENT_DESCRIPTION, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildFileSource, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.FILE_SOURCE, - id: HCA_DCP_CATEGORY_KEY.FILE_SOURCE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.Link, - viewBuilder: V.buildAggregatedProjectTitle, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, - id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, - width: { max: "2fr", min: "240px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSampleId, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ID, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorGenusSpecies, - } as ComponentConfig, - header: "Species", - id: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSampleEntityType, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenOrgan, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SPECIMEN_ORGAN, - id: HCA_DCP_CATEGORY_KEY.SPECIMEN_ORGAN, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenOrganPart, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, - id: HCA_DCP_CATEGORY_KEY.ORGAN_PART, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSampleModelOrgan, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, - id: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedCellSuspensionSelectedCellType, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, - id: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolLibraryConstructionApproach, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, - id: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolNucleicAcidSource, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, - id: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregatedProtocolPairedEnd, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.PAIRED_END, - id: HCA_DCP_CATEGORY_KEY.PAIRED_END, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorOrganismAge, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.ORGANISM_AGE, - id: HCA_DCP_CATEGORY_KEY.ORGANISM_AGE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregatedDonorBiologicalSex, - } as ComponentConfig, - header: "Sex", - id: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenDisease, - } as ComponentConfig, - header: "Disease (Specimen)", - id: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorDisease, - } as ComponentConfig, - header: "Disease (Donor)", - id: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorDevelopmentStage, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, - id: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, - width: { max: "1fr", min: "148px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildTotalCells, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.CELL_COUNT, - id: HCA_DCP_CATEGORY_KEY.CELL_COUNT, - width: { max: "1fr", min: "124px" }, - }, - ], - tableOptions: { - initialState: { - columnVisibility: { - [HCA_DCP_CATEGORY_KEY.FILE_FORMAT]: false, - [HCA_DCP_CATEGORY_KEY.FILE_SOURCE]: false, - [HCA_DCP_CATEGORY_KEY.SAMPLE_ID]: false, - [HCA_DCP_CATEGORY_KEY.GENUS_SPECIES]: false, - [HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE]: false, - [HCA_DCP_CATEGORY_KEY.SPECIMEN_ORGAN]: false, - [HCA_DCP_CATEGORY_KEY.ORGAN_PART]: false, - [HCA_DCP_CATEGORY_KEY.MODEL_ORGAN]: false, - [HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE]: false, - [HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD]: false, - [HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE]: false, - [HCA_DCP_CATEGORY_KEY.PAIRED_END]: false, - [HCA_DCP_CATEGORY_KEY.ORGANISM_AGE]: false, - [HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX]: false, - [HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE]: false, - [HCA_DCP_CATEGORY_KEY.DONOR_DISEASE]: false, - [HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE]: false, - }, - sorting: [ - { - desc: SORT_DIRECTION.ASCENDING, - id: HCA_DCP_CATEGORY_KEY.FILE_NAME, - }, - ], - }, - }, - } as ListConfig, - route: "files", - ui: { - enableExportButton: true, - enableSummary: true, - enableTabs: true, - slots: { - entityViewSlot, - }, - }, -}; diff --git a/site-config/hca-dcp/dev/index/projectsEntityConfig.ts b/site-config/hca-dcp/dev/index/projectsEntityConfig.ts deleted file mode 100644 index 0a5d41f44..000000000 --- a/site-config/hca-dcp/dev/index/projectsEntityConfig.ts +++ /dev/null @@ -1,290 +0,0 @@ -import { - ComponentConfig, - EntityConfig, - ListConfig, - SORT_DIRECTION, -} from "@databiosphere/findable-ui/lib/config/entities"; -import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMode/types"; -import { ProjectsResponse } from "../../../../app/apis/azul/hca-dcp/common/responses"; -import { - getProjectId, - getTitle, -} from "../../../../app/apis/azul/hca-dcp/common/utils"; -import * as C from "../../../../app/components"; -import { projectEdits } from "../../../../app/viewModelBuilders/azul/hca-dcp/common/projectMapper/projectEdits/projectEdits"; -import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL } from "../../category"; -import { mainColumn as exportMainColumn } from "../detail/project/exportMainColumn"; -import { sideColumn as exportSideColumn } from "../detail/project/exportSideColumn"; -import { mainColumn as matricesMainColumn } from "../detail/project/matricesMainColumn"; -import { mainColumn as metadataMainColumn } from "../detail/project/metadataMainColumn"; -import { sideColumn as metadataSideColumn } from "../detail/project/metadataSideColumn"; -import { mainColumn as overviewMainColumn } from "../detail/project/overviewMainColumn"; -import { sideColumn as overviewSideColumn } from "../detail/project/overviewSideColumn"; -import { mainColumn as projectFilesMainColumn } from "../detail/project/projectFilesMainColumn"; -import { sideColumn as projectFilesSideColumn } from "../detail/project/projectFilesSideColumn"; -import { top } from "../detail/project/top"; -import { entityViewSlot } from "../ui/entityView"; - -export const PROJECT_ENTITY_ROUTE = { - EXPORT_TO_TERRA: "export-to-terra", - GET_CURL_COMMAND: "get-curl-command", - OVERVIEW: "", - PROJECT_MATRICES: "project-matrices", - PROJECT_METADATA: "project-metadata", -}; - -/** - * Entity config object responsible to config anything related to the /projects route. - */ -export const projectsEntityConfig: EntityConfig = { - apiPath: "index/projects", - detail: { - detailOverviews: ["Overview"], - staticLoad: true, - tabs: [ - { - label: "Overview", - mainColumn: overviewMainColumn, - route: PROJECT_ENTITY_ROUTE.OVERVIEW, - sideColumn: overviewSideColumn, - }, - { - label: "Metadata", - mainColumn: metadataMainColumn, - route: PROJECT_ENTITY_ROUTE.PROJECT_METADATA, - sideColumn: metadataSideColumn, - }, - { - label: "Matrices", - mainColumn: matricesMainColumn, - route: PROJECT_ENTITY_ROUTE.PROJECT_MATRICES, - }, - { - label: "Download", - mainColumn: projectFilesMainColumn, - route: PROJECT_ENTITY_ROUTE.GET_CURL_COMMAND, - sideColumn: projectFilesSideColumn, - }, - { - label: "Export", - mainColumn: exportMainColumn, - route: PROJECT_ENTITY_ROUTE.EXPORT_TO_TERRA, - sideColumn: exportSideColumn, - }, - ], - top: top, - }, - exploreMode: EXPLORE_MODE.SS_FETCH_SS_FILTERING, - getId: getProjectId, - getTitle: getTitle, - label: "Projects", - list: { - columns: [ - { - componentConfig: { - component: C.Link, - viewBuilder: V.buildProjectTitle, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, - id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, - width: { max: "2fr", min: "374px" }, - }, - { - componentConfig: { - component: C.BioNetworkCell, - viewBuilder: V.buildBioNetwork, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.BIONETWORK_NAME, - id: HCA_DCP_CATEGORY_KEY.BIONETWORK_NAME, - width: { max: "1fr", min: "126px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorGenusSpecies, - } as ComponentConfig, - header: "Species", // TODO confirm header - id: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, - width: { max: "1fr", min: "136px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSampleEntityType, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, - width: { max: "1fr", min: "148px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenOrgan, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, - id: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenOrganPart, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, - id: HCA_DCP_CATEGORY_KEY.ORGAN_PART, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSampleModelOrgan, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, - id: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedCellSuspensionSelectedCellType, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, - id: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolLibraryConstructionApproach, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, - id: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, - width: { max: "1fr", min: "126px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolNucleicAcidSource, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, - id: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregatedProtocolPairedEnd, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.PAIRED_END, - id: HCA_DCP_CATEGORY_KEY.PAIRED_END, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolWorkflow, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.WORKFLOW, - id: HCA_DCP_CATEGORY_KEY.WORKFLOW, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenDisease, - } as ComponentConfig, - header: "Disease (Specimen)", - id: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, - width: { max: "1fr", min: "146px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorDisease, - } as ComponentConfig, - header: "Disease (Donor)", - id: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, - width: { max: "1fr", min: "128px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorDevelopmentStage, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, - id: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, - width: { max: "1fr", min: "148px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregatedDonorCount, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.DONOR_COUNT, - id: HCA_DCP_CATEGORY_KEY.DONOR_COUNT, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildEstimateCellCount, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.EFFECTIVE_CELL_COUNT, - id: HCA_DCP_CATEGORY_KEY.EFFECTIVE_CELL_COUNT, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregateSubmissionDate, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.AGGREGATE_SUBMISSION_DATE, - id: HCA_DCP_CATEGORY_KEY.AGGREGATE_SUBMISSION_DATE, - width: { max: "1fr", min: "224px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregateLastModifiedDate, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.AGGREGATE_LAST_MODIFIED_DATE, - id: HCA_DCP_CATEGORY_KEY.AGGREGATE_LAST_MODIFIED_DATE, - width: { max: "1fr", min: "224px" }, - }, - ], - tableOptions: { - initialState: { - columnVisibility: { - [HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE]: false, - [HCA_DCP_CATEGORY_KEY.ORGAN_PART]: false, - [HCA_DCP_CATEGORY_KEY.MODEL_ORGAN]: false, - [HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE]: false, - [HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE]: false, - [HCA_DCP_CATEGORY_KEY.PAIRED_END]: false, - [HCA_DCP_CATEGORY_KEY.WORKFLOW]: false, - [HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE]: false, - [HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE]: false, - [HCA_DCP_CATEGORY_KEY.DONOR_COUNT]: false, - [HCA_DCP_CATEGORY_KEY.AGGREGATE_SUBMISSION_DATE]: false, - }, - sorting: [ - { - desc: SORT_DIRECTION.DESCENDING, - id: HCA_DCP_CATEGORY_KEY.AGGREGATE_LAST_MODIFIED_DATE, - }, - ], - }, - }, - } as ListConfig, - overrides: projectEdits, - route: "projects", - ui: { - enableExportButton: true, - enableSummary: true, - enableTabs: true, - slots: { - entityViewSlot, - }, - }, -}; diff --git a/site-config/hca-dcp/dev/index/samplesEntityConfig.ts b/site-config/hca-dcp/dev/index/samplesEntityConfig.ts deleted file mode 100644 index f7ca28ec8..000000000 --- a/site-config/hca-dcp/dev/index/samplesEntityConfig.ts +++ /dev/null @@ -1,224 +0,0 @@ -import { - ComponentConfig, - EntityConfig, - ListConfig, - SORT_DIRECTION, -} from "@databiosphere/findable-ui/lib/config/entities"; -import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMode/types"; -import { SamplesResponse } 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"; -import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL } from "../../category"; -import { entityViewSlot } from "../ui/entityView"; - -/** - * Entity config object responsible to config anything related to the /samples route. - */ -export const samplesEntityConfig: EntityConfig = { - apiPath: "index/samples", - detail: { - detailOverviews: [], - staticLoad: false, - tabs: [], - top: [], - }, - exploreMode: EXPLORE_MODE.SS_FETCH_SS_FILTERING, - label: "Samples", - list: { - columns: [ - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildSampleId, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ID, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, - width: { max: "1fr", min: "120px" }, - }, - { - componentConfig: { - component: C.Link, - viewBuilder: V.buildAggregatedProjectTitle, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, - id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, - width: { max: "2fr", min: "240px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorGenusSpecies, - } as ComponentConfig, - header: "Species", // TODO review header - id: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildSampleEntityType, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SAMPLE_TYPE, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenOrgan, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, - id: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenOrganPart, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, - id: HCA_DCP_CATEGORY_KEY.ORGAN_PART, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildSampleModelOrgan, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, - id: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedCellSuspensionSelectedCellType, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, - id: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolLibraryConstructionApproach, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, - id: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolNucleicAcidSource, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, - id: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregatedProtocolPairedEnd, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.PAIRED_END, - id: HCA_DCP_CATEGORY_KEY.PAIRED_END, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedProtocolWorkflow, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.WORKFLOW, - id: HCA_DCP_CATEGORY_KEY.WORKFLOW, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorOrganismAge, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.ORGANISM_AGE, - id: HCA_DCP_CATEGORY_KEY.ORGANISM_AGE, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildAggregatedDonorBiologicalSex, - } as ComponentConfig, - header: "Sex", - id: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedSpecimenDisease, - } as ComponentConfig, - header: "Disease (Specimen)", - id: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorDisease, - } as ComponentConfig, - header: "Disease (Donor)", // TODO confirm header - id: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, - width: { max: "1fr", min: "124px" }, - }, - { - componentConfig: { - component: C.NTagCell, - viewBuilder: V.buildAggregatedDonorDevelopmentStage, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, - id: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, - width: { max: "1fr", min: "148px" }, - }, - { - componentConfig: { - component: C.BasicCell, - viewBuilder: V.buildTotalCells, - } as ComponentConfig, - header: HCA_DCP_CATEGORY_LABEL.CELL_COUNT, - id: HCA_DCP_CATEGORY_KEY.CELL_COUNT, - width: { max: "1fr", min: "124px" }, - }, - ], - tableOptions: { - initialState: { - columnVisibility: { - [HCA_DCP_CATEGORY_KEY.ORGAN_PART]: false, - [HCA_DCP_CATEGORY_KEY.MODEL_ORGAN]: false, - [HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE]: false, - [HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE]: false, - [HCA_DCP_CATEGORY_KEY.PAIRED_END]: false, - [HCA_DCP_CATEGORY_KEY.WORKFLOW]: false, - [HCA_DCP_CATEGORY_KEY.ORGANISM_AGE]: false, - [HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX]: false, - [HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE]: false, - [HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE]: false, - }, - sorting: [ - { - desc: SORT_DIRECTION.ASCENDING, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, - }, - ], - }, - }, - } as ListConfig, - route: "samples", - ui: { - enableExportButton: true, - enableSummary: true, - enableTabs: true, - slots: { - entityViewSlot, - }, - }, -}; diff --git a/site-config/hca-dcp/dev/ui/entityView.ts b/site-config/hca-dcp/dev/ui/entityView.ts deleted file mode 100644 index 04d07d4f3..000000000 --- a/site-config/hca-dcp/dev/ui/entityView.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { - ComponentConfig, - ComponentsConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; -import * as C from "../../../../app/components"; - -export const entityViewSlot: ComponentsConfig = [ - { - component: C.TerraSetUpForm, - } as ComponentConfig, -]; diff --git a/site-config/hca-dcp/ma-dev/authentication/authentication.ts b/site-config/hca-dcp/ma-dev/authentication/authentication.ts index 8d5e676bc..102459be8 100644 --- a/site-config/hca-dcp/ma-dev/authentication/authentication.ts +++ b/site-config/hca-dcp/ma-dev/authentication/authentication.ts @@ -1,12 +1,20 @@ -import { AuthenticationConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import * as MDX from "../../../../app/components/common/MDXContent/hca-dcp"; +import { SiteConfig } from "../../../common/entities"; import { getGoogleProvider, TERRA_SERVICE } from "./constants"; -export function getAuthenticationConfig( - authenticationConfig: AuthenticationConfig, +/** + * Returns the authentication config for HCA DCP MA-DEV environment. + * @param dataSourceUrl - Data source URL. + * @returns - Updated authentication config. + */ +export function getAuthentication( dataSourceUrl: string -): AuthenticationConfig { - const authentication = { ...authenticationConfig }; - authentication.providers = [getGoogleProvider(dataSourceUrl)]; - authentication.services = [TERRA_SERVICE]; - return authentication; +): SiteConfig["authentication"] { + return { + providers: [getGoogleProvider(dataSourceUrl)], + services: [TERRA_SERVICE], + termsOfService: MDX.LoginTermsOfService({}), + text: MDX.LoginText({}), + title: "Sign in to your account", + }; } diff --git a/site-config/hca-dcp/ma-dev/authentication/constants.ts b/site-config/hca-dcp/ma-dev/authentication/constants.ts index 50248abbd..44eb96c06 100644 --- a/site-config/hca-dcp/ma-dev/authentication/constants.ts +++ b/site-config/hca-dcp/ma-dev/authentication/constants.ts @@ -22,8 +22,7 @@ export function getGoogleProvider( return { ...GOOGLE_SIGN_IN_PROVIDER, ...OAUTH_GOOGLE_SIGN_IN, - // Relies on dataSourceUrl having a trailing slash (set as `${dataUrl}/` in dev/config.ts). - authorize: `${dataSourceUrl}user/authorize`, + authorize: `${dataSourceUrl}/user/authorize`, clientId: CLIENT_ID, flow: OAUTH_FLOW.AUTHORIZATION_CODE, }; diff --git a/site-config/hca-dcp/ma-dev/categoryGroup/categoryGroupConfig.ts b/site-config/hca-dcp/ma-dev/categoryGroup/categoryGroupConfig.ts new file mode 100644 index 000000000..86c0d1451 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/categoryGroup/categoryGroupConfig.ts @@ -0,0 +1,171 @@ +import { CategoryConfig } from "@databiosphere/findable-ui/lib/common/categories/config/types"; +import { mapSelectCategoryValue } from "../../../../app/config/utils"; +import { SiteConfig } from "../../../common/entities"; +import { HCA_DCP_CATEGORY_KEY, HCA_DCP_CATEGORY_LABEL } from "../../category"; +import { mapAccessibleValue, mapDataUseRestrictionValue } from "./utils"; + +export const CATEGORY_CONFIG: Record = { + ACCESSIBLE: { + key: HCA_DCP_CATEGORY_KEY.ACCESSIBLE, + label: HCA_DCP_CATEGORY_LABEL.ACCESSIBLE, + mapSelectCategoryValue: mapSelectCategoryValue(mapAccessibleValue), + }, + BIOLOGICAL_SEX: { + key: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, + label: HCA_DCP_CATEGORY_LABEL.BIOLOGICAL_SEX, + }, + BIONETWORK_NAME: { + key: HCA_DCP_CATEGORY_KEY.BIONETWORK_NAME, + label: HCA_DCP_CATEGORY_LABEL.BIONETWORK_NAME, + }, + CONTACT_NAME: { + chart: { enable: false }, + key: HCA_DCP_CATEGORY_KEY.CONTACT_NAME, + label: HCA_DCP_CATEGORY_LABEL.CONTACT_NAME, + }, + CONTENT_DESCRIPTION: { + key: HCA_DCP_CATEGORY_KEY.CONTENT_DESCRIPTION, + label: HCA_DCP_CATEGORY_LABEL.CONTENT_DESCRIPTION, + }, + DATA_USE_RESTRICTION: { + key: HCA_DCP_CATEGORY_KEY.DATA_USE_RESTRICTION, + label: HCA_DCP_CATEGORY_LABEL.DATA_USE_RESTRICTION, + mapSelectCategoryValue: mapSelectCategoryValue(mapDataUseRestrictionValue), + }, + DEVELOPMENT_STAGE: { + chart: { enable: false }, + key: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, + label: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, + }, + DONOR_DISEASE: { + chart: { enable: false }, + key: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, + label: HCA_DCP_CATEGORY_LABEL.DONOR_DISEASE, + }, + FILE_FORMAT: { + key: HCA_DCP_CATEGORY_KEY.FILE_FORMAT, + label: HCA_DCP_CATEGORY_LABEL.FILE_FORMAT, + }, + FILE_SOURCE: { + key: HCA_DCP_CATEGORY_KEY.FILE_SOURCE, + label: HCA_DCP_CATEGORY_LABEL.FILE_SOURCE, + }, + GENUS_SPECIES: { + key: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, + label: HCA_DCP_CATEGORY_LABEL.GENUS_SPECIES, + }, + INSTITUTION: { + chart: { enable: false }, + key: HCA_DCP_CATEGORY_KEY.INSTITUTION, + label: HCA_DCP_CATEGORY_LABEL.INSTITUTION, + }, + INSTRUMENT_MANUFACTURER_MODEL: { + key: HCA_DCP_CATEGORY_KEY.INSTRUMENT_MANUFACTURER_MODEL, + label: HCA_DCP_CATEGORY_LABEL.INSTRUMENT_MANUFACTURER_MODEL, + }, + LIBRARY_CONSTRUCTION_APPROACH: { + key: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, + label: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, + }, + MODEL_ORGAN: { + key: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, + label: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, + }, + NUCLEIC_ACID_SOURCE: { + key: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, + label: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, + }, + ORGAN_PART: { + key: HCA_DCP_CATEGORY_KEY.ORGAN_PART, + label: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, + }, + PAIRED_END: { + key: HCA_DCP_CATEGORY_KEY.PAIRED_END, + label: HCA_DCP_CATEGORY_LABEL.PAIRED_END, + }, + PRESERVATION_METHOD: { + key: HCA_DCP_CATEGORY_KEY.PRESERVATION_METHOD, + label: HCA_DCP_CATEGORY_LABEL.PRESERVATION_METHOD, + }, + PROJECT_TITLE: { + chart: { enable: false }, + key: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, + label: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, + }, + SAMPLE_ENTITY_TYPE: { + key: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, + label: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, + }, + SELECTED_CELL_TYPE: { + key: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, + label: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, + }, + SPECIMEN_DISEASE: { + key: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, + label: HCA_DCP_CATEGORY_LABEL.SPECIMEN_DISEASE, + }, + SPECIMEN_ORGAN: { + key: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, + label: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, + }, + WORKFLOW: { + key: HCA_DCP_CATEGORY_KEY.ANALYSIS_PROTOCOL, + label: HCA_DCP_CATEGORY_LABEL.ANALYSIS_PROTOCOL, + }, +} as const; + +export const CATEGORY_GROUP_CONFIG: SiteConfig["categoryGroupConfig"] = { + categoryGroups: [ + { + categoryConfigs: [ + CATEGORY_CONFIG.PROJECT_TITLE, + CATEGORY_CONFIG.CONTACT_NAME, + CATEGORY_CONFIG.INSTITUTION, + CATEGORY_CONFIG.BIONETWORK_NAME, + CATEGORY_CONFIG.ACCESSIBLE, + CATEGORY_CONFIG.DATA_USE_RESTRICTION, + ], + label: "Project", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.BIOLOGICAL_SEX, + CATEGORY_CONFIG.DEVELOPMENT_STAGE, + CATEGORY_CONFIG.DONOR_DISEASE, + CATEGORY_CONFIG.GENUS_SPECIES, + ], + label: "Donor", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.SPECIMEN_ORGAN, + CATEGORY_CONFIG.ORGAN_PART, + CATEGORY_CONFIG.PRESERVATION_METHOD, + CATEGORY_CONFIG.MODEL_ORGAN, + CATEGORY_CONFIG.SAMPLE_ENTITY_TYPE, + CATEGORY_CONFIG.SELECTED_CELL_TYPE, + CATEGORY_CONFIG.SPECIMEN_DISEASE, + ], + label: "Sample", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.WORKFLOW, + CATEGORY_CONFIG.INSTRUMENT_MANUFACTURER_MODEL, + CATEGORY_CONFIG.LIBRARY_CONSTRUCTION_APPROACH, + CATEGORY_CONFIG.NUCLEIC_ACID_SOURCE, + CATEGORY_CONFIG.PAIRED_END, + ], + label: "Protocol", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.CONTENT_DESCRIPTION, + CATEGORY_CONFIG.FILE_FORMAT, + CATEGORY_CONFIG.FILE_SOURCE, + ], + label: "File", + }, + ], + key: "hca-dcp", +}; diff --git a/site-config/hca-dcp/cc-ma-dev/index/common/utils.ts b/site-config/hca-dcp/ma-dev/categoryGroup/utils.ts similarity index 100% rename from site-config/hca-dcp/cc-ma-dev/index/common/utils.ts rename to site-config/hca-dcp/ma-dev/categoryGroup/utils.ts diff --git a/site-config/hca-dcp/ma-dev/config.ts b/site-config/hca-dcp/ma-dev/config.ts index 1c123e0af..cdeaf419a 100644 --- a/site-config/hca-dcp/ma-dev/config.ts +++ b/site-config/hca-dcp/ma-dev/config.ts @@ -1,32 +1,80 @@ +import { APIEndpoints } from "@databiosphere/findable-ui/lib/apis/azul/common/entities"; +import { FILTER_SORT } from "@databiosphere/findable-ui/lib/common/filters/sort/config/types"; +import { SystemStatusBindResponseFn } from "@databiosphere/findable-ui/lib/config/entities"; +import { bindSystemStatusResponse } from "../../../app/viewModelBuilders/azul/common/systemStatusMapper/systemStatusMapper"; import { GIT_HUB_REPO_URL } from "../../common/constants"; import { SiteConfig } from "../../common/entities"; -import { makeManagedAccessConfig } from "../cc-ma-dev/config"; -import { makeConfig } from "../dev/config"; -import { getAuthenticationConfig } from "./authentication/authentication"; +import { getAuthentication } from "./authentication/authentication"; +import { CATEGORY_GROUP_CONFIG } from "./categoryGroup/categoryGroupConfig"; +import { ENTITIES } from "./entities/entities"; +import { EXPORT } from "./export/export"; +import { getLayout } from "./layout/layout"; +import { SUMMARY } from "./summary/summary"; +import { THEME_OPTIONS } from "./themeOptions/themeOptions"; -// Template constants +const APP_TITLE = "HCA Data Explorer"; const BROWSER_URL = "https://explore.dev.singlecell.gi.ucsc.edu"; const CATALOG = "dcp3"; export const DATA_URL = "https://service.dev.singlecell.gi.ucsc.edu"; -export const PORTAL_URL = "https://dev.singlecell.gi.ucsc.edu"; +const EXPORT_TO_TERRA_URL = "https://app.terra.bio"; +const PAGINATION_PAGE_SIZE = "25"; +export const PORTAL_URL = "https://data.humancellatlas.dev.clevercanary.com"; +const REDIRECT_ROOT_TO_PATH = "/projects"; -const config: SiteConfig = { - ...makeManagedAccessConfig( - makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL, GIT_HUB_REPO_URL, CATALOG) - ), -}; - -// Removing analytics from the config. -if (config.analytics) { - config.analytics = undefined; +/** + * Returns the config for the HCA DCP MA-DEV environment. + * @param browserUrl - Browser URL. + * @param portalUrl - Portal URL. + * @param dataUrl - Data URL. + * @param gitHubUrl - GitHub URL. + * @param catalog - Catalog. + * @param authentication - Authentication config. + * @returns Config for the HCA DCP MA-DEV environment. + */ +export function makeConfig( + browserUrl: string, + portalUrl: string, + dataUrl: string, + gitHubUrl: string, + catalog: string, + authentication: SiteConfig["authentication"] +): SiteConfig { + return { + analytics: undefined, + appTitle: APP_TITLE, + authentication, + browserURL: browserUrl, + categoryGroupConfig: CATEGORY_GROUP_CONFIG, + dataSource: { + defaultListParams: { size: PAGINATION_PAGE_SIZE }, + defaultParams: { catalog }, + url: `${dataUrl}/`, + }, + enableEntitiesView: true, + entities: ENTITIES, + export: EXPORT, + exportToTerraUrl: EXPORT_TO_TERRA_URL, + filterSort: { sortBy: FILTER_SORT.COUNT }, + gitHubUrl, + layout: getLayout(APP_TITLE, portalUrl), + portalURL: portalUrl, + redirectRootToPath: REDIRECT_ROOT_TO_PATH, + summaryConfig: SUMMARY, + systemStatus: { + apiPath: `${dataUrl}${APIEndpoints.INDEX_STATUS}`, + bindResponse: bindSystemStatusResponse, + }, + themeOptions: THEME_OPTIONS, + }; } -// Update authentication for the dev environment (authorization code flow). -if (config.authentication) { - config.authentication = getAuthenticationConfig( - config.authentication, - config.dataSource.url - ); -} +const config = makeConfig( + BROWSER_URL, + PORTAL_URL, + DATA_URL, + GIT_HUB_REPO_URL, + CATALOG, + getAuthentication(DATA_URL) +); export default config; diff --git a/site-config/hca-dcp/ma-dev/entities/common/detail/detail.ts b/site-config/hca-dcp/ma-dev/entities/common/detail/detail.ts new file mode 100644 index 000000000..5fb128583 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/common/detail/detail.ts @@ -0,0 +1,8 @@ +import { EntityConfig } from "@databiosphere/findable-ui/lib/config/entities"; + +export const DETAIL: EntityConfig["detail"] = { + detailOverviews: [], + staticLoad: false, + tabs: [], + top: [], +}; diff --git a/site-config/hca-dcp/ma-dev/entities/common/ui/slots.ts b/site-config/hca-dcp/ma-dev/entities/common/ui/slots.ts new file mode 100644 index 000000000..ef8ec6535 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/common/ui/slots.ts @@ -0,0 +1,13 @@ +import { + ComponentConfig, + EntityUIConfig, +} from "@databiosphere/findable-ui/lib/config/entities"; +import * as C from "../../../../../../app/components"; + +export const SLOTS: EntityUIConfig["slots"] = { + entityViewSlot: [ + { + component: C.TerraSetUpForm, + } as ComponentConfig, + ], +}; diff --git a/site-config/hca-dcp/ma-dev/entities/common/ui/ui.ts b/site-config/hca-dcp/ma-dev/entities/common/ui/ui.ts new file mode 100644 index 000000000..9c5e948fd --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/common/ui/ui.ts @@ -0,0 +1,9 @@ +import { EntityUIConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import { SLOTS } from "./slots"; + +export const UI: EntityUIConfig = { + enableExportButton: true, + enableSummary: true, + enableTabs: true, + slots: SLOTS, +}; diff --git a/site-config/hca-dcp/ma-dev/entities/entities.ts b/site-config/hca-dcp/ma-dev/entities/entities.ts new file mode 100644 index 000000000..0e1fbe756 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/entities.ts @@ -0,0 +1,10 @@ +import { SiteConfig } from "../../../common/entities"; +import { filesEntityConfig } from "./files/filesEntityConfig"; +import { projectsEntityConfig } from "./projects/projectsEntityConfig"; +import { samplesEntityConfig } from "./samples/samplesEntityConfig"; + +export const ENTITIES: SiteConfig["entities"] = [ + projectsEntityConfig, + samplesEntityConfig, + filesEntityConfig, +]; diff --git a/site-config/hca-dcp/ma-dev/entities/files/columns.ts b/site-config/hca-dcp/ma-dev/entities/files/columns.ts new file mode 100644 index 000000000..f74d2f9ad --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/files/columns.ts @@ -0,0 +1,293 @@ +import { + ColumnConfig, + ComponentConfig, + EntityConfig, +} from "@databiosphere/findable-ui/lib/config/entities"; +import { FilesResponse } 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"; +import { + HCA_DCP_CATEGORY_KEY, + HCA_DCP_CATEGORY_LABEL, +} from "../../../category"; + +const AZUL_FILE_DOWNLOAD: ColumnConfig = { + componentConfig: { + component: C.AzulFileDownload, + viewBuilder: V.buildFileDownload, + } as ComponentConfig, + enableHiding: false, + enableSorting: false, + header: HCA_DCP_CATEGORY_LABEL.AZUL_FILE_DOWNLOAD, + id: HCA_DCP_CATEGORY_KEY.AZUL_FILE_DOWNLOAD, + width: { max: "auto", min: "76px" }, +}; + +const BIOLOGICAL_SEX: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregatedDonorBiologicalSex, + } as ComponentConfig, + header: "Sex", + id: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, + width: { max: "1fr", min: "120px" }, +}; + +const CELL_COUNT: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildTotalCells, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.CELL_COUNT, + id: HCA_DCP_CATEGORY_KEY.CELL_COUNT, + width: { max: "1fr", min: "124px" }, +}; + +const CONTENT_DESCRIPTION: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildFileContentDescriptions, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.CONTENT_DESCRIPTION, + id: HCA_DCP_CATEGORY_KEY.CONTENT_DESCRIPTION, + width: { max: "1fr", min: "124px" }, +}; + +const DATA_USE_RESTRICTION: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDataUseRestriction, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.DATA_USE_RESTRICTION, + id: HCA_DCP_CATEGORY_KEY.DATA_USE_RESTRICTION, + width: { max: "1fr", min: "124px" }, +}; + +const DEVELOPMENT_STAGE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorDevelopmentStage, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, + id: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, + width: { max: "1fr", min: "148px" }, +}; + +const DONOR_DISEASE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorDisease, + } as ComponentConfig, + header: "Disease (Donor)", + id: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, + width: { max: "1fr", min: "120px" }, +}; + +const FILE_FORMAT: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildFileFormat, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.FILE_FORMAT, + id: HCA_DCP_CATEGORY_KEY.FILE_FORMAT, + width: { max: "1fr", min: "120px" }, +}; + +const FILE_NAME: ColumnConfig = { + columnPinned: true, + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildFileName, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.FILE_NAME, + id: HCA_DCP_CATEGORY_KEY.FILE_NAME, + width: { max: "2fr", min: "240px" }, +}; + +const FILE_SIZE: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildFileSize, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.FILE_SIZE, + id: HCA_DCP_CATEGORY_KEY.FILE_SIZE, + width: { max: "1fr", min: "120px" }, +}; + +const FILE_SOURCE: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildFileSource, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.FILE_SOURCE, + id: HCA_DCP_CATEGORY_KEY.FILE_SOURCE, + width: { max: "1fr", min: "120px" }, +}; + +const GENUS_SPECIES: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorGenusSpecies, + } as ComponentConfig, + header: "Species", + id: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, + width: { max: "1fr", min: "120px" }, +}; + +const LIBRARY_CONSTRUCTION_APPROACH: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolLibraryConstructionApproach, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, + id: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, + width: { max: "1fr", min: "120px" }, +}; + +const MODEL_ORGAN: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSampleModelOrgan, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, + id: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, + width: { max: "1fr", min: "120px" }, +}; + +const NUCLEIC_ACID_SOURCE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolNucleicAcidSource, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, + id: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, + width: { max: "1fr", min: "120px" }, +}; + +const ORGANISM_AGE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorOrganismAge, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.ORGANISM_AGE, + id: HCA_DCP_CATEGORY_KEY.ORGANISM_AGE, + width: { max: "1fr", min: "120px" }, +}; + +const ORGAN_PART: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenOrganPart, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, + id: HCA_DCP_CATEGORY_KEY.ORGAN_PART, + width: { max: "1fr", min: "120px" }, +}; + +const PAIRED_END: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregatedProtocolPairedEnd, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.PAIRED_END, + id: HCA_DCP_CATEGORY_KEY.PAIRED_END, + width: { max: "1fr", min: "120px" }, +}; + +const PROJECT_TITLE: ColumnConfig = { + componentConfig: { + component: C.Link, + viewBuilder: V.buildAggregatedProjectTitle, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, + id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, + width: { max: "2fr", min: "240px" }, +}; + +const SAMPLE_ENTITY_TYPE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSampleEntityType, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, + id: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, + width: { max: "1fr", min: "120px" }, +}; + +const SAMPLE_ID: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSampleId, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ID, + id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, + width: { max: "1fr", min: "120px" }, +}; + +const SELECTED_CELL_TYPE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedCellSuspensionSelectedCellType, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, + id: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, + width: { max: "1fr", min: "120px" }, +}; + +const SPECIMEN_DISEASE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenDisease, + } as ComponentConfig, + header: "Disease (Specimen)", + id: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, + width: { max: "1fr", min: "120px" }, +}; + +const SPECIMEN_ORGAN: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenOrgan, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SPECIMEN_ORGAN, + id: HCA_DCP_CATEGORY_KEY.SPECIMEN_ORGAN, + width: { max: "1fr", min: "120px" }, +}; + +const WORKFLOW: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolWorkflow, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.WORKFLOW, + id: HCA_DCP_CATEGORY_KEY.WORKFLOW, + width: { max: "1fr", min: "120px" }, +}; + +export const COLUMNS: EntityConfig["list"]["columns"] = [ + AZUL_FILE_DOWNLOAD, + FILE_NAME, + DATA_USE_RESTRICTION, + FILE_FORMAT, + FILE_SIZE, + WORKFLOW, + CONTENT_DESCRIPTION, + FILE_SOURCE, + PROJECT_TITLE, + SAMPLE_ID, + GENUS_SPECIES, + SAMPLE_ENTITY_TYPE, + SPECIMEN_ORGAN, + ORGAN_PART, + MODEL_ORGAN, + SELECTED_CELL_TYPE, + LIBRARY_CONSTRUCTION_APPROACH, + NUCLEIC_ACID_SOURCE, + PAIRED_END, + ORGANISM_AGE, + BIOLOGICAL_SEX, + SPECIMEN_DISEASE, + DONOR_DISEASE, + DEVELOPMENT_STAGE, + CELL_COUNT, +]; diff --git a/site-config/hca-dcp/ma-dev/entities/files/filesEntityConfig.ts b/site-config/hca-dcp/ma-dev/entities/files/filesEntityConfig.ts new file mode 100644 index 000000000..5676d8f50 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/files/filesEntityConfig.ts @@ -0,0 +1,20 @@ +import { EntityConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMode/types"; +import { FilesResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; +import { DETAIL } from "../common/detail/detail"; +import { UI } from "../common/ui/ui"; +import { COLUMNS } from "./columns"; +import { TABLE_OPTIONS } from "./tableOptions"; + +/** + * Entity config object responsible to config anything related to the /files route. + */ +export const filesEntityConfig: EntityConfig = { + apiPath: "index/files", + detail: DETAIL, + exploreMode: EXPLORE_MODE.SS_FETCH_SS_FILTERING, + label: "Files", + list: { columns: COLUMNS, tableOptions: TABLE_OPTIONS }, + route: "files", + ui: UI, +}; diff --git a/site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts b/site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts new file mode 100644 index 000000000..b5454e0a5 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts @@ -0,0 +1,37 @@ +import { + EntityConfig, + SORT_DIRECTION, +} from "@databiosphere/findable-ui/lib/config/entities"; +import { FilesResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; +import { HCA_DCP_CATEGORY_KEY } from "../../../category"; + +export const TABLE_OPTIONS: EntityConfig["list"]["tableOptions"] = + { + initialState: { + columnVisibility: { + [HCA_DCP_CATEGORY_KEY.FILE_FORMAT]: false, + [HCA_DCP_CATEGORY_KEY.FILE_SOURCE]: false, + [HCA_DCP_CATEGORY_KEY.SAMPLE_ID]: false, + [HCA_DCP_CATEGORY_KEY.GENUS_SPECIES]: false, + [HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE]: false, + [HCA_DCP_CATEGORY_KEY.SPECIMEN_ORGAN]: false, + [HCA_DCP_CATEGORY_KEY.ORGAN_PART]: false, + [HCA_DCP_CATEGORY_KEY.MODEL_ORGAN]: false, + [HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE]: false, + [HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD]: false, + [HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE]: false, + [HCA_DCP_CATEGORY_KEY.PAIRED_END]: false, + [HCA_DCP_CATEGORY_KEY.ORGANISM_AGE]: false, + [HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX]: false, + [HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE]: false, + [HCA_DCP_CATEGORY_KEY.DONOR_DISEASE]: false, + [HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE]: false, + }, + sorting: [ + { + desc: SORT_DIRECTION.ASCENDING, + id: HCA_DCP_CATEGORY_KEY.FILE_NAME, + }, + ], + }, + }; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/columns.ts b/site-config/hca-dcp/ma-dev/entities/projects/columns.ts new file mode 100644 index 000000000..a33eabc0f --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/columns.ts @@ -0,0 +1,247 @@ +import { + ColumnConfig, + ComponentConfig, + EntityConfig, +} 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"; +import { + HCA_DCP_CATEGORY_KEY, + HCA_DCP_CATEGORY_LABEL, +} from "../../../category"; + +const ACCESSIBLE: ColumnConfig = { + componentConfig: { + component: C.StatusBadge, + viewBuilder: V.buildProjectAccess, + } as ComponentConfig, + enableSorting: false, + header: HCA_DCP_CATEGORY_LABEL.ACCESSIBLE, + id: HCA_DCP_CATEGORY_KEY.ACCESSIBLE, + width: "auto", +}; + +const AGGREGATE_LAST_MODIFIED_DATE: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregateLastModifiedDate, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.AGGREGATE_LAST_MODIFIED_DATE, + id: HCA_DCP_CATEGORY_KEY.AGGREGATE_LAST_MODIFIED_DATE, + width: { max: "1fr", min: "224px" }, +}; + +const AGGREGATE_SUBMISSION_DATE: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregateSubmissionDate, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.AGGREGATE_SUBMISSION_DATE, + id: HCA_DCP_CATEGORY_KEY.AGGREGATE_SUBMISSION_DATE, + width: { max: "1fr", min: "224px" }, +}; + +const BIONETWORK_NAME: ColumnConfig = { + componentConfig: { + component: C.BioNetworkCell, + viewBuilder: V.buildBioNetwork, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.BIONETWORK_NAME, + id: HCA_DCP_CATEGORY_KEY.BIONETWORK_NAME, + width: { max: "1fr", min: "126px" }, +}; + +const DATA_USE_RESTRICTION: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildDataUseRestriction, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.DATA_USE_RESTRICTION, + id: HCA_DCP_CATEGORY_KEY.DATA_USE_RESTRICTION, + width: { max: "1fr", min: "124px" }, +}; + +const DEVELOPMENT_STAGE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorDevelopmentStage, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, + id: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, + width: { max: "1fr", min: "148px" }, +}; + +const DONOR_COUNT: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregatedDonorCount, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.DONOR_COUNT, + id: HCA_DCP_CATEGORY_KEY.DONOR_COUNT, + width: { max: "1fr", min: "124px" }, +}; + +const DONOR_DISEASE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorDisease, + } as ComponentConfig, + header: "Disease (Donor)", + id: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, + width: { max: "1fr", min: "128px" }, +}; + +const EFFECTIVE_CELL_COUNT: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildEstimateCellCount, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.EFFECTIVE_CELL_COUNT, + id: HCA_DCP_CATEGORY_KEY.EFFECTIVE_CELL_COUNT, + width: { max: "1fr", min: "124px" }, +}; + +const GENUS_SPECIES: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorGenusSpecies, + } as ComponentConfig, + header: "Species", + id: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, + width: { max: "1fr", min: "136px" }, +}; + +const LIBRARY_CONSTRUCTION_APPROACH: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolLibraryConstructionApproach, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, + id: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, + width: { max: "1fr", min: "126px" }, +}; + +const MODEL_ORGAN: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSampleModelOrgan, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, + id: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, + width: { max: "1fr", min: "146px" }, +}; + +const NUCLEIC_ACID_SOURCE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolNucleicAcidSource, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, + id: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, + width: { max: "1fr", min: "146px" }, +}; + +const ORGAN_PART: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenOrganPart, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, + id: HCA_DCP_CATEGORY_KEY.ORGAN_PART, + width: { max: "1fr", min: "146px" }, +}; + +const PAIRED_END: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregatedProtocolPairedEnd, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.PAIRED_END, + id: HCA_DCP_CATEGORY_KEY.PAIRED_END, + width: { max: "1fr", min: "146px" }, +}; + +const PROJECT_TITLE: ColumnConfig = { + componentConfig: { + component: C.Link, + viewBuilder: V.buildProjectTitle, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, + id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, + width: { max: "2fr", min: "374px" }, +}; + +const SAMPLE_ENTITY_TYPE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSampleEntityType, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, + id: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, + width: { max: "1fr", min: "148px" }, +}; + +const SELECTED_CELL_TYPE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedCellSuspensionSelectedCellType, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, + id: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, + width: { max: "1fr", min: "146px" }, +}; + +const SPECIMEN_DISEASE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenDisease, + } as ComponentConfig, + header: "Disease (Specimen)", + id: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, + width: { max: "1fr", min: "146px" }, +}; + +const SPECIMEN_ORGAN: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenOrgan, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, + id: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, + width: { max: "1fr", min: "146px" }, +}; + +const WORKFLOW: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolWorkflow, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.WORKFLOW, + id: HCA_DCP_CATEGORY_KEY.WORKFLOW, + width: { max: "1fr", min: "146px" }, +}; + +export const COLUMNS: EntityConfig["list"]["columns"] = [ + PROJECT_TITLE, + ACCESSIBLE, + DATA_USE_RESTRICTION, + BIONETWORK_NAME, + GENUS_SPECIES, + SAMPLE_ENTITY_TYPE, + SPECIMEN_ORGAN, + ORGAN_PART, + MODEL_ORGAN, + SELECTED_CELL_TYPE, + LIBRARY_CONSTRUCTION_APPROACH, + NUCLEIC_ACID_SOURCE, + PAIRED_END, + WORKFLOW, + SPECIMEN_DISEASE, + DONOR_DISEASE, + DEVELOPMENT_STAGE, + DONOR_COUNT, + EFFECTIVE_CELL_COUNT, + AGGREGATE_SUBMISSION_DATE, + AGGREGATE_LAST_MODIFIED_DATE, +]; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/entity/detail.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/detail.ts new file mode 100644 index 000000000..026b3f8ab --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/detail.ts @@ -0,0 +1,43 @@ +import { EntityConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import { PROJECT_ENTITY_ROUTE } from "./routes"; +import { EXPORT } from "./tab/export"; +import { mainColumn as matricesMainColumn } from "./tab/matricesMainColumn"; +import { METADATA } from "./tab/metadata"; +import { mainColumn as overviewMainColumn } from "./tab/overviewMainColumn"; +import { sideColumn as overviewSideColumn } from "./tab/overviewSideColumn"; +import { PROJECT_FILES } from "./tab/projectFiles"; +import { top } from "./tab/top"; + +export const DETAIL: EntityConfig["detail"] = { + detailOverviews: ["Overview"], + staticLoad: true, + tabs: [ + { + label: "Overview", + mainColumn: overviewMainColumn, + route: PROJECT_ENTITY_ROUTE.OVERVIEW, + sideColumn: overviewSideColumn, + }, + { + label: "Metadata", + mainColumn: METADATA, + route: PROJECT_ENTITY_ROUTE.PROJECT_METADATA, + }, + { + label: "Matrices", + mainColumn: matricesMainColumn, + route: PROJECT_ENTITY_ROUTE.PROJECT_MATRICES, + }, + { + label: "Download", + mainColumn: PROJECT_FILES, + route: PROJECT_ENTITY_ROUTE.GET_CURL_COMMAND, + }, + { + label: "Export", + mainColumn: EXPORT, + route: PROJECT_ENTITY_ROUTE.EXPORT_TO_TERRA, + }, + ], + top: top, +}; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/entity/routes.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/routes.ts new file mode 100644 index 000000000..93054ca86 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/routes.ts @@ -0,0 +1,7 @@ +export const PROJECT_ENTITY_ROUTE = { + EXPORT_TO_TERRA: "export-to-terra", + GET_CURL_COMMAND: "get-curl-command", + OVERVIEW: "", + PROJECT_MATRICES: "project-matrices", + PROJECT_METADATA: "project-metadata", +} as const; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/accessWarning.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/accessWarning.ts new file mode 100644 index 000000000..e7318d654 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/accessWarning.ts @@ -0,0 +1,23 @@ +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 MDX from "../../../../../../../app/components/common/MDXContent/hca-dcp"; +import * as V from "../../../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; + +export const PROJECT_ACCESS_WARNING: ComponentConfig[] = [ + { + children: [ + { + children: [ + { + component: MDX.Alert, + viewBuilder: V.buildAlertExportEntityWarning, + } as ComponentConfig, + ], + component: C.BackPageContentSingleColumn, + } as ComponentConfig, + ], + component: C.ConditionalComponent, + viewBuilder: V.renderExportEntityWarning, + } as ComponentConfig, +]; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/export.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/export.ts new file mode 100644 index 000000000..20fb573c1 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/export.ts @@ -0,0 +1,25 @@ +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"; +import { PROJECT_ACCESS_WARNING } from "./accessWarning"; +import { mainColumn } from "./exportMainColumn"; +import { sideColumn } from "./exportSideColumn"; + +export const EXPORT: ComponentConfig[] = [ + ...PROJECT_ACCESS_WARNING, + { + children: [ + { + children: mainColumn, + component: C.BackPageContentMainColumn, + } as ComponentConfig, + { + children: sideColumn, + component: C.BackPageContentSideColumn, + } as ComponentConfig, + ], + component: C.ConditionalComponent, + viewBuilder: V.renderExportEntity, + } as ComponentConfig, +]; diff --git a/site-config/hca-dcp/dev/detail/project/exportMainColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/exportMainColumn.ts similarity index 66% rename from site-config/hca-dcp/dev/detail/project/exportMainColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/exportMainColumn.ts index e98a99b03..13533e450 100644 --- a/site-config/hca-dcp/dev/detail/project/exportMainColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/exportMainColumn.ts @@ -1,10 +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/hca-dcp"; -import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; +import { ProjectsResponse } from "../../../../../../../app/apis/azul/hca-dcp/common/responses"; +import * as C from "../../../../../../../app/components"; +import * as MDX from "../../../../../../../app/components/common/MDXContent/hca-dcp"; +import * as V from "../../../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; export const mainColumn: ComponentConfig[] = [ { diff --git a/site-config/hca-dcp/dev/detail/project/exportSideColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/exportSideColumn.ts similarity index 87% rename from site-config/hca-dcp/dev/detail/project/exportSideColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/exportSideColumn.ts index e953bc1d1..72540a8d1 100644 --- a/site-config/hca-dcp/dev/detail/project/exportSideColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/exportSideColumn.ts @@ -2,7 +2,7 @@ import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities" import { getExportCurrentQueryAndDataSummary, getExportDataReleasePolicy, -} from "../../export/sideColumn"; +} from "../../../../export/sideColumn"; export const sideColumn: ComponentConfig[] = [ ...getExportCurrentQueryAndDataSummary(), diff --git a/site-config/hca-dcp/dev/detail/project/matricesMainColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/matricesMainColumn.ts similarity index 83% rename from site-config/hca-dcp/dev/detail/project/matricesMainColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/matricesMainColumn.ts index 7c951eb4b..4754cedf5 100644 --- a/site-config/hca-dcp/dev/detail/project/matricesMainColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/matricesMainColumn.ts @@ -1,11 +1,11 @@ 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/hca-dcp"; -import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { getExportDataReleasePolicy } from "../../export/sideColumn"; +import { ProjectsResponse } from "../../../../../../../app/apis/azul/hca-dcp/common/responses"; +import * as C from "../../../../../../../app/components"; +import * as MDX from "../../../../../../../app/components/common/MDXContent/hca-dcp"; +import * as V from "../../../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; +import { getExportDataReleasePolicy } from "../../../../export/sideColumn"; export const mainColumn: ComponentConfig[] = [ { diff --git a/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadata.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadata.ts new file mode 100644 index 000000000..e3ec3b5a5 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadata.ts @@ -0,0 +1,25 @@ +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"; +import { PROJECT_ACCESS_WARNING } from "./accessWarning"; +import { mainColumn } from "./metadataMainColumn"; +import { sideColumn } from "./metadataSideColumn"; + +export const METADATA: ComponentConfig[] = [ + ...PROJECT_ACCESS_WARNING, + { + children: [ + { + children: mainColumn, + component: C.BackPageContentMainColumn, + } as ComponentConfig, + { + children: sideColumn, + component: C.BackPageContentSideColumn, + } as ComponentConfig, + ], + component: C.ConditionalComponent, + viewBuilder: V.renderExportEntity, + } as ComponentConfig, +]; diff --git a/site-config/hca-dcp/dev/detail/project/metadataMainColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadataMainColumn.ts similarity index 53% rename from site-config/hca-dcp/dev/detail/project/metadataMainColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadataMainColumn.ts index 573d6776a..b86bc427d 100644 --- a/site-config/hca-dcp/dev/detail/project/metadataMainColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadataMainColumn.ts @@ -1,7 +1,7 @@ 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"; +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[] = [ { diff --git a/site-config/hca-dcp/dev/detail/project/metadataSideColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadataSideColumn.ts similarity index 87% rename from site-config/hca-dcp/dev/detail/project/metadataSideColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadataSideColumn.ts index e953bc1d1..72540a8d1 100644 --- a/site-config/hca-dcp/dev/detail/project/metadataSideColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/metadataSideColumn.ts @@ -2,7 +2,7 @@ import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities" import { getExportCurrentQueryAndDataSummary, getExportDataReleasePolicy, -} from "../../export/sideColumn"; +} from "../../../../export/sideColumn"; export const sideColumn: ComponentConfig[] = [ ...getExportCurrentQueryAndDataSummary(), diff --git a/site-config/hca-dcp/dev/detail/project/overviewMainColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/overviewMainColumn.ts similarity index 87% rename from site-config/hca-dcp/dev/detail/project/overviewMainColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/overviewMainColumn.ts index b33255355..aba582a69 100644 --- a/site-config/hca-dcp/dev/detail/project/overviewMainColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/overviewMainColumn.ts @@ -1,8 +1,8 @@ import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; import * as C from "app/components"; -import { ProjectsResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; -import * as MDX from "../../../../../app/components/common/MDXContent/hca-dcp"; -import * as V from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; +import { ProjectsResponse } from "../../../../../../../app/apis/azul/hca-dcp/common/responses"; +import * as MDX from "../../../../../../../app/components/common/MDXContent/hca-dcp"; +import * as V from "../../../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; export const mainColumn = [ { diff --git a/site-config/hca-dcp/dev/detail/project/overviewSideColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/overviewSideColumn.ts similarity index 83% rename from site-config/hca-dcp/dev/detail/project/overviewSideColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/overviewSideColumn.ts index c6a84c6a5..5f70c118f 100644 --- a/site-config/hca-dcp/dev/detail/project/overviewSideColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/overviewSideColumn.ts @@ -1,7 +1,7 @@ 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"; +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 = [ { diff --git a/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFiles.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFiles.ts new file mode 100644 index 000000000..238df899b --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFiles.ts @@ -0,0 +1,25 @@ +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"; +import { PROJECT_ACCESS_WARNING } from "./accessWarning"; +import { mainColumn } from "./projectFilesMainColumn"; +import { sideColumn } from "./projectFilesSideColumn"; + +export const PROJECT_FILES: ComponentConfig[] = [ + ...PROJECT_ACCESS_WARNING, + { + children: [ + { + children: mainColumn, + component: C.BackPageContentMainColumn, + } as ComponentConfig, + { + children: sideColumn, + component: C.BackPageContentSideColumn, + } as ComponentConfig, + ], + component: C.ConditionalComponent, + viewBuilder: V.renderExportEntity, + } as ComponentConfig, +]; diff --git a/site-config/hca-dcp/dev/detail/project/projectFilesMainColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFilesMainColumn.ts similarity index 53% rename from site-config/hca-dcp/dev/detail/project/projectFilesMainColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFilesMainColumn.ts index e3ba03d3f..a7c478d13 100644 --- a/site-config/hca-dcp/dev/detail/project/projectFilesMainColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFilesMainColumn.ts @@ -1,7 +1,7 @@ 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"; +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[] = [ { diff --git a/site-config/hca-dcp/dev/detail/project/projectFilesSideColumn.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFilesSideColumn.ts similarity index 87% rename from site-config/hca-dcp/dev/detail/project/projectFilesSideColumn.ts rename to site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFilesSideColumn.ts index e953bc1d1..72540a8d1 100644 --- a/site-config/hca-dcp/dev/detail/project/projectFilesSideColumn.ts +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/projectFilesSideColumn.ts @@ -2,7 +2,7 @@ import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities" import { getExportCurrentQueryAndDataSummary, getExportDataReleasePolicy, -} from "../../export/sideColumn"; +} from "../../../../export/sideColumn"; export const sideColumn: ComponentConfig[] = [ ...getExportCurrentQueryAndDataSummary(), diff --git a/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/top.ts b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/top.ts new file mode 100644 index 000000000..d14d24975 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/entity/tab/top.ts @@ -0,0 +1,27 @@ +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 { Stack } from "../../../../../../../app/components/Detail/components/AccessibilityBadge/components/Stack/stack"; +import * as V from "../../../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; + +export const top: ComponentConfig[] = [ + { + children: [ + { + children: [ + { + component: C.DXAccessibilityBadge, + viewBuilder: V.buildProjectAccessibilityBadge, + } as ComponentConfig, + { + component: C.SubTitle, + viewBuilder: V.buildAggregatedDateLastModifiedDate, + } as ComponentConfig, + ], + component: Stack, + } as ComponentConfig, + ], + component: C.BackPageHero, + viewBuilder: V.buildMAHero, + } as ComponentConfig, +]; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/projectsEntityConfig.ts b/site-config/hca-dcp/ma-dev/entities/projects/projectsEntityConfig.ts new file mode 100644 index 000000000..bcbdcbd2a --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/projectsEntityConfig.ts @@ -0,0 +1,27 @@ +import { EntityConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMode/types"; +import { + getProjectId, + getTitle, +} from "../../../../../app/apis/azul/hca-dcp/common/utils"; +import { projectEdits } from "../../../../../app/viewModelBuilders/azul/hca-dcp/common/projectMapper/projectEdits/projectEdits"; +import { COLUMNS } from "./columns"; +import { DETAIL } from "./entity/detail"; +import { TABLE_OPTIONS } from "./tableOptions"; +import { UI } from "./ui/ui"; + +/** + * Entity config object responsible to config anything related to the /projects route. + */ +export const projectsEntityConfig: EntityConfig = { + apiPath: "index/projects", + detail: DETAIL, + exploreMode: EXPLORE_MODE.SS_FETCH_SS_FILTERING, + getId: getProjectId, + getTitle: getTitle, + label: "Projects", + list: { columns: COLUMNS, tableOptions: TABLE_OPTIONS }, + overrides: projectEdits, + route: "projects", + ui: UI, +}; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/tableOptions.ts b/site-config/hca-dcp/ma-dev/entities/projects/tableOptions.ts new file mode 100644 index 000000000..cb1d2b571 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/tableOptions.ts @@ -0,0 +1,31 @@ +import { + EntityConfig, + SORT_DIRECTION, +} from "@databiosphere/findable-ui/lib/config/entities"; +import { ProjectsResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; +import { HCA_DCP_CATEGORY_KEY } from "../../../category"; + +export const TABLE_OPTIONS: EntityConfig["list"]["tableOptions"] = + { + initialState: { + columnVisibility: { + [HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE]: false, + [HCA_DCP_CATEGORY_KEY.ORGAN_PART]: false, + [HCA_DCP_CATEGORY_KEY.MODEL_ORGAN]: false, + [HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE]: false, + [HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE]: false, + [HCA_DCP_CATEGORY_KEY.PAIRED_END]: false, + [HCA_DCP_CATEGORY_KEY.WORKFLOW]: false, + [HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE]: false, + [HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE]: false, + [HCA_DCP_CATEGORY_KEY.DONOR_COUNT]: false, + [HCA_DCP_CATEGORY_KEY.AGGREGATE_SUBMISSION_DATE]: false, + }, + sorting: [ + { + desc: SORT_DIRECTION.DESCENDING, + id: HCA_DCP_CATEGORY_KEY.AGGREGATE_LAST_MODIFIED_DATE, + }, + ], + }, + }; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/ui/slots.ts b/site-config/hca-dcp/ma-dev/entities/projects/ui/slots.ts new file mode 100644 index 000000000..5ef445b71 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/ui/slots.ts @@ -0,0 +1,29 @@ +import { ALERT_PROPS } from "@databiosphere/findable-ui/lib/components/common/Alert/constants"; +import { + ComponentConfig, + EntityUIConfig, +} 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/hca-dcp"; +import * as V from "../../../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; +import { SLOTS as BASE_SLOTS } from "../../common/ui/slots"; + +export const SLOTS: EntityUIConfig["slots"] = { + entityListSlot: [ + { + children: [ + { + component: MDX.AlertLoginReminder, + props: { + ...ALERT_PROPS.STANDARD_WARNING, + component: C.FluidPaper, + }, + } as ComponentConfig, + ], + component: C.ConditionalComponent, + viewBuilder: V.renderWhenUnAuthenticated, + } as ComponentConfig, + ], + entityViewSlot: BASE_SLOTS?.entityViewSlot, +}; diff --git a/site-config/hca-dcp/ma-dev/entities/projects/ui/ui.ts b/site-config/hca-dcp/ma-dev/entities/projects/ui/ui.ts new file mode 100644 index 000000000..9c5e948fd --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/projects/ui/ui.ts @@ -0,0 +1,9 @@ +import { EntityUIConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import { SLOTS } from "./slots"; + +export const UI: EntityUIConfig = { + enableExportButton: true, + enableSummary: true, + enableTabs: true, + slots: SLOTS, +}; diff --git a/site-config/hca-dcp/ma-dev/entities/samples/columns.ts b/site-config/hca-dcp/ma-dev/entities/samples/columns.ts new file mode 100644 index 000000000..407ae8a3b --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/samples/columns.ts @@ -0,0 +1,213 @@ +import { + ColumnConfig, + ComponentConfig, + EntityConfig, +} from "@databiosphere/findable-ui/lib/config/entities"; +import { SamplesResponse } 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"; +import { + HCA_DCP_CATEGORY_KEY, + HCA_DCP_CATEGORY_LABEL, +} from "../../../category"; + +const BIOLOGICAL_SEX: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregatedDonorBiologicalSex, + } as ComponentConfig, + header: "Sex", + id: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, + width: { max: "1fr", min: "124px" }, +}; + +const CELL_COUNT: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildTotalCells, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.CELL_COUNT, + id: HCA_DCP_CATEGORY_KEY.CELL_COUNT, + width: { max: "1fr", min: "124px" }, +}; + +const DEVELOPMENT_STAGE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorDevelopmentStage, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, + id: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, + width: { max: "1fr", min: "148px" }, +}; + +const DONOR_DISEASE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorDisease, + } as ComponentConfig, + header: "Disease (Donor)", + id: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, + width: { max: "1fr", min: "124px" }, +}; + +const GENUS_SPECIES: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorGenusSpecies, + } as ComponentConfig, + header: "Species", + id: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, + width: { max: "1fr", min: "124px" }, +}; + +const LIBRARY_CONSTRUCTION_APPROACH: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolLibraryConstructionApproach, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, + id: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, + width: { max: "1fr", min: "124px" }, +}; + +const MODEL_ORGAN: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildSampleModelOrgan, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, + id: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, + width: { max: "1fr", min: "124px" }, +}; + +const NUCLEIC_ACID_SOURCE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolNucleicAcidSource, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, + id: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, + width: { max: "1fr", min: "124px" }, +}; + +const ORGANISM_AGE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedDonorOrganismAge, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.ORGANISM_AGE, + id: HCA_DCP_CATEGORY_KEY.ORGANISM_AGE, + width: { max: "1fr", min: "124px" }, +}; + +const ORGAN_PART: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenOrganPart, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, + id: HCA_DCP_CATEGORY_KEY.ORGAN_PART, + width: { max: "1fr", min: "124px" }, +}; + +const PAIRED_END: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildAggregatedProtocolPairedEnd, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.PAIRED_END, + id: HCA_DCP_CATEGORY_KEY.PAIRED_END, + width: { max: "1fr", min: "124px" }, +}; + +const PROJECT_TITLE: ColumnConfig = { + componentConfig: { + component: C.Link, + viewBuilder: V.buildAggregatedProjectTitle, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, + id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, + width: { max: "2fr", min: "240px" }, +}; + +const SAMPLE_ENTITY_TYPE: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildSampleEntityType, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SAMPLE_TYPE, + id: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, + width: { max: "1fr", min: "124px" }, +}; + +const SAMPLE_ID: ColumnConfig = { + componentConfig: { + component: C.BasicCell, + viewBuilder: V.buildSampleId, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SAMPLE_ID, + id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, + width: { max: "1fr", min: "120px" }, +}; + +const SELECTED_CELL_TYPE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedCellSuspensionSelectedCellType, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, + id: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, + width: { max: "1fr", min: "124px" }, +}; + +const SPECIMEN_DISEASE: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenDisease, + } as ComponentConfig, + header: "Disease (Specimen)", + id: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, + width: { max: "1fr", min: "124px" }, +}; + +const SPECIMEN_ORGAN: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedSpecimenOrgan, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, + id: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, + width: { max: "1fr", min: "124px" }, +}; + +const WORKFLOW: ColumnConfig = { + componentConfig: { + component: C.NTagCell, + viewBuilder: V.buildAggregatedProtocolWorkflow, + } as ComponentConfig, + header: HCA_DCP_CATEGORY_LABEL.WORKFLOW, + id: HCA_DCP_CATEGORY_KEY.WORKFLOW, + width: { max: "1fr", min: "124px" }, +}; + +export const COLUMNS: EntityConfig["list"]["columns"] = [ + SAMPLE_ID, + PROJECT_TITLE, + GENUS_SPECIES, + SAMPLE_ENTITY_TYPE, + SPECIMEN_ORGAN, + ORGAN_PART, + MODEL_ORGAN, + SELECTED_CELL_TYPE, + LIBRARY_CONSTRUCTION_APPROACH, + NUCLEIC_ACID_SOURCE, + PAIRED_END, + WORKFLOW, + ORGANISM_AGE, + BIOLOGICAL_SEX, + SPECIMEN_DISEASE, + DONOR_DISEASE, + DEVELOPMENT_STAGE, + CELL_COUNT, +]; diff --git a/site-config/hca-dcp/ma-dev/entities/samples/samplesEntityConfig.ts b/site-config/hca-dcp/ma-dev/entities/samples/samplesEntityConfig.ts new file mode 100644 index 000000000..a042452f5 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/samples/samplesEntityConfig.ts @@ -0,0 +1,20 @@ +import { EntityConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMode/types"; +import { SamplesResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; +import { DETAIL } from "../common/detail/detail"; +import { UI } from "../common/ui/ui"; +import { COLUMNS } from "./columns"; +import { TABLE_OPTIONS } from "./tableOptions"; + +/** + * Entity config object responsible to config anything related to the /samples route. + */ +export const samplesEntityConfig: EntityConfig = { + apiPath: "index/samples", + detail: DETAIL, + exploreMode: EXPLORE_MODE.SS_FETCH_SS_FILTERING, + label: "Samples", + list: { columns: COLUMNS, tableOptions: TABLE_OPTIONS }, + route: "samples", + ui: UI, +}; diff --git a/site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts b/site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts new file mode 100644 index 000000000..04982ac73 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts @@ -0,0 +1,30 @@ +import { + EntityConfig, + SORT_DIRECTION, +} from "@databiosphere/findable-ui/lib/config/entities"; +import { SamplesResponse } from "../../../../../app/apis/azul/hca-dcp/common/responses"; +import { HCA_DCP_CATEGORY_KEY } from "../../../category"; + +export const TABLE_OPTIONS: EntityConfig["list"]["tableOptions"] = + { + initialState: { + columnVisibility: { + [HCA_DCP_CATEGORY_KEY.ORGAN_PART]: false, + [HCA_DCP_CATEGORY_KEY.MODEL_ORGAN]: false, + [HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE]: false, + [HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE]: false, + [HCA_DCP_CATEGORY_KEY.PAIRED_END]: false, + [HCA_DCP_CATEGORY_KEY.WORKFLOW]: false, + [HCA_DCP_CATEGORY_KEY.ORGANISM_AGE]: false, + [HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX]: false, + [HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE]: false, + [HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE]: false, + }, + sorting: [ + { + desc: SORT_DIRECTION.ASCENDING, + id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, + }, + ], + }, + }; diff --git a/site-config/hca-dcp/ma-dev/export/accessWarning.ts b/site-config/hca-dcp/ma-dev/export/accessWarning.ts new file mode 100644 index 000000000..f5d9b4d56 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/export/accessWarning.ts @@ -0,0 +1,14 @@ +import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import * as C from "../../../../app/components"; +import * as MDX from "../../../../app/components/common/MDXContent/hca-dcp"; +import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; + +export const EXPORT_ACCESS_WARNING: ComponentConfig = { + children: [ + { + component: MDX.AlertExportWarning, + viewBuilder: V.buildAlertExportWarning, + } as ComponentConfig, + ], + component: C.BackPageContentSingleColumn, +} as ComponentConfig; diff --git a/site-config/hca-dcp/dev/export/export.ts b/site-config/hca-dcp/ma-dev/export/export.ts similarity index 54% rename from site-config/hca-dcp/dev/export/export.ts rename to site-config/hca-dcp/ma-dev/export/export.ts index c82d24eb7..a8b3aa048 100644 --- a/site-config/hca-dcp/dev/export/export.ts +++ b/site-config/hca-dcp/ma-dev/export/export.ts @@ -4,26 +4,24 @@ import { } from "@databiosphere/findable-ui/lib/config/entities"; import * as C from "app/components"; import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { - ROUTE_BULK_DOWNLOAD, - ROUTE_EXPORT_TO_TERRA, - ROUTE_MANIFEST_DOWNLOAD, -} from "./constants"; +import { EXPORT_ACCESS_WARNING } from "./accessWarning"; +import { getExportMethodMainColumn } from "./exportMethodMainColumn"; +import { EXPORT_ROUTE } from "./routes"; import { getExportCurrentQueryAndDataSummary, getExportDataReleasePolicy, } from "./sideColumn"; -export const exportConfig: ExportConfig = { +export const EXPORT: ExportConfig = { exportMethods: [ { - mainColumn: [ + mainColumn: getExportMethodMainColumn([ { component: C.DownloadCurlCommand, viewBuilder: V.buildDownloadCurlCommand, } as ComponentConfig, - ], - route: ROUTE_BULK_DOWNLOAD, + ]), + route: EXPORT_ROUTE.BULK_DOWNLOAD, top: [ { component: C.BackPageHero, @@ -32,13 +30,13 @@ export const exportConfig: ExportConfig = { ], }, { - mainColumn: [ + mainColumn: getExportMethodMainColumn([ { component: C.ManifestDownload, viewBuilder: V.buildManifestDownload, } as ComponentConfig, - ], - route: ROUTE_MANIFEST_DOWNLOAD, + ]), + route: EXPORT_ROUTE.MANIFEST_DOWNLOAD, top: [ { component: C.BackPageHero, @@ -47,13 +45,13 @@ export const exportConfig: ExportConfig = { ], }, { - mainColumn: [ + mainColumn: getExportMethodMainColumn([ { component: C.ExportToTerra, viewBuilder: V.buildExportToTerra, } as ComponentConfig, - ], - route: ROUTE_EXPORT_TO_TERRA, + ]), + route: EXPORT_ROUTE.EXPORT_TO_TERRA, top: [ { component: C.BackPageHero, @@ -67,24 +65,33 @@ export const exportConfig: ExportConfig = { { label: "Choose Export Method", mainColumn: [ + EXPORT_ACCESS_WARNING, { - component: C.ExportMethod, - viewBuilder: V.buildExportMethodBulkDownload, - } as ComponentConfig, + children: [ + { + component: C.ExportMethod, + viewBuilder: V.buildExportMethodBulkDownload, + } as ComponentConfig, + { + component: C.ExportMethod, + viewBuilder: V.buildExportMethodManifestDownload, + } as ComponentConfig, + { + component: C.ExportMethod, + viewBuilder: V.buildExportMethodTerra, + } as ComponentConfig, + ], + component: C.BackPageContentMainColumn, + } as ComponentConfig, { - component: C.ExportMethod, - viewBuilder: V.buildExportMethodManifestDownload, - } as ComponentConfig, - { - component: C.ExportMethod, - viewBuilder: V.buildExportMethodTerra, - } as ComponentConfig, + children: [ + ...getExportCurrentQueryAndDataSummary(), + ...getExportDataReleasePolicy(), + ], + component: C.BackPageContentSideColumn, + } as ComponentConfig, ], route: "/export", - sideColumn: [ - ...getExportCurrentQueryAndDataSummary(), - ...getExportDataReleasePolicy(), - ], }, ], top: [ diff --git a/site-config/hca-dcp/ma-dev/export/exportMethodMainColumn.ts b/site-config/hca-dcp/ma-dev/export/exportMethodMainColumn.ts new file mode 100644 index 000000000..52e832c86 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/export/exportMethodMainColumn.ts @@ -0,0 +1,34 @@ +import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import * as C from "../../../../app/components"; +import { EXPORT_ACCESS_WARNING } from "./accessWarning"; +import { + getExportCurrentQueryAndDataSummary, + getExportDataReleasePolicy, +} from "./sideColumn"; + +/** + * Returns the managed access export method main column: an access warning row, + * the given main column wrapped in BackPageContentMainColumn, and the shared + * side column content (current query, data summary, and data release policy) + * wrapped in BackPageContentSideColumn. + * @param mainColumn - Main column content to render under the access warning. + * @returns Managed access export method main column. + */ +export function getExportMethodMainColumn( + mainColumn: ComponentConfig[] +): ComponentConfig[] { + return [ + EXPORT_ACCESS_WARNING, + { + children: mainColumn, + component: C.BackPageContentMainColumn, + } as ComponentConfig, + { + children: [ + ...getExportCurrentQueryAndDataSummary(), + ...getExportDataReleasePolicy(), + ], + component: C.BackPageContentSideColumn, + } as ComponentConfig, + ]; +} diff --git a/site-config/hca-dcp/ma-dev/export/routes.ts b/site-config/hca-dcp/ma-dev/export/routes.ts new file mode 100644 index 000000000..38b029cfc --- /dev/null +++ b/site-config/hca-dcp/ma-dev/export/routes.ts @@ -0,0 +1,5 @@ +export const EXPORT_ROUTE = { + BULK_DOWNLOAD: "/export/get-curl-command", + EXPORT_TO_TERRA: "/export/export-to-terra", + MANIFEST_DOWNLOAD: "/export/download-manifest", +} as const; diff --git a/site-config/hca-dcp/dev/export/sideColumn.ts b/site-config/hca-dcp/ma-dev/export/sideColumn.ts similarity index 100% rename from site-config/hca-dcp/dev/export/sideColumn.ts rename to site-config/hca-dcp/ma-dev/export/sideColumn.ts diff --git a/site-config/hca-dcp/dev/announcements/announcements.ts b/site-config/hca-dcp/ma-dev/layout/announcements.ts similarity index 68% rename from site-config/hca-dcp/dev/announcements/announcements.ts rename to site-config/hca-dcp/ma-dev/layout/announcements.ts index a7e0412fc..fd81de765 100644 --- a/site-config/hca-dcp/dev/announcements/announcements.ts +++ b/site-config/hca-dcp/ma-dev/layout/announcements.ts @@ -1,10 +1,8 @@ -import { - ComponentConfig, - ComponentsConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; +import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; import * as C from "app/components"; +import { SiteConfig } from "../../../common/entities"; -export const announcements: ComponentsConfig = [ +export const ANNOUNCEMENTS: SiteConfig["layout"]["header"]["announcements"] = [ { component: C.SystemIndexing, props: { diff --git a/site-config/hca-dcp/dev/layout/floating.ts b/site-config/hca-dcp/ma-dev/layout/floating.ts similarity index 84% rename from site-config/hca-dcp/dev/layout/floating.ts rename to site-config/hca-dcp/ma-dev/layout/floating.ts index 2efb9e21b..0647940fb 100644 --- a/site-config/hca-dcp/dev/layout/floating.ts +++ b/site-config/hca-dcp/ma-dev/layout/floating.ts @@ -1,10 +1,8 @@ import { REQUEST_FIELD_ID } from "@databiosphere/findable-ui/lib/components/Support/components/SupportRequest/components/SupportRequestForm/common/entities"; -import { - ComponentConfig, - FloatingConfig, -} from "@databiosphere/findable-ui/lib/config/entities"; +import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; import * as C from "app/components"; import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; +import { SiteConfig } from "../../../common/entities"; const ZENDESK_FIELD_ID: Record = { DESCRIPTION: 360007369412, @@ -16,7 +14,7 @@ const ZENDESK_FIELD_ID: Record = { const ZENDESK_REQUEST_URL = "https://support.terra.bio/api/v2/requests.json"; const ZENDESK_UPLOAD_URL = "https://support.terra.bio/api/v2/uploads"; -export const floating: FloatingConfig = { +export const FLOATING: SiteConfig["layout"]["floating"] = { components: [ { component: C.CookieBanner, diff --git a/site-config/hca-dcp/ma-dev/layout/footer.ts b/site-config/hca-dcp/ma-dev/layout/footer.ts new file mode 100644 index 000000000..13c29f23c --- /dev/null +++ b/site-config/hca-dcp/ma-dev/layout/footer.ts @@ -0,0 +1,40 @@ +import { ANCHOR_TARGET } from "@databiosphere/findable-ui/lib/components/Links/common/entities"; +import * as C from "../../../../app/components/index"; +import { SiteConfig } from "../../../common/entities"; + +/** + * Returns the footer configuration for the HCA DCP MA-DEV environment. + * @param portalUrl - Portal URL. + * @returns Footer configuration. + */ +export function getFooter(portalUrl: string): SiteConfig["layout"]["footer"] { + return { + Branding: C.HCABranding({ + orgURL: "https://www.humancellatlas.org", + portalURL: portalUrl, + }), + navLinks: [ + { + label: "About", + target: ANCHOR_TARGET.BLANK, + url: `${portalUrl}/about`, + }, + { + label: "Help", + target: ANCHOR_TARGET.BLANK, + url: `${portalUrl}/help`, + }, + { + label: "Privacy", + target: ANCHOR_TARGET.BLANK, + url: `${portalUrl}/privacy`, + }, + { + label: "Contact", + target: ANCHOR_TARGET.BLANK, + url: `${portalUrl}/contact`, + }, + ], + versionInfo: true, + }; +} diff --git a/site-config/hca-dcp/ma-dev/layout/header.ts b/site-config/hca-dcp/ma-dev/layout/header.ts new file mode 100644 index 000000000..aab92b96a --- /dev/null +++ b/site-config/hca-dcp/ma-dev/layout/header.ts @@ -0,0 +1,52 @@ +import { ANCHOR_TARGET } from "@databiosphere/findable-ui/lib/components/Links/common/entities"; +import * as C from "../../../../app/components/index"; +import { FLATTEN } from "../../../common/constants"; +import { SiteConfig } from "../../../common/entities"; +import { ANNOUNCEMENTS } from "./announcements"; + +/** + * Returns the header configuration for the HCA DCP MA-DEV environment. + * @param appTitle - App title. + * @param portalUrl - Portal URL. + * @returns Header configuration. + */ +export function getHeader( + appTitle: string, + portalUrl: string +): SiteConfig["layout"]["header"] { + return { + announcements: ANNOUNCEMENTS, + authenticationEnabled: true, + logo: C.Logo({ + alt: appTitle, + height: 32.5, + link: "/projects", + src: "/images/hcaExplorer.png", + }), + navigation: [ + undefined, + undefined, + [ + { + flatten: FLATTEN.XS_ONLY, + label: "Help & Documentation", + menuItems: [ + { + label: C.LabelIconMenuItem({ label: "Guides" }), + target: ANCHOR_TARGET.BLANK, + url: `${portalUrl}/guides`, + }, + { + label: C.LabelIconMenuItem({ label: "Privacy" }), + target: ANCHOR_TARGET.BLANK, + url: `${portalUrl}/privacy`, + }, + ], + url: "", + }, + ], + ], + searchEnabled: false, + searchURL: undefined, + }; +} diff --git a/site-config/hca-dcp/ma-dev/layout/layout.ts b/site-config/hca-dcp/ma-dev/layout/layout.ts new file mode 100644 index 000000000..239b9ec98 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/layout/layout.ts @@ -0,0 +1,21 @@ +import { SiteConfig } from "../../../common/entities"; +import { FLOATING } from "./floating"; +import { getFooter } from "./footer"; +import { getHeader } from "./header"; + +/** + * Returns the layout configuration for the HCA DCP MA-DEV environment. + * @param appTitle - Application title. + * @param portalUrl - Portal URL. + * @returns Layout configuration. + */ +export function getLayout( + appTitle: string, + portalUrl: string +): SiteConfig["layout"] { + return { + floating: FLOATING, + footer: getFooter(portalUrl), + header: getHeader(appTitle, portalUrl), + }; +} diff --git a/site-config/hca-dcp/dev/scripts/get-cellxgene-projects.ts b/site-config/hca-dcp/ma-dev/scripts/get-cellxgene-projects.ts similarity index 95% rename from site-config/hca-dcp/dev/scripts/get-cellxgene-projects.ts rename to site-config/hca-dcp/ma-dev/scripts/get-cellxgene-projects.ts index 75c47c204..b37fd5d03 100644 --- a/site-config/hca-dcp/dev/scripts/get-cellxgene-projects.ts +++ b/site-config/hca-dcp/ma-dev/scripts/get-cellxgene-projects.ts @@ -13,7 +13,7 @@ interface CellxGeneCollection { } const cellxgeneProjectsFilePath = - "./site-config/hca-dcp/dev/scripts/out/cellxgene-projects.json"; + "./site-config/hca-dcp/ma-dev/scripts/out/cellxgene-projects.json"; getCellxGeneProjects(); diff --git a/site-config/hca-dcp/dev/scripts/out/cellxgene-projects.json b/site-config/hca-dcp/ma-dev/scripts/out/cellxgene-projects.json similarity index 100% rename from site-config/hca-dcp/dev/scripts/out/cellxgene-projects.json rename to site-config/hca-dcp/ma-dev/scripts/out/cellxgene-projects.json diff --git a/site-config/hca-dcp/ma-dev/summary/summary.ts b/site-config/hca-dcp/ma-dev/summary/summary.ts new file mode 100644 index 000000000..9a45eb2a1 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/summary/summary.ts @@ -0,0 +1,7 @@ +import { SiteConfig } from "../../../common/entities"; +import { buildSummaries } from "./viewModelBuilder"; + +export const SUMMARY: SiteConfig["summaryConfig"] = { + apiPath: "index/summary", + mapResponse: buildSummaries, +}; diff --git a/site-config/hca-dcp/dev/index/summaryViewModelBuilder.ts b/site-config/hca-dcp/ma-dev/summary/viewModelBuilder.ts similarity index 100% rename from site-config/hca-dcp/dev/index/summaryViewModelBuilder.ts rename to site-config/hca-dcp/ma-dev/summary/viewModelBuilder.ts diff --git a/site-config/hca-dcp/ma-dev/themeOptions/themeOptions.ts b/site-config/hca-dcp/ma-dev/themeOptions/themeOptions.ts new file mode 100644 index 000000000..127c59c33 --- /dev/null +++ b/site-config/hca-dcp/ma-dev/themeOptions/themeOptions.ts @@ -0,0 +1,65 @@ +import { TYPOGRAPHY_PROPS } from "@databiosphere/findable-ui/lib/styles/common/mui/typography"; +import { SiteConfig } from "../../../common/entities"; + +const FONT_FAMILY_DIN = "'din-2014', sans-serif"; + +export const THEME_OPTIONS: SiteConfig["themeOptions"] = { + palette: { + primary: { + dark: "#005EA9", + main: "#1C7CC7", + }, + }, + typography: { + [TYPOGRAPHY_PROPS.VARIANT.BODY_LARGE_500]: { + fontFamily: FONT_FAMILY_DIN, + fontSize: "18px", + fontWeight: 400, + }, + [TYPOGRAPHY_PROPS.VARIANT.HEADING]: { + fontFamily: FONT_FAMILY_DIN, + fontSize: "22px", + fontWeight: 400, + letterSpacing: "normal", + // eslint-disable-next-line sort-keys -- disabling key order for readability + "@media (min-width: 768px)": { + fontSize: "26px", + letterSpacing: "normal", + }, + }, + [TYPOGRAPHY_PROPS.VARIANT.HEADING_LARGE]: { + fontFamily: FONT_FAMILY_DIN, + fontSize: "26px", + fontWeight: 400, + letterSpacing: "normal", + lineHeight: "34px", + // eslint-disable-next-line sort-keys -- disabling key order for readability + "@media (min-width: 768px)": { + fontSize: "32px", + letterSpacing: "normal", + }, + }, + [TYPOGRAPHY_PROPS.VARIANT.HEADING_SMALL]: { + fontFamily: FONT_FAMILY_DIN, + fontSize: "20px", + fontWeight: 400, + letterSpacing: "normal", + // eslint-disable-next-line sort-keys -- disabling key order for readability + "@media (min-width: 768px)": { + fontSize: "22px", + letterSpacing: "normal", + }, + }, + [TYPOGRAPHY_PROPS.VARIANT.HEADING_XLARGE]: { + fontFamily: FONT_FAMILY_DIN, + fontSize: "32px", + fontWeight: 400, + letterSpacing: "normal", + // eslint-disable-next-line sort-keys -- disabling key order for readability + "@media (min-width: 768px)": { + fontSize: "42px", + letterSpacing: "-0.4px", + }, + }, + }, +}; diff --git a/site-config/hca-dcp/ma-prod/.env b/site-config/hca-dcp/ma-prod/.env index 2aad31fa2..226a42aee 100644 --- a/site-config/hca-dcp/ma-prod/.env +++ b/site-config/hca-dcp/ma-prod/.env @@ -1,2 +1,2 @@ NEXT_PUBLIC_SITE_CONFIG='hca-dcp-ma-prod' -NEXT_PUBLIC_SITEMAP_DOMAIN='https://ma-pilot.explore.data.humancellatlas.org' +NEXT_PUBLIC_SITEMAP_DOMAIN='https://explore.data.humancellatlas.org' diff --git a/site-config/hca-dcp/ma-prod/authentication/authentication.ts b/site-config/hca-dcp/ma-prod/authentication/authentication.ts index d32ba4531..a4a725925 100644 --- a/site-config/hca-dcp/ma-prod/authentication/authentication.ts +++ b/site-config/hca-dcp/ma-prod/authentication/authentication.ts @@ -1,11 +1,17 @@ import { AuthenticationConfig } from "@databiosphere/findable-ui/lib/config/entities"; +import * as MDX from "../../../../app/components/common/MDXContent/hca-dcp"; import { GOOGLE_PROVIDER, TERRA_SERVICE } from "./constants"; -export function getAuthenticationConfig( - authenticationConfig: AuthenticationConfig -): AuthenticationConfig { - const authentication = { ...authenticationConfig }; - authentication.providers = [GOOGLE_PROVIDER]; - authentication.services = [TERRA_SERVICE]; - return authentication; +/** + * Returns the authentication config for HCA DCP MA-PROD environment. + * @returns - Authentication config for HCA DCP MA-PROD environment. + */ +export function getAuthentication(): AuthenticationConfig { + return { + providers: [GOOGLE_PROVIDER], + services: [TERRA_SERVICE], + termsOfService: MDX.LoginTermsOfService({}), + text: MDX.LoginText({}), + title: "Sign in to your account", + }; } diff --git a/site-config/hca-dcp/ma-prod/config.ts b/site-config/hca-dcp/ma-prod/config.ts index 64253f55d..e1ce18bda 100644 --- a/site-config/hca-dcp/ma-prod/config.ts +++ b/site-config/hca-dcp/ma-prod/config.ts @@ -1,32 +1,27 @@ import { GIT_HUB_REPO_URL } from "../../common/constants"; -import { SiteConfig } from "../../common/entities"; -import { makeManagedAccessConfig } from "../cc-ma-dev/config"; -import { makeConfig } from "../dev/config"; -import { getAuthenticationConfig } from "./authentication/authentication"; +import { makeConfig } from "../ma-dev/config"; +import { getAuthentication } from "./authentication/authentication"; // Template constants const BROWSER_URL = "https://explore.data.humancellatlas.org"; const CATALOG = "dcp59"; -const DATA_URL = "https://service.azul.data.humancellatlas.org"; -const PORTAL_URL = "https://data.humancellatlas.org"; +export const DATA_URL = "https://service.azul.data.humancellatlas.org"; +export const PORTAL_URL = "https://data.humancellatlas.org"; -const config: SiteConfig = { - ...makeManagedAccessConfig( - makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL, GIT_HUB_REPO_URL, CATALOG) - ), -}; - -// Update gtmAuth for the prod environment lookup. -if (config.analytics) { - const analytics = { ...config.analytics }; - analytics.gtmAuth = "xm3qglWPEFim7Lb4AxXnsA"; - analytics.gtmPreview = "env-2"; - config.analytics = analytics; -} +const config = makeConfig( + BROWSER_URL, + PORTAL_URL, + DATA_URL, + GIT_HUB_REPO_URL, + CATALOG, + getAuthentication() +); -// Update authentication for the prod environment. -if (config.authentication) { - config.authentication = getAuthenticationConfig(config.authentication); -} +// Configure analytics for the prod environment. +config.analytics = { + gtmAuth: "xm3qglWPEFim7Lb4AxXnsA", + gtmId: "GTM-M2J5NTJ", + gtmPreview: "env-2", +}; export default config; diff --git a/site-config/hca-dcp/prod/.env b/site-config/hca-dcp/prod/.env deleted file mode 100644 index 5489d0de4..000000000 --- a/site-config/hca-dcp/prod/.env +++ /dev/null @@ -1,2 +0,0 @@ -NEXT_PUBLIC_SITE_CONFIG='hca-dcp-prod' -NEXT_PUBLIC_SITEMAP_DOMAIN='https://explore.data.humancellatlas.org' \ No newline at end of file diff --git a/site-config/hca-dcp/prod/config.ts b/site-config/hca-dcp/prod/config.ts deleted file mode 100644 index 8b0c70c94..000000000 --- a/site-config/hca-dcp/prod/config.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { GIT_HUB_REPO_URL } from "../../common/constants"; -import { SiteConfig } from "../../common/entities"; -import { makeConfig } from "../dev/config"; - -// Template constants -const BROWSER_URL = "https://explore.data.humancellatlas.org"; -export const DATA_URL = "https://service.azul.data.humancellatlas.org"; -export const PORTAL_URL = "https://data.humancellatlas.org"; - -const config: SiteConfig = { - ...makeConfig(BROWSER_URL, PORTAL_URL, DATA_URL, GIT_HUB_REPO_URL), -}; - -// Update gtmAuth for the prod environment lookup. -if (config.analytics) { - const analytics = { ...config.analytics }; - analytics.gtmAuth = "xm3qglWPEFim7Lb4AxXnsA"; - analytics.gtmPreview = "env-2"; - config.analytics = analytics; -} - -export default config; diff --git a/site-config/lungmap/dev/categoryGroup/categoryGroupConfig.ts b/site-config/lungmap/dev/categoryGroup/categoryGroupConfig.ts new file mode 100644 index 000000000..d2458d9ae --- /dev/null +++ b/site-config/lungmap/dev/categoryGroup/categoryGroupConfig.ts @@ -0,0 +1,55 @@ +import { SiteConfig } from "../../../common/entities"; +import { CATEGORY_CONFIG } from "../../../hca-dcp/ma-dev/categoryGroup/categoryGroupConfig"; + +export const CATEGORY_GROUP_CONFIG: SiteConfig["categoryGroupConfig"] = { + categoryGroups: [ + { + categoryConfigs: [ + CATEGORY_CONFIG.PROJECT_TITLE, + CATEGORY_CONFIG.CONTACT_NAME, + CATEGORY_CONFIG.INSTITUTION, + ], + label: "Project", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.BIOLOGICAL_SEX, + CATEGORY_CONFIG.DEVELOPMENT_STAGE, + CATEGORY_CONFIG.DONOR_DISEASE, + CATEGORY_CONFIG.GENUS_SPECIES, + ], + label: "Donor", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.SPECIMEN_ORGAN, + CATEGORY_CONFIG.ORGAN_PART, + CATEGORY_CONFIG.PRESERVATION_METHOD, + CATEGORY_CONFIG.MODEL_ORGAN, + CATEGORY_CONFIG.SAMPLE_ENTITY_TYPE, + CATEGORY_CONFIG.SELECTED_CELL_TYPE, + CATEGORY_CONFIG.SPECIMEN_DISEASE, + ], + label: "Sample", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.WORKFLOW, + CATEGORY_CONFIG.INSTRUMENT_MANUFACTURER_MODEL, + CATEGORY_CONFIG.LIBRARY_CONSTRUCTION_APPROACH, + CATEGORY_CONFIG.NUCLEIC_ACID_SOURCE, + CATEGORY_CONFIG.PAIRED_END, + ], + label: "Protocol", + }, + { + categoryConfigs: [ + CATEGORY_CONFIG.CONTENT_DESCRIPTION, + CATEGORY_CONFIG.FILE_FORMAT, + CATEGORY_CONFIG.FILE_SOURCE, + ], + label: "File", + }, + ], + key: "lungmap", +}; diff --git a/site-config/lungmap/dev/config.ts b/site-config/lungmap/dev/config.ts index f30224a24..5934384bf 100644 --- a/site-config/lungmap/dev/config.ts +++ b/site-config/lungmap/dev/config.ts @@ -1,13 +1,13 @@ import { FILTER_SORT } from "@databiosphere/findable-ui/lib/common/filters/sort/config/types"; -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 { + DATA_URL as HCA_DATA_URL, + PORTAL_URL as HCA_PORTAL_URL, +} from "../../hca-dcp/ma-dev/config"; +import { CATEGORY_GROUP_CONFIG } from "./categoryGroup/categoryGroupConfig"; 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"; @@ -40,10 +40,7 @@ export function makeConfig( appTitle: APP_TITLE, authentication: undefined, browserURL: browserUrl, - categoryGroupConfig: { - categoryGroups: CATEGORY_GROUPS, - key: "lungmap", - }, + categoryGroupConfig: CATEGORY_GROUP_CONFIG, contentDir: "lungmap", dataSource: { defaultListParams: { diff --git a/site-config/lungmap/dev/detail/project/exportSideColumn.ts b/site-config/lungmap/dev/detail/project/exportSideColumn.ts index 546fb791a..fd5bb098e 100644 --- a/site-config/lungmap/dev/detail/project/exportSideColumn.ts +++ b/site-config/lungmap/dev/detail/project/exportSideColumn.ts @@ -1,5 +1,5 @@ import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; -import { getExportCurrentQueryAndDataSummary } from "../../../../hca-dcp/dev/export/sideColumn"; +import { getExportCurrentQueryAndDataSummary } from "../../../../hca-dcp/ma-dev/export/sideColumn"; import { getExportDataReleasePolicy } from "../../export/sideColumn"; export const sideColumn: ComponentConfig[] = [ diff --git a/site-config/lungmap/dev/detail/project/metadataSideColumn.ts b/site-config/lungmap/dev/detail/project/metadataSideColumn.ts index 546fb791a..fd5bb098e 100644 --- a/site-config/lungmap/dev/detail/project/metadataSideColumn.ts +++ b/site-config/lungmap/dev/detail/project/metadataSideColumn.ts @@ -1,5 +1,5 @@ import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; -import { getExportCurrentQueryAndDataSummary } from "../../../../hca-dcp/dev/export/sideColumn"; +import { getExportCurrentQueryAndDataSummary } from "../../../../hca-dcp/ma-dev/export/sideColumn"; import { getExportDataReleasePolicy } from "../../export/sideColumn"; export const sideColumn: ComponentConfig[] = [ diff --git a/site-config/lungmap/dev/detail/project/projectFilesSideColumn.ts b/site-config/lungmap/dev/detail/project/projectFilesSideColumn.ts index 546fb791a..fd5bb098e 100644 --- a/site-config/lungmap/dev/detail/project/projectFilesSideColumn.ts +++ b/site-config/lungmap/dev/detail/project/projectFilesSideColumn.ts @@ -1,5 +1,5 @@ import { ComponentConfig } from "@databiosphere/findable-ui/lib/config/entities"; -import { getExportCurrentQueryAndDataSummary } from "../../../../hca-dcp/dev/export/sideColumn"; +import { getExportCurrentQueryAndDataSummary } from "../../../../hca-dcp/ma-dev/export/sideColumn"; import { getExportDataReleasePolicy } from "../../export/sideColumn"; export const sideColumn: ComponentConfig[] = [ diff --git a/site-config/hca-dcp/dev/detail/project/top.ts b/site-config/lungmap/dev/detail/project/top.ts similarity index 81% rename from site-config/hca-dcp/dev/detail/project/top.ts rename to site-config/lungmap/dev/detail/project/top.ts index 4db5a3fa7..4710dd591 100644 --- a/site-config/hca-dcp/dev/detail/project/top.ts +++ b/site-config/lungmap/dev/detail/project/top.ts @@ -4,7 +4,7 @@ import { } 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"; +import * as V from "../../../../../app/viewModelBuilders/azul/lungmap/common/viewModelBuilders"; export const top: ComponentsConfig = [ { diff --git a/site-config/lungmap/dev/export/exportConfig.ts b/site-config/lungmap/dev/export/exportConfig.ts index ace7c737e..b888a379c 100644 --- a/site-config/lungmap/dev/export/exportConfig.ts +++ b/site-config/lungmap/dev/export/exportConfig.ts @@ -1,22 +1,64 @@ import { ComponentConfig, 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, - ROUTE_EXPORT_TO_TERRA, - ROUTE_MANIFEST_DOWNLOAD, -} from "../../../hca-dcp/dev/export/constants"; -import { exportConfig as hcaExportConfig } from "../../../hca-dcp/dev/export/export"; -import { getExportCurrentQueryAndDataSummary } from "../../../hca-dcp/dev/export/sideColumn"; +import { EXPORT_ROUTE } from "../../../hca-dcp/ma-dev/export/routes"; +import { getExportCurrentQueryAndDataSummary } from "../../../hca-dcp/ma-dev/export/sideColumn"; import { getExportDataReleasePolicy } from "./sideColumn"; export const exportConfig: ExportConfig = { - ...getExportConfig(hcaExportConfig), + exportMethods: [ + { + mainColumn: [ + { + component: C.DownloadCurlCommand, + viewBuilder: V.buildDownloadCurlCommand, + } as ComponentConfig, + ], + route: EXPORT_ROUTE.BULK_DOWNLOAD, + top: [ + { + component: C.BackPageHero, + viewBuilder: HCAViewModelBuilders.buildExportMethodHeroCurlCommand, + } as ComponentConfig, + ], + }, + { + mainColumn: [ + { + component: C.ManifestDownload, + viewBuilder: V.buildManifestDownload, + } as ComponentConfig, + ], + route: EXPORT_ROUTE.MANIFEST_DOWNLOAD, + top: [ + { + component: C.BackPageHero, + viewBuilder: + HCAViewModelBuilders.buildExportMethodHeroManifestDownload, + } as ComponentConfig, + ], + }, + { + mainColumn: [ + { + component: C.ExportToTerra, + viewBuilder: V.buildExportToTerra, + } as ComponentConfig, + ], + route: EXPORT_ROUTE.EXPORT_TO_TERRA, + top: [ + { + component: C.BackPageHero, + viewBuilder: HCAViewModelBuilders.buildExportMethodHeroTerra, + } as ComponentConfig, + ], + }, + ], + staticLoad: true, tabs: [ { label: "Choose Export Method", @@ -41,48 +83,10 @@ export const exportConfig: ExportConfig = { ], }, ], + top: [ + { + component: C.BackPageHero, + viewBuilder: HCAViewModelBuilders.buildExportHero, + } as ComponentConfig, + ], }; - -/** - * Returns the export config. - * @param exportConfig - Export config. - * @returns export config. - */ -function getExportConfig(exportConfig: ExportConfig): ExportConfig { - // Clone export config. - const cloneExportConfig = { ...exportConfig }; - // Update export methods. - cloneExportConfig.exportMethods = getExportMethods(exportConfig); - return cloneExportConfig; -} - -/** - * Returns the export methods. - * @param exportConfig - Export config. - * @returns export methods. - */ -function getExportMethods(exportConfig: ExportConfig): ExportMethodConfig[] { - return [...exportConfig.exportMethods].map((exportMethod) => { - const cloneExportMethod = { ...exportMethod }; - const mainColumn = cloneExportMethod.mainColumn as ComponentConfig[]; - // Clone main column. - const cloneMainColumn = [...mainColumn]; - // Clone first component of main column. - const cloneFirstComponent = { ...cloneMainColumn[0] }; - // Update the export method view builders for each download type. - if (cloneExportMethod.route === ROUTE_BULK_DOWNLOAD) { - // Update view builder for bulk download. - cloneFirstComponent.viewBuilder = V.buildDownloadCurlCommand; - } - if (cloneExportMethod.route === ROUTE_MANIFEST_DOWNLOAD) { - // Update view builder for manifest download. - cloneFirstComponent.viewBuilder = V.buildManifestDownload; - } - if (cloneExportMethod.route === ROUTE_EXPORT_TO_TERRA) { - // Update view builder for export to Terra. - cloneFirstComponent.viewBuilder = V.buildExportToTerra; - } - cloneExportMethod.mainColumn = [cloneFirstComponent]; - return cloneExportMethod; - }); -} diff --git a/site-config/lungmap/dev/index/common/category.ts b/site-config/lungmap/dev/index/common/category.ts deleted file mode 100644 index ee677d498..000000000 --- a/site-config/lungmap/dev/index/common/category.ts +++ /dev/null @@ -1,75 +0,0 @@ -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 = { - 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, -]; diff --git a/site-config/lungmap/dev/index/projectsEntityConfig.ts b/site-config/lungmap/dev/index/projectsEntityConfig.ts index 87a2ecbc5..5671e3c0b 100644 --- a/site-config/lungmap/dev/index/projectsEntityConfig.ts +++ b/site-config/lungmap/dev/index/projectsEntityConfig.ts @@ -16,7 +16,6 @@ import { import * as C from "../../../../app/components"; import { projectEdits as hcaProjectEdits } from "../../../../app/viewModelBuilders/azul/hca-dcp/common/projectMapper/projectEdits/projectEdits"; import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders"; -import { top as hcaTop } from "../../../hca-dcp/dev/detail/project/top"; import { mainColumn as exportMainColumn } from "../detail/project/exportMainColumn"; import { sideColumn as exportSideColumn } from "../detail/project/exportSideColumn"; import { mainColumn as overviewMainColumn } from "../detail/project/mainColumn"; @@ -26,6 +25,7 @@ import { sideColumn as metadataSideColumn } from "../detail/project/metadataSide import { sideColumn as overviewSideColumn } from "../detail/project/overviewSideColumn"; import { mainColumn as projectFilesMainColumn } from "../detail/project/projectFilesMainColumn"; import { sideColumn as projectFilesSideColumn } from "../detail/project/projectFilesSideColumn"; +import { top } from "../detail/project/top"; /** * Entity config object responsible to config anything related to the /projects route. @@ -66,7 +66,7 @@ export const projectsEntityConfig: EntityConfig = { sideColumn: exportSideColumn, }, ], - top: hcaTop, + top, }, exploreMode: EXPLORE_MODE.SS_FETCH_SS_FILTERING, getId: getProjectId, diff --git a/site-config/lungmap/prod/config.ts b/site-config/lungmap/prod/config.ts index 13eb7291f..69fbff6c0 100644 --- a/site-config/lungmap/prod/config.ts +++ b/site-config/lungmap/prod/config.ts @@ -3,7 +3,7 @@ import { SiteConfig } from "../../common/entities"; import { DATA_URL as HCA_DATA_URL, PORTAL_URL as HCA_PORTAL_URL, -} from "../../hca-dcp/prod/config"; +} from "../../hca-dcp/ma-prod/config"; import { makeConfig } from "../dev/config"; // Template constants