From 688b5758b84a5cffbb137aaafe1adc439838844c Mon Sep 17 00:00:00 2001 From: Fran McDade Date: Wed, 2 Aug 2023 15:58:48 +1000 Subject: [PATCH] feat: configure file manifest summary (#888) (#3591) Co-authored-by: Fran McDade --- .../apis/azul/anvil-cmg/common/entities.ts | 24 ++ .../apis/azul/anvil-cmg/common/responses.ts | 19 ++ .../app/apis/azul/hca-dcp/common/entities.ts | 27 ++ .../app/apis/azul/hca-dcp/common/responses.ts | 20 ++ explorer/app/components/Index/common/utils.ts | 15 +- .../accessStatusBadge.styles.ts | 4 +- .../dataSummaryMapper/dataSummaryMapper.ts | 95 +------ .../hca-dcp/common/summaryMapper/constants.ts | 33 +++ .../hca-dcp/common/summaryMapper/entities.ts | 42 +++ .../common/summaryMapper/summaryMapper.ts | 163 +++++++++++ .../azul/hca-dcp/common/viewModelBuilders.ts | 31 +- explorer/package-lock.json | 266 +++++++++++++++++- explorer/package.json | 2 +- .../site-config/anvil-catalog/dev/config.ts | 66 +++-- explorer/site-config/anvil-cmg/dev/config.ts | 106 +++---- explorer/site-config/anvil/dev/config.ts | 66 +++-- explorer/site-config/hca-dcp/dev/config.ts | 162 +++++------ explorer/site-config/lungmap/dev/config.ts | 2 +- .../site-config/ncpi-catalog/dev/config.ts | 58 ++-- 19 files changed, 859 insertions(+), 342 deletions(-) create mode 100644 explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/constants.ts create mode 100644 explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/entities.ts create mode 100644 explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/summaryMapper.ts diff --git a/explorer/app/apis/azul/anvil-cmg/common/entities.ts b/explorer/app/apis/azul/anvil-cmg/common/entities.ts index 52ff555f7..23496d568 100644 --- a/explorer/app/apis/azul/anvil-cmg/common/entities.ts +++ b/explorer/app/apis/azul/anvil-cmg/common/entities.ts @@ -15,6 +15,14 @@ export interface ActivityEntityResponse { activities: ActivityEntity[]; } +/** + * Model of activity type returned from the /index/summary API endpoint. + */ +export interface ActivityType { + count: number; + type: string; +} + /** * Model of core biosample value returned from the /index/biosamples API endpoint. */ @@ -67,6 +75,14 @@ export interface DonorEntityResponse { donors: DonorEntity[]; } +/** + * Model of donor species returned from the /index/summary API endpoint. + */ +export interface DonorSpecies { + count: number; + species: null; // TODO - when species type is known (currently returns null value). +} + /** * Model of core file value returned from the /index/files API endpoint. */ @@ -98,6 +114,14 @@ export interface LibraryEntity { prep_material_name: string; } +/** + * Model of file format returned from the /index/summary API endpoint. + */ +export interface FileFormat { + count: number; + format: string; +} + /** * Model of singleton array containing core library value returned from the /index/libraries API endpoint. */ diff --git a/explorer/app/apis/azul/anvil-cmg/common/responses.ts b/explorer/app/apis/azul/anvil-cmg/common/responses.ts index 8bb9a9cb0..9a2f60fec 100644 --- a/explorer/app/apis/azul/anvil-cmg/common/responses.ts +++ b/explorer/app/apis/azul/anvil-cmg/common/responses.ts @@ -10,10 +10,13 @@ import { } from "./aggregatedEntities"; import { ActivityEntityResponse, + ActivityType, BioSampleEntityResponse, DatasetEntityResponse, DonorEntityResponse, + DonorSpecies, FileEntityResponse, + FileFormat, LibraryEntityResponse, } from "./entities"; @@ -83,3 +86,19 @@ export type LibrariesResponse = AzulHit & AggregatedDatasetResponse & AggregatedDonorResponse & AggregatedFileResponse; + +/** + * Model of response returned from /index/summary API endpoint. + */ +export type SummaryResponse = { + activityCount: number; + activityTypes: ActivityType[]; + biosampleCount: number; + datasetCount: number; + donorCount: number; + donorDiagnosisDiseases: unknown[]; // TODO - when type is known. + donorDiagnosisPhenotypes: unknown[]; // TODO - when type is known. + donorSpecies: DonorSpecies[]; + fileCount: number; + fileFormats: FileFormat[]; +}; diff --git a/explorer/app/apis/azul/hca-dcp/common/entities.ts b/explorer/app/apis/azul/hca-dcp/common/entities.ts index 2127bb754..79aa7c944 100644 --- a/explorer/app/apis/azul/hca-dcp/common/entities.ts +++ b/explorer/app/apis/azul/hca-dcp/common/entities.ts @@ -6,6 +6,15 @@ export interface AccessionResponse { namespace: string; } +/** + * Model of cell count summary from index/summary API endpoints. + */ +export interface CellCountSummary { + countOfDocsWithOrganType: number; + organType: string[]; + totalCellCountByOrgan: number; +} + /** * Model of contributor value in the response from index/projects API endpoint. */ @@ -44,6 +53,16 @@ export interface FileResponse { version: string; } +/** + * Model of file type summary from index/summary API endpoints. + */ +export interface FileTypeSummary { + count: number; + format: string; + matrixCellCount: number; + totalSize: number; +} + /** * Model of file "leaf" values in matrix tree response from Azul. */ @@ -89,6 +108,14 @@ export interface ProjectsEntityResponse { projects: ProjectResponse[]; } +/** + * Model of project summary in the response from /index/summary API endpoint. + */ +export interface ProjectSummary { + cellSuspensions: { totalCells: number }; + projects: { estimatedCellCount: number }; +} + /** * Model of publication value in the response from index/projects API endpoint. */ diff --git a/explorer/app/apis/azul/hca-dcp/common/responses.ts b/explorer/app/apis/azul/hca-dcp/common/responses.ts index c160833de..f907ee7ba 100644 --- a/explorer/app/apis/azul/hca-dcp/common/responses.ts +++ b/explorer/app/apis/azul/hca-dcp/common/responses.ts @@ -9,8 +9,11 @@ import { AggregatedSpecimensResponse, } from "./aggregatedEntities"; import { + CellCountSummary, FilesEntityResponse, + FileTypeSummary, ProjectsEntityResponse, + ProjectSummary, SamplesEntityResponse, } from "./entities"; @@ -54,3 +57,20 @@ export type SamplesResponse = AzulHit & AggregatedProjectsResponse & AggregatedProtocolsResponse & AggregatedSpecimensResponse; + +/** + * Model of response returned from /index/summary API endpoint. + */ +export type SummaryResponse = { + cellCountSummaries: CellCountSummary[]; + donorCount: number; + fileCount: number; + fileTypeSummaries: FileTypeSummary[]; + labCount: number; + organTypes: string[]; + projectCount: number; + projects: ProjectSummary[]; + speciesCount: number; + specimenCount: number; + totalFileSize: number | string; +}; diff --git a/explorer/app/components/Index/common/utils.ts b/explorer/app/components/Index/common/utils.ts index 11d9d93b9..5323095c4 100644 --- a/explorer/app/components/Index/common/utils.ts +++ b/explorer/app/components/Index/common/utils.ts @@ -1,27 +1,34 @@ import { AzulSummaryResponse } from "@clevercanary/data-explorer-ui/lib/apis/azul/common/entities"; +import { FileFormat } from "../../../apis/azul/anvil-cmg/common/entities"; +import { ProjectSummary } from "../../../apis/azul/hca-dcp/common/entities"; /** * Calculates the summary file format count using count values returned for each file format in the summary response. + * TODO review configuration of summary response model and use of this method to calculate file formats. * @param summaryResponse - Response model return from summary API. * @returns count of file formats. */ export function calculateSummaryFileFormatsCount( summaryResponse: AzulSummaryResponse ): number { - return (summaryResponse.fileFormats ?? []).reduce((accum, { count }) => { - return accum + count; - }, 0); + return ((summaryResponse.fileFormats as FileFormat[]) ?? []).reduce( + (accum, { count }) => { + return accum + count; + }, + 0 as number + ); } /** * Calculates the summary total cell count using the estimatedCellCount and totalCells values fom the summary response. + * TODO review configuration of summary response model and use of this method to calculate total cell count. * @param summaryResponse - Response model return from summary API. * @returns count of total cell count. */ export function calculateSummaryTotalCellCount( summaryResponse: AzulSummaryResponse ): number { - return (summaryResponse.projects ?? []).reduce( + return ((summaryResponse.projects as ProjectSummary[]) ?? []).reduce( (accum, { cellSuspensions, projects }) => { if ( projects && diff --git a/explorer/app/components/Index/components/AccessStatusBadge/accessStatusBadge.styles.ts b/explorer/app/components/Index/components/AccessStatusBadge/accessStatusBadge.styles.ts index 3138456c1..82f939b4b 100644 --- a/explorer/app/components/Index/components/AccessStatusBadge/accessStatusBadge.styles.ts +++ b/explorer/app/components/Index/components/AccessStatusBadge/accessStatusBadge.styles.ts @@ -5,7 +5,9 @@ interface AccessStatusBadgeProps { accessible: boolean; } -export const AccessStatusBadge = styled(Chip)` +export const AccessStatusBadge = styled(Chip, { + shouldForwardProp: (prop) => prop !== "accessible", +})` background-color: ${({ accessible, theme }) => accessible ? theme.palette.success.light : theme.palette.warning.light}; color: ${({ accessible, theme }) => diff --git a/explorer/app/viewModelBuilders/azul/hca-dcp/common/dataSummaryMapper/dataSummaryMapper.ts b/explorer/app/viewModelBuilders/azul/hca-dcp/common/dataSummaryMapper/dataSummaryMapper.ts index 82af0bd74..9852f1fa6 100644 --- a/explorer/app/viewModelBuilders/azul/hca-dcp/common/dataSummaryMapper/dataSummaryMapper.ts +++ b/explorer/app/viewModelBuilders/azul/hca-dcp/common/dataSummaryMapper/dataSummaryMapper.ts @@ -1,20 +1,11 @@ import { LABEL } from "@clevercanary/data-explorer-ui/lib/apis/azul/common/entities"; import { stringifyValues } from "@clevercanary/data-explorer-ui/lib/common/utils"; import { Value } from "@clevercanary/data-explorer-ui/lib/components/common/KeyValuePairs/keyValuePairs"; -import { - displaySummaryTerms, - listSelectedTermsOfFacet, -} from "@clevercanary/data-explorer-ui/lib/components/Export/components/ExportSummary/common/utils"; import { ANCHOR_TARGET } from "@clevercanary/data-explorer-ui/lib/components/Links/common/entities"; import { Links } from "@clevercanary/data-explorer-ui/lib/components/Links/links"; import { getConfig } from "@clevercanary/data-explorer-ui/lib/config/config"; -import { FileManifest } from "@clevercanary/data-explorer-ui/lib/hooks/useFileManifest/common/entities"; import { formatCountSize } from "@clevercanary/data-explorer-ui/lib/utils/formatCountSize"; -import { formatFileSize } from "@clevercanary/data-explorer-ui/lib/utils/formatFileSize"; -import { - HCA_DCP_CATEGORY_KEY, - HCA_DCP_CATEGORY_LABEL, -} from "../../../../../../site-config/hca-dcp/category"; +import { HCA_DCP_CATEGORY_KEY } from "../../../../../../site-config/hca-dcp/category"; import { processAggregatedBooleanOrArrayValue, processAggregatedNumberEntityValue, @@ -226,87 +217,3 @@ export function mapProjectDataSummary( details.set(DATA_SUMMARY.DONOR_COUNT, formatCountSize(donorCount)); // Donor Count return details; } - -/** - * Maps export summary related information, included formatted display text from the given file manifest. - * @param fileManifest - File manifest. - * @returns summaries key-value pairs of data summary and corresponding value. - */ -export function mapExportSummary( - fileManifest: FileManifest -): Map { - const { filesFacets, fileSummary } = fileManifest; - // Grab summary values. - const donorCount = fileSummary.donorCount; - const donorDisease = listSelectedTermsOfFacet( - filesFacets, - HCA_DCP_CATEGORY_KEY.DONOR_DISEASE - ); - const fileCount = fileSummary.fileCount; - const genusSpecies = listSelectedTermsOfFacet( - filesFacets, - HCA_DCP_CATEGORY_KEY.GENUS_SPECIES - ); - const libraryConstructionApproach = listSelectedTermsOfFacet( - filesFacets, - HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD - ); - const organ = listSelectedTermsOfFacet( - filesFacets, - HCA_DCP_CATEGORY_KEY.ORGAN - ); - const organPart = listSelectedTermsOfFacet( - filesFacets, - HCA_DCP_CATEGORY_KEY.ORGAN_PART - ); - const pairedEnd = listSelectedTermsOfFacet( - filesFacets, - HCA_DCP_CATEGORY_KEY.PAIRED_END - ); - const projectCount = fileSummary.projectCount; - const specimenCount = fileSummary.specimenCount; - const specimenDisease = listSelectedTermsOfFacet( - filesFacets, - HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE - ); - const totalCellCount = fileSummary.totalCellCount; - const totalFileSize = fileSummary.totalFileSize; - - // Map summary by summary key or display text. - const summaryBySummaryKey = new Map(); - summaryBySummaryKey.set("Estimated Cells", formatCountSize(totalCellCount)); - summaryBySummaryKey.set( - HCA_DCP_CATEGORY_LABEL.FILE_SIZE, - formatFileSize(totalFileSize) - ); - summaryBySummaryKey.set("Files", formatCountSize(fileCount)); - summaryBySummaryKey.set("Projects", formatCountSize(projectCount)); - summaryBySummaryKey.set( - DATA_SUMMARY.GENUS_SPECIES, - displaySummaryTerms(genusSpecies) - ); - summaryBySummaryKey.set("Donors", formatCountSize(donorCount)); - summaryBySummaryKey.set( - DATA_SUMMARY.DONOR_DISEASE, - displaySummaryTerms(donorDisease) - ); // Disease Status (Donor) - summaryBySummaryKey.set("Specimens", formatCountSize(specimenCount)); - summaryBySummaryKey.set( - DATA_SUMMARY.DISEASE, - displaySummaryTerms(specimenDisease) - ); // Disease Status (Specimen) - summaryBySummaryKey.set(DATA_SUMMARY.ORGAN, displaySummaryTerms(organ)); // Anatomical Entity - summaryBySummaryKey.set( - DATA_SUMMARY.ORGAN_PART, - displaySummaryTerms(organPart) - ); - summaryBySummaryKey.set( - DATA_SUMMARY.LIBRARY_CONSTRUCTION_APPROACH, - displaySummaryTerms(libraryConstructionApproach) - ); // Library Construction Method - summaryBySummaryKey.set( - DATA_SUMMARY.PAIRED_END, - displaySummaryTerms(pairedEnd) - ); // Paired End - return summaryBySummaryKey; -} diff --git a/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/constants.ts b/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/constants.ts new file mode 100644 index 000000000..f9ade904e --- /dev/null +++ b/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/constants.ts @@ -0,0 +1,33 @@ +import { HCA_DCP_CATEGORY_LABEL } from "../../../../../../site-config/hca-dcp/category"; +import { FileSummary, SUMMARY } from "./entities"; + +export const DEFAULT_SUMMARY: FileSummary = { + donorCount: 0, + fileCount: 0, + fileTypeSummaries: [], + organTypes: [], + projectCount: 0, + specimenCount: 0, + totalCellCount: 0, + totalFileSize: 0, +}; + +/** + * Display text for summaries. + */ +export const SUMMARY_DISPLAY_TEXT = { + [SUMMARY.DONOR_COUNT]: "Donors", + [SUMMARY.DONOR_DISEASE]: "Disease Status (Donor)", + [SUMMARY.FILE_COUNT]: "Files", + [SUMMARY.GENUS_SPECIES]: "Species", + [SUMMARY.LIBRARY_CONSTRUCTION_APPROACH]: + HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, + [SUMMARY.ORGAN]: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, // anatomical entity + [SUMMARY.ORGAN_PART]: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, + [SUMMARY.PAIRED_END]: HCA_DCP_CATEGORY_LABEL.PAIRED_END, + [SUMMARY.PROJECT_COUNT]: "Projects", + [SUMMARY.SPECIMEN_COUNT]: "Specimens", + [SUMMARY.SPECIMEN_DISEASE]: "Disease Status (Specimen)", + [SUMMARY.TOTAL_CELL_COUNT]: "Estimated Cells", + [SUMMARY.TOTAL_FILE_SIZE]: HCA_DCP_CATEGORY_LABEL.FILE_SIZE, +}; diff --git a/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/entities.ts b/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/entities.ts new file mode 100644 index 000000000..d46e9dc23 --- /dev/null +++ b/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/entities.ts @@ -0,0 +1,42 @@ +/** + * Model of file summary. + */ +export interface FileSummary { + donorCount: number; + fileCount: number; + fileTypeSummaries: FileTypeSummary[]; + organTypes: string[]; + projectCount: number; + specimenCount: number; + totalCellCount: number; + totalFileSize: number; +} + +/** + * Model of file type summary. + */ +export interface FileTypeSummary { + count: number; + fileType: string; + matrixCellCount: number; + totalSize: number; +} + +/** + * Possible set of summaries. + */ +export const enum SUMMARY { + DONOR_COUNT = "DONOR_COUNT", + DONOR_DISEASE = "DONOR_DISEASE", + FILE_COUNT = "FILE_COUNT", + GENUS_SPECIES = "GENUS_SPECIES", + LIBRARY_CONSTRUCTION_APPROACH = "LIBRARY_CONSTRUCTION_APPROACH", + ORGAN = "ORGAN", + ORGAN_PART = "ORGAN_PART", + PAIRED_END = "PAIRED_END", + PROJECT_COUNT = "PROJECT_COUNT", + SPECIMEN_COUNT = "SPECIMEN_COUNT", + SPECIMEN_DISEASE = "SPECIMEN_DISEASE", + TOTAL_CELL_COUNT = "TOTAL_CELL_COUNT", + TOTAL_FILE_SIZE = "TOTAL_FILE_SIZE", +} diff --git a/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/summaryMapper.ts b/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/summaryMapper.ts new file mode 100644 index 000000000..f507fc4e0 --- /dev/null +++ b/explorer/app/viewModelBuilders/azul/hca-dcp/common/summaryMapper/summaryMapper.ts @@ -0,0 +1,163 @@ +import { + displaySummaryTerms, + listSelectedTermsOfFacet, +} from "@clevercanary/data-explorer-ui/lib/components/Export/components/ExportSummary/common/utils"; +import { FileFacet } from "@clevercanary/data-explorer-ui/lib/hooks/useFileManifest/common/entities"; +import { formatCountSize } from "@clevercanary/data-explorer-ui/lib/utils/formatCountSize"; +import { formatFileSize } from "@clevercanary/data-explorer-ui/lib/utils/formatFileSize"; +import { HCA_DCP_CATEGORY_KEY } from "../../../../../../site-config/hca-dcp/category"; +import { SummaryResponse } from "../../../../../apis/azul/hca-dcp/common/responses"; +import { DEFAULT_SUMMARY } from "./constants"; +import { FileSummary, SUMMARY } from "./entities"; + +/** + * Calculate the summary total cell count using the projects and estimatedCellCount values returned in the response. + * @param summaryResponse - Response model return from summary API. + * @returns summary total cell count. + */ +function calculateSummaryTotalCellCount( + summaryResponse: SummaryResponse +): number { + return (summaryResponse.projects ?? []).reduce( + (accum, { cellSuspensions, projects }) => { + if ( + projects && + (projects.estimatedCellCount || projects.estimatedCellCount === 0) + ) { + accum += projects.estimatedCellCount; + } else if ( + cellSuspensions && + (cellSuspensions.totalCells || cellSuspensions.totalCells === 0) + ) { + accum += cellSuspensions.totalCells; + } + return accum; + }, + 0 + ); +} + +/** + * Create a new file summary object (to trigger change detecting) from the file summary response, and fix erroneous + * total file size count if applicable. + * @param summaryResponse - Response model return from summary API. + * @returns file summary. + */ +export function bindFileSummaryResponse( + summaryResponse?: SummaryResponse +): FileSummary { + if (!summaryResponse) { + return DEFAULT_SUMMARY; + } + const totalFileSize = + typeof summaryResponse.totalFileSize === "string" + ? 0 + : summaryResponse.totalFileSize; + // Calculate total cell count (as per Azul 3521). + const totalCellCount = calculateSummaryTotalCellCount(summaryResponse); + return { + donorCount: summaryResponse.donorCount, + fileCount: summaryResponse.fileCount, + fileTypeSummaries: summaryResponse.fileTypeSummaries.map( + (fileTypeSummaryResponse) => { + return { + count: fileTypeSummaryResponse.count, + fileType: fileTypeSummaryResponse.format, + matrixCellCount: fileTypeSummaryResponse.matrixCellCount, + totalSize: fileTypeSummaryResponse.totalSize, + }; + } + ), + organTypes: summaryResponse.organTypes, + projectCount: summaryResponse.projectCount, + specimenCount: summaryResponse.specimenCount, + totalCellCount, + totalFileSize: totalFileSize, + }; +} + +/** + * Maps export summary related information, included formatted display text from the given file manifest. + * @param filesFacets - Files facets. + * @param summary - Response model return from summary API. + * @returns summaries key-value pairs of data summary and corresponding value. + */ +export function mapExportSummary( + filesFacets: FileFacet[], + summary: SummaryResponse | undefined +): Map { + const fileSummary = bindFileSummaryResponse(summary); + // Grab summary values. + const donorCount = fileSummary.donorCount; + const donorDisease = listSelectedTermsOfFacet( + filesFacets, + HCA_DCP_CATEGORY_KEY.DONOR_DISEASE + ); + const fileCount = fileSummary.fileCount; + const genusSpecies = listSelectedTermsOfFacet( + filesFacets, + HCA_DCP_CATEGORY_KEY.GENUS_SPECIES + ); + const libraryConstructionApproach = listSelectedTermsOfFacet( + filesFacets, + HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD + ); + const organ = listSelectedTermsOfFacet( + filesFacets, + HCA_DCP_CATEGORY_KEY.ORGAN + ); + const organPart = listSelectedTermsOfFacet( + filesFacets, + HCA_DCP_CATEGORY_KEY.ORGAN_PART + ); + const pairedEnd = listSelectedTermsOfFacet( + filesFacets, + HCA_DCP_CATEGORY_KEY.PAIRED_END + ); + const projectCount = fileSummary.projectCount; + const specimenCount = fileSummary.specimenCount; + const specimenDisease = listSelectedTermsOfFacet( + filesFacets, + HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE + ); + const totalCellCount = fileSummary.totalCellCount; + const totalFileSize = fileSummary.totalFileSize; + + // Map summary by summary key or display text. + const summaryBySummaryKey = new Map(); + summaryBySummaryKey.set( + SUMMARY.TOTAL_CELL_COUNT, + formatCountSize(totalCellCount) + ); // Estimated Cells + summaryBySummaryKey.set( + SUMMARY.TOTAL_FILE_SIZE, + formatFileSize(totalFileSize) + ); + summaryBySummaryKey.set(SUMMARY.FILE_COUNT, formatCountSize(fileCount)); + summaryBySummaryKey.set(SUMMARY.PROJECT_COUNT, formatCountSize(projectCount)); + summaryBySummaryKey.set( + SUMMARY.GENUS_SPECIES, + displaySummaryTerms(genusSpecies) + ); + summaryBySummaryKey.set(SUMMARY.DONOR_COUNT, formatCountSize(donorCount)); + summaryBySummaryKey.set( + SUMMARY.DONOR_DISEASE, + displaySummaryTerms(donorDisease) + ); // Disease Status (Donor) + summaryBySummaryKey.set( + SUMMARY.SPECIMEN_COUNT, + formatCountSize(specimenCount) + ); + summaryBySummaryKey.set( + SUMMARY.SPECIMEN_DISEASE, + displaySummaryTerms(specimenDisease) + ); // Disease Status (Specimen) + summaryBySummaryKey.set(SUMMARY.ORGAN, displaySummaryTerms(organ)); // Anatomical Entity + summaryBySummaryKey.set(SUMMARY.ORGAN_PART, displaySummaryTerms(organPart)); + summaryBySummaryKey.set( + SUMMARY.LIBRARY_CONSTRUCTION_APPROACH, + displaySummaryTerms(libraryConstructionApproach) + ); // Library Construction Method + summaryBySummaryKey.set(SUMMARY.PAIRED_END, displaySummaryTerms(pairedEnd)); // Paired End + return summaryBySummaryKey; +} diff --git a/explorer/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts b/explorer/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts index cadc7b871..16744e1dd 100644 --- a/explorer/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts +++ b/explorer/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts @@ -13,7 +13,6 @@ import { getConfig } from "@clevercanary/data-explorer-ui/lib/config/config"; import { ViewContext } from "@clevercanary/data-explorer-ui/lib/config/entities"; import { FileFacet, - FileManifest, FILE_MANIFEST_ACTION, } from "@clevercanary/data-explorer-ui/lib/hooks/useFileManifest/common/entities"; import { @@ -42,6 +41,7 @@ import { FilesResponse, ProjectsResponse, SamplesResponse, + SummaryResponse, } from "../../../../apis/azul/hca-dcp/common/responses"; import * as C from "../../../../components"; import { @@ -58,14 +58,8 @@ import { useFileManifestRequestURL } from "../../../../hooks/azul/useFileManifes import { humanFileSize } from "../../../../utils/fileSize"; import { mapAccessions } from "./accessionMapper/accessionMapper"; import { Accession } from "./accessionMapper/entities"; -import { - DATA_SUMMARY, - DATA_SUMMARY_DISPLAY_TEXT, -} from "./dataSummaryMapper/constants"; -import { - mapExportSummary, - mapProjectDataSummary, -} from "./dataSummaryMapper/dataSummaryMapper"; +import { DATA_SUMMARY_DISPLAY_TEXT } from "./dataSummaryMapper/constants"; +import { mapProjectDataSummary } from "./dataSummaryMapper/dataSummaryMapper"; import { AnalysisPortal } from "./projectMapper/projectEdits/entities"; import { mapProjectAnalysisPortals, @@ -84,6 +78,9 @@ import { groupProjectMatrixViewsBySpecies, projectMatrixMapper, } from "./projectMatrixMapper/projectMatrixMapper"; +import { SUMMARY_DISPLAY_TEXT } from "./summaryMapper/constants"; +import { SUMMARY } from "./summaryMapper/entities"; +import { mapExportSummary } from "./summaryMapper/summaryMapper"; /** * Build props for the KeyValuePairs component for displaying the project accessions. @@ -488,8 +485,10 @@ export const buildExportSelectedDataSummary = (): React.ComponentProps< typeof C.ExportSelectedDataSummary > => { return { - getExportSelectedDataSummary: (fileManifest: FileManifest) => - getExportSelectedDataSummary(fileManifest), + getExportSelectedDataSummary: ( + filesFacets: FileFacet[], + summary?: SummaryResponse + ) => getExportSelectedDataSummary(filesFacets, summary), }; }; @@ -607,14 +606,16 @@ export const buildFileSize = ( /** * Returns the export selected data summary for the given file manifest. - * @param fileManifest - File manifest. + * @param filesFacets - Files facets. + * @param summary - Response model return from summary API. * @returns export selected data summary. */ export function getExportSelectedDataSummary( - fileManifest: FileManifest + filesFacets: FileFacet[], + summary?: SummaryResponse ): Summary[] { - return [...mapExportSummary(fileManifest)].map(([key, value]) => [ - DATA_SUMMARY_DISPLAY_TEXT[key as DATA_SUMMARY] || key, + return [...mapExportSummary(filesFacets, summary)].map(([key, value]) => [ + SUMMARY_DISPLAY_TEXT[key as SUMMARY] || key, value, ]); } diff --git a/explorer/package-lock.json b/explorer/package-lock.json index ffc457ad8..4a1fbebf0 100644 --- a/explorer/package-lock.json +++ b/explorer/package-lock.json @@ -8,7 +8,7 @@ "name": "explorer", "version": "0.1.0", "dependencies": { - "@clevercanary/data-explorer-ui": "0.29.0", + "@clevercanary/data-explorer-ui": "0.31.0", "@emotion/react": "11.11.1", "@emotion/styled": "11.11.0", "@mdx-js/loader": "^2.3.0", @@ -2119,9 +2119,9 @@ "dev": true }, "node_modules/@clevercanary/data-explorer-ui": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@clevercanary/data-explorer-ui/-/data-explorer-ui-0.29.0.tgz", - "integrity": "sha512-fR2ASAzmYMRXqXfVAQxGmMwhodB2NgFiPfgSZ90BrbIjjj9xlWjKopQ/NMfbX4Rv4b4kJeD2ebTyaghw76AlBA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@clevercanary/data-explorer-ui/-/data-explorer-ui-0.31.0.tgz", + "integrity": "sha512-UU838fcSaKCWljd8pGKyP2HYCp3YeDSRRGAsWS+sCmucqdrcTdjeOuNlRP8Tbt8xYGDuO2r1qcbJmf+0CtrzQw==", "peerDependencies": { "@emotion/react": "11.11.1", "@emotion/styled": "11.11.0", @@ -4317,6 +4317,36 @@ "node": ">= 8" } }, + "node_modules/@next/swc-android-arm-eabi": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz", + "integrity": "sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-android-arm64": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz", + "integrity": "sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@next/swc-darwin-arm64": { "version": "12.3.1", "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz", @@ -4332,6 +4362,156 @@ "node": ">= 10" } }, + "node_modules/@next/swc-darwin-x64": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz", + "integrity": "sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-freebsd-x64": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz", + "integrity": "sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm-gnueabihf": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz", + "integrity": "sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz", + "integrity": "sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz", + "integrity": "sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz", + "integrity": "sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz", + "integrity": "sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz", + "integrity": "sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz", + "integrity": "sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz", + "integrity": "sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -25007,9 +25187,9 @@ "dev": true }, "@clevercanary/data-explorer-ui": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@clevercanary/data-explorer-ui/-/data-explorer-ui-0.29.0.tgz", - "integrity": "sha512-fR2ASAzmYMRXqXfVAQxGmMwhodB2NgFiPfgSZ90BrbIjjj9xlWjKopQ/NMfbX4Rv4b4kJeD2ebTyaghw76AlBA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@clevercanary/data-explorer-ui/-/data-explorer-ui-0.31.0.tgz", + "integrity": "sha512-UU838fcSaKCWljd8pGKyP2HYCp3YeDSRRGAsWS+sCmucqdrcTdjeOuNlRP8Tbt8xYGDuO2r1qcbJmf+0CtrzQw==", "requires": {} }, "@colors/colors": { @@ -26618,12 +26798,84 @@ } } }, + "@next/swc-android-arm-eabi": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz", + "integrity": "sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==", + "optional": true + }, + "@next/swc-android-arm64": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz", + "integrity": "sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==", + "optional": true + }, "@next/swc-darwin-arm64": { "version": "12.3.1", "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz", "integrity": "sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==", "optional": true }, + "@next/swc-darwin-x64": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz", + "integrity": "sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==", + "optional": true + }, + "@next/swc-freebsd-x64": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz", + "integrity": "sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==", + "optional": true + }, + "@next/swc-linux-arm-gnueabihf": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz", + "integrity": "sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==", + "optional": true + }, + "@next/swc-linux-arm64-gnu": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz", + "integrity": "sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==", + "optional": true + }, + "@next/swc-linux-arm64-musl": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz", + "integrity": "sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==", + "optional": true + }, + "@next/swc-linux-x64-gnu": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz", + "integrity": "sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==", + "optional": true + }, + "@next/swc-linux-x64-musl": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz", + "integrity": "sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==", + "optional": true + }, + "@next/swc-win32-arm64-msvc": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz", + "integrity": "sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==", + "optional": true + }, + "@next/swc-win32-ia32-msvc": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz", + "integrity": "sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==", + "optional": true + }, + "@next/swc-win32-x64-msvc": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz", + "integrity": "sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==", + "optional": true + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/explorer/package.json b/explorer/package.json index 628d413eb..6092ffdf9 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -33,7 +33,7 @@ "test:anvil-catalog": "playwright test -c playwright_anvil-catalog.config.ts" }, "dependencies": { - "@clevercanary/data-explorer-ui": "0.29.0", + "@clevercanary/data-explorer-ui": "0.31.0", "@emotion/react": "11.11.1", "@emotion/styled": "11.11.0", "@mdx-js/loader": "^2.3.0", diff --git a/explorer/site-config/anvil-catalog/dev/config.ts b/explorer/site-config/anvil-catalog/dev/config.ts index 5b1fdc338..fa1e52cfc 100644 --- a/explorer/site-config/anvil-catalog/dev/config.ts +++ b/explorer/site-config/anvil-catalog/dev/config.ts @@ -36,38 +36,42 @@ const config: SiteConfig = { }, authentication: undefined, browserURL: BROWSER_URL, - categoryConfigs: [ + categoryGroupConfigs: [ { - key: ANVIL_CATALOG_CATEGORY_KEY.CONSENT_CODE, - label: ANVIL_CATALOG_CATEGORY_LABEL.CONSENT_CODE, - }, - { - key: ANVIL_CATALOG_CATEGORY_KEY.CONSORTIUM, - label: ANVIL_CATALOG_CATEGORY_LABEL.CONSORTIUM, - }, - { - key: ANVIL_CATALOG_CATEGORY_KEY.DATA_TYPE, - label: ANVIL_CATALOG_CATEGORY_LABEL.DATA_TYPE, - }, - { - key: ANVIL_CATALOG_CATEGORY_KEY.DB_GAP_ID, - label: ANVIL_CATALOG_CATEGORY_LABEL.DB_GAP_ID, - }, - { - key: ANVIL_CATALOG_CATEGORY_KEY.DISEASE, - label: ANVIL_CATALOG_CATEGORY_LABEL.DISEASE, - }, - { - key: ANVIL_CATALOG_CATEGORY_KEY.STUDY_DESIGN, - label: ANVIL_CATALOG_CATEGORY_LABEL.STUDY_DESIGN, - }, - { - key: ANVIL_CATALOG_CATEGORY_KEY.STUDY_NAME, - label: ANVIL_CATALOG_CATEGORY_LABEL.STUDY_NAME, - }, - { - key: ANVIL_CATALOG_CATEGORY_KEY.WORKSPACE_NAME, - label: "Terra Workspace Name", // TODO review label here and elsewhere + categoryConfigs: [ + { + key: ANVIL_CATALOG_CATEGORY_KEY.CONSENT_CODE, + label: ANVIL_CATALOG_CATEGORY_LABEL.CONSENT_CODE, + }, + { + key: ANVIL_CATALOG_CATEGORY_KEY.CONSORTIUM, + label: ANVIL_CATALOG_CATEGORY_LABEL.CONSORTIUM, + }, + { + key: ANVIL_CATALOG_CATEGORY_KEY.DATA_TYPE, + label: ANVIL_CATALOG_CATEGORY_LABEL.DATA_TYPE, + }, + { + key: ANVIL_CATALOG_CATEGORY_KEY.DB_GAP_ID, + label: ANVIL_CATALOG_CATEGORY_LABEL.DB_GAP_ID, + }, + { + key: ANVIL_CATALOG_CATEGORY_KEY.DISEASE, + label: ANVIL_CATALOG_CATEGORY_LABEL.DISEASE, + }, + { + key: ANVIL_CATALOG_CATEGORY_KEY.STUDY_DESIGN, + label: ANVIL_CATALOG_CATEGORY_LABEL.STUDY_DESIGN, + }, + { + key: ANVIL_CATALOG_CATEGORY_KEY.STUDY_NAME, + label: ANVIL_CATALOG_CATEGORY_LABEL.STUDY_NAME, + }, + { + key: ANVIL_CATALOG_CATEGORY_KEY.WORKSPACE_NAME, + label: "Terra Workspace Name", // TODO review label here and elsewhere + }, + ], }, ], dataSource: { diff --git a/explorer/site-config/anvil-cmg/dev/config.ts b/explorer/site-config/anvil-cmg/dev/config.ts index 4cce20ce0..6f93b3ef3 100644 --- a/explorer/site-config/anvil-cmg/dev/config.ts +++ b/explorer/site-config/anvil-cmg/dev/config.ts @@ -30,58 +30,62 @@ export function make_config(browserUrl: string): SiteConfig { }, authentication: authenticationConfig, browserURL: browserUrl, - categoryConfigs: [ + categoryGroupConfigs: [ { - key: "biosamples.anatomical_site", - label: "Anatomical Site", - }, - { - key: "biosamples.biosample_type", - label: "BioSample Type", - }, - { - key: "datasets.consent_group", - label: "Consent Group", - }, - { - key: "activities.data_modality", - label: "Data Modality", - }, - { - key: "datasets.title", - label: "Dataset", - }, - { - key: "diagnoses.phenotype", - label: "Diagnosis", - }, - { - key: "files.file_format", - label: "File Format", - }, - { - key: "files.file_type", - label: "File Type", - }, - { - key: "datasets.registered_identifier", - label: "Identifier", - }, - { - key: "donors.organism_type", - label: "Organism Type", - }, - { - key: "donors.phenotypic_sex", - label: "Phenotypic Sex", - }, - { - key: "prep_material_name", - label: "Library Preparation", - }, - { - key: "donors.reported_ethnicity", - label: "Reported Ethnicity", + categoryConfigs: [ + { + key: "biosamples.anatomical_site", + label: "Anatomical Site", + }, + { + key: "biosamples.biosample_type", + label: "BioSample Type", + }, + { + key: "datasets.consent_group", + label: "Consent Group", + }, + { + key: "activities.data_modality", + label: "Data Modality", + }, + { + key: "datasets.title", + label: "Dataset", + }, + { + key: "diagnoses.phenotype", + label: "Diagnosis", + }, + { + key: "files.file_format", + label: "File Format", + }, + { + key: "files.file_type", + label: "File Type", + }, + { + key: "datasets.registered_identifier", + label: "Identifier", + }, + { + key: "donors.organism_type", + label: "Organism Type", + }, + { + key: "donors.phenotypic_sex", + label: "Phenotypic Sex", + }, + { + key: "prep_material_name", + label: "Library Preparation", + }, + { + key: "donors.reported_ethnicity", + label: "Reported Ethnicity", + }, + ], }, ], dataSource: { diff --git a/explorer/site-config/anvil/dev/config.ts b/explorer/site-config/anvil/dev/config.ts index faa735436..8385190a0 100644 --- a/explorer/site-config/anvil/dev/config.ts +++ b/explorer/site-config/anvil/dev/config.ts @@ -35,38 +35,42 @@ const config: SiteConfig = { analytics: undefined, authentication: authenticationConfig, browserURL: BROWSER_URL, - categoryConfigs: [ + categoryGroupConfigs: [ { - key: ANVIL_CATEGORY_KEY.BIOSAMPLE_TYPE, - label: ANVIL_CATEGORY_LABEL.BIOSAMPLE_TYPE, - }, - { - key: ANVIL_CATEGORY_KEY.DATA_MODALITY, - label: ANVIL_CATEGORY_LABEL.DATA_MODALITY, - }, - { - key: ANVIL_CATEGORY_KEY.FILE_FORMAT, - label: ANVIL_CATEGORY_LABEL.FILE_FORMAT, - }, - { - key: ANVIL_CATEGORY_KEY.FILE_TYPE, - label: ANVIL_CATEGORY_LABEL.FILE_TYPE, - }, - { - key: ANVIL_CATEGORY_KEY.ORGANISM_TYPE, - label: ANVIL_CATEGORY_LABEL.ORGANISM_TYPE, - }, - { - key: ANVIL_CATEGORY_KEY.PHENOTYPIC_SEX, - label: ANVIL_CATEGORY_LABEL.PHENOTYPIC_SEX, - }, - { - key: ANVIL_CATEGORY_KEY.LIBRARY_PREPARATION, - label: ANVIL_CATEGORY_LABEL.LIBRARY_PREPARATION, - }, - { - key: ANVIL_CATEGORY_KEY.REPORTED_ETHNICITY, - label: ANVIL_CATEGORY_LABEL.REPORTED_ETHNICITY, + categoryConfigs: [ + { + key: ANVIL_CATEGORY_KEY.BIOSAMPLE_TYPE, + label: ANVIL_CATEGORY_LABEL.BIOSAMPLE_TYPE, + }, + { + key: ANVIL_CATEGORY_KEY.DATA_MODALITY, + label: ANVIL_CATEGORY_LABEL.DATA_MODALITY, + }, + { + key: ANVIL_CATEGORY_KEY.FILE_FORMAT, + label: ANVIL_CATEGORY_LABEL.FILE_FORMAT, + }, + { + key: ANVIL_CATEGORY_KEY.FILE_TYPE, + label: ANVIL_CATEGORY_LABEL.FILE_TYPE, + }, + { + key: ANVIL_CATEGORY_KEY.ORGANISM_TYPE, + label: ANVIL_CATEGORY_LABEL.ORGANISM_TYPE, + }, + { + key: ANVIL_CATEGORY_KEY.PHENOTYPIC_SEX, + label: ANVIL_CATEGORY_LABEL.PHENOTYPIC_SEX, + }, + { + key: ANVIL_CATEGORY_KEY.LIBRARY_PREPARATION, + label: ANVIL_CATEGORY_LABEL.LIBRARY_PREPARATION, + }, + { + key: ANVIL_CATEGORY_KEY.REPORTED_ETHNICITY, + label: ANVIL_CATEGORY_LABEL.REPORTED_ETHNICITY, + }, + ], }, ], dataSource: { diff --git a/explorer/site-config/hca-dcp/dev/config.ts b/explorer/site-config/hca-dcp/dev/config.ts index 9d3d9d484..4e0493c61 100644 --- a/explorer/site-config/hca-dcp/dev/config.ts +++ b/explorer/site-config/hca-dcp/dev/config.ts @@ -39,86 +39,90 @@ const config: SiteConfig = { gtmPreview: "env-186", }, browserURL: BROWSER_URL, - categoryConfigs: [ + categoryGroupConfigs: [ { - key: HCA_DCP_CATEGORY_KEY.ANALYSIS_PROTOCOL, // workflow - label: HCA_DCP_CATEGORY_LABEL.ANALYSIS_PROTOCOL, - }, - { - key: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, // specimenOrgan - label: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, - }, - { - key: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, - label: HCA_DCP_CATEGORY_LABEL.BIOLOGICAL_SEX, - }, - { - key: HCA_DCP_CATEGORY_KEY.CONTENT_DESCRIPTION, - label: HCA_DCP_CATEGORY_LABEL.CONTENT_DESCRIPTION, - }, - { - key: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, - label: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, - }, - { - key: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, - label: HCA_DCP_CATEGORY_LABEL.DONOR_DISEASE, - }, - { - key: HCA_DCP_CATEGORY_KEY.FILE_FORMAT, - label: HCA_DCP_CATEGORY_LABEL.FILE_FORMAT, - }, - { - key: HCA_DCP_CATEGORY_KEY.FILE_SOURCE, - label: HCA_DCP_CATEGORY_LABEL.FILE_SOURCE, - }, - { - key: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, - label: HCA_DCP_CATEGORY_LABEL.GENUS_SPECIES, - }, - { - key: HCA_DCP_CATEGORY_KEY.INSTRUMENT_MANUFACTURER_MODEL, - label: HCA_DCP_CATEGORY_LABEL.INSTRUMENT_MANUFACTURER_MODEL, - }, - { - key: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, - label: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, - }, - { - key: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, - label: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, - }, - { - key: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, - label: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, - }, - { - key: HCA_DCP_CATEGORY_KEY.ORGAN_PART, - label: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, - }, - { - key: HCA_DCP_CATEGORY_KEY.PAIRED_END, - label: HCA_DCP_CATEGORY_LABEL.PAIRED_END, - }, - { - key: HCA_DCP_CATEGORY_KEY.PRESERVATION_METHOD, - label: HCA_DCP_CATEGORY_LABEL.PRESERVATION_METHOD, - }, - { - key: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, - label: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, - }, - { - key: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, - label: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, - }, - { - key: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, - label: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, - }, - { - key: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, - label: HCA_DCP_CATEGORY_LABEL.SPECIMEN_DISEASE, + categoryConfigs: [ + { + key: HCA_DCP_CATEGORY_KEY.ANALYSIS_PROTOCOL, // workflow + label: HCA_DCP_CATEGORY_LABEL.ANALYSIS_PROTOCOL, + }, + { + key: HCA_DCP_CATEGORY_KEY.ANATOMICAL_ENTITY, // specimenOrgan + label: HCA_DCP_CATEGORY_LABEL.ANATOMICAL_ENTITY, + }, + { + key: HCA_DCP_CATEGORY_KEY.BIOLOGICAL_SEX, + label: HCA_DCP_CATEGORY_LABEL.BIOLOGICAL_SEX, + }, + { + key: HCA_DCP_CATEGORY_KEY.CONTENT_DESCRIPTION, + label: HCA_DCP_CATEGORY_LABEL.CONTENT_DESCRIPTION, + }, + { + key: HCA_DCP_CATEGORY_KEY.DEVELOPMENT_STAGE, + label: HCA_DCP_CATEGORY_LABEL.DEVELOPMENT_STAGE, + }, + { + key: HCA_DCP_CATEGORY_KEY.DONOR_DISEASE, + label: HCA_DCP_CATEGORY_LABEL.DONOR_DISEASE, + }, + { + key: HCA_DCP_CATEGORY_KEY.FILE_FORMAT, + label: HCA_DCP_CATEGORY_LABEL.FILE_FORMAT, + }, + { + key: HCA_DCP_CATEGORY_KEY.FILE_SOURCE, + label: HCA_DCP_CATEGORY_LABEL.FILE_SOURCE, + }, + { + key: HCA_DCP_CATEGORY_KEY.GENUS_SPECIES, + label: HCA_DCP_CATEGORY_LABEL.GENUS_SPECIES, + }, + { + key: HCA_DCP_CATEGORY_KEY.INSTRUMENT_MANUFACTURER_MODEL, + label: HCA_DCP_CATEGORY_LABEL.INSTRUMENT_MANUFACTURER_MODEL, + }, + { + key: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD, + label: HCA_DCP_CATEGORY_LABEL.LIBRARY_CONSTRUCTION_METHOD, + }, + { + key: HCA_DCP_CATEGORY_KEY.MODEL_ORGAN, + label: HCA_DCP_CATEGORY_LABEL.MODEL_ORGAN, + }, + { + key: HCA_DCP_CATEGORY_KEY.NUCLEIC_ACID_SOURCE, + label: HCA_DCP_CATEGORY_LABEL.NUCLEIC_ACID_SOURCE, + }, + { + key: HCA_DCP_CATEGORY_KEY.ORGAN_PART, + label: HCA_DCP_CATEGORY_LABEL.ORGAN_PART, + }, + { + key: HCA_DCP_CATEGORY_KEY.PAIRED_END, + label: HCA_DCP_CATEGORY_LABEL.PAIRED_END, + }, + { + key: HCA_DCP_CATEGORY_KEY.PRESERVATION_METHOD, + label: HCA_DCP_CATEGORY_LABEL.PRESERVATION_METHOD, + }, + { + key: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, + label: HCA_DCP_CATEGORY_LABEL.PROJECT_TITLE, + }, + { + key: HCA_DCP_CATEGORY_KEY.SAMPLE_ENTITY_TYPE, + label: HCA_DCP_CATEGORY_LABEL.SAMPLE_ENTITY_TYPE, + }, + { + key: HCA_DCP_CATEGORY_KEY.SELECTED_CELL_TYPE, + label: HCA_DCP_CATEGORY_LABEL.SELECTED_CELL_TYPE, + }, + { + key: HCA_DCP_CATEGORY_KEY.SPECIMEN_DISEASE, + label: HCA_DCP_CATEGORY_LABEL.SPECIMEN_DISEASE, + }, + ], }, ], dataSource: { diff --git a/explorer/site-config/lungmap/dev/config.ts b/explorer/site-config/lungmap/dev/config.ts index d9c424c86..84009afa2 100644 --- a/explorer/site-config/lungmap/dev/config.ts +++ b/explorer/site-config/lungmap/dev/config.ts @@ -24,7 +24,7 @@ const LOGO: LogoProps = { const config: SiteConfig = { browserURL: BROWSER_URL, - categoryConfigs: hcaConfig.categoryConfigs, + categoryGroupConfigs: hcaConfig.categoryGroupConfigs, dataSource: { defaultDetailParams: { catalog: CATALOG_LM2, diff --git a/explorer/site-config/ncpi-catalog/dev/config.ts b/explorer/site-config/ncpi-catalog/dev/config.ts index 6e471ff32..6a3b198fc 100644 --- a/explorer/site-config/ncpi-catalog/dev/config.ts +++ b/explorer/site-config/ncpi-catalog/dev/config.ts @@ -26,34 +26,38 @@ const config: SiteConfig = { gtmPreview: "env-3", }, authentication: undefined, - categoryConfigs: [ + categoryGroupConfigs: [ { - key: NCPI_CATALOG_CATEGORY_KEY.PLATFORM, - label: NCPI_CATALOG_CATEGORY_LABEL.PLATFORM, - }, - { - key: NCPI_CATALOG_CATEGORY_KEY.TITLE, - label: NCPI_CATALOG_CATEGORY_LABEL.TITLE, - }, - { - key: NCPI_CATALOG_CATEGORY_KEY.DB_GAP_ID, - label: NCPI_CATALOG_CATEGORY_LABEL.DB_GAP_ID, - }, - { - key: NCPI_CATALOG_CATEGORY_KEY.FOCUS, - label: NCPI_CATALOG_CATEGORY_LABEL.FOCUS, - }, - { - key: NCPI_CATALOG_CATEGORY_KEY.DATA_TYPE, - label: NCPI_CATALOG_CATEGORY_LABEL.DATA_TYPE, - }, - { - key: NCPI_CATALOG_CATEGORY_KEY.STUDY_DESIGN, - label: NCPI_CATALOG_CATEGORY_LABEL.STUDY_DESIGN, - }, - { - key: NCPI_CATALOG_CATEGORY_KEY.CONSENT_CODE, - label: NCPI_CATALOG_CATEGORY_LABEL.CONSENT_CODE, + categoryConfigs: [ + { + key: NCPI_CATALOG_CATEGORY_KEY.PLATFORM, + label: NCPI_CATALOG_CATEGORY_LABEL.PLATFORM, + }, + { + key: NCPI_CATALOG_CATEGORY_KEY.TITLE, + label: NCPI_CATALOG_CATEGORY_LABEL.TITLE, + }, + { + key: NCPI_CATALOG_CATEGORY_KEY.DB_GAP_ID, + label: NCPI_CATALOG_CATEGORY_LABEL.DB_GAP_ID, + }, + { + key: NCPI_CATALOG_CATEGORY_KEY.FOCUS, + label: NCPI_CATALOG_CATEGORY_LABEL.FOCUS, + }, + { + key: NCPI_CATALOG_CATEGORY_KEY.DATA_TYPE, + label: NCPI_CATALOG_CATEGORY_LABEL.DATA_TYPE, + }, + { + key: NCPI_CATALOG_CATEGORY_KEY.STUDY_DESIGN, + label: NCPI_CATALOG_CATEGORY_LABEL.STUDY_DESIGN, + }, + { + key: NCPI_CATALOG_CATEGORY_KEY.CONSENT_CODE, + label: NCPI_CATALOG_CATEGORY_LABEL.CONSENT_CODE, + }, + ], }, ], entities: [studiesEntityConfig, platformsEntityConfig],