|
1 | 1 | import { LABEL } from "@clevercanary/data-explorer-ui/lib/apis/azul/common/entities";
|
2 | 2 | import { stringifyValues } from "@clevercanary/data-explorer-ui/lib/common/utils";
|
3 | 3 | import { Value } from "@clevercanary/data-explorer-ui/lib/components/common/KeyValuePairs/keyValuePairs";
|
| 4 | +import { NTagCell } from "@clevercanary/data-explorer-ui/lib/components/Index/components/NTagCell/nTagCell"; |
4 | 5 | import { ANCHOR_TARGET } from "@clevercanary/data-explorer-ui/lib/components/Links/common/entities";
|
5 | 6 | import { Links } from "@clevercanary/data-explorer-ui/lib/components/Links/links";
|
6 | 7 | import { formatCountSize } from "@clevercanary/data-explorer-ui/lib/utils/formatCountSize";
|
| 8 | +import { METADATA_KEY } from "app/components/Index/common/entities"; |
| 9 | +import { getPluralizedMetadataLabel } from "app/components/Index/common/indexTransformer"; |
7 | 10 | import { HCA_DCP_CATEGORY_KEY } from "../../../../../../site-config/hca-dcp/category";
|
8 | 11 | import {
|
9 | 12 | processAggregatedBooleanOrArrayValue,
|
@@ -149,42 +152,101 @@ export function mapProjectDataSummary(
|
149 | 152 | HCA_DCP_CATEGORY_KEY.WORKFLOW
|
150 | 153 | );
|
151 | 154 | details.set(DATA_SUMMARY.PROJECT_SHORTNAME, projectShortname);
|
152 |
| - details.set(DATA_SUMMARY.GENUS_SPECIES, stringifyValues(genusSpecies)); |
| 155 | + details.set( |
| 156 | + DATA_SUMMARY.GENUS_SPECIES, |
| 157 | + NTagCell({ |
| 158 | + label: getPluralizedMetadataLabel(METADATA_KEY.SPECIES), |
| 159 | + values: genusSpecies, |
| 160 | + }) |
| 161 | + ); |
153 | 162 | details.set(
|
154 | 163 | DATA_SUMMARY.SAMPLE_ENTITY_TYPE,
|
155 |
| - stringifyValues(sampleEntityType) |
| 164 | + NTagCell({ |
| 165 | + label: getPluralizedMetadataLabel(METADATA_KEY.SAMPLE_TYPE), |
| 166 | + values: sampleEntityType, |
| 167 | + }) |
156 | 168 | ); // Sample Type
|
157 |
| - details.set(DATA_SUMMARY.ORGAN, stringifyValues(organ)); // Anatomical Entity |
158 |
| - details.set(DATA_SUMMARY.ORGAN_PART, stringifyValues(organPart)); // Organ Part |
| 169 | + details.set( |
| 170 | + DATA_SUMMARY.ORGAN, |
| 171 | + NTagCell({ |
| 172 | + label: getPluralizedMetadataLabel(METADATA_KEY.ANATOMICAL_ENTITY), |
| 173 | + values: organ, |
| 174 | + }) |
| 175 | + ); // Anatomical Entity |
| 176 | + details.set( |
| 177 | + DATA_SUMMARY.ORGAN_PART, |
| 178 | + NTagCell({ |
| 179 | + label: getPluralizedMetadataLabel(METADATA_KEY.ORGAN_PART), |
| 180 | + values: organPart, |
| 181 | + }) |
| 182 | + ); // Organ Part |
159 | 183 | details.set(
|
160 | 184 | DATA_SUMMARY.SELECTED_CELL_TYPE,
|
161 |
| - stringifyValues(selectedCellType) |
| 185 | + NTagCell({ |
| 186 | + label: getPluralizedMetadataLabel(METADATA_KEY.SELECTED_CELL_TYPE), |
| 187 | + values: selectedCellType, |
| 188 | + }) |
162 | 189 | ); // Selected Cell Types
|
163 | 190 | // Model organ should only display a value when sampleEntityType is cellLines or organoids i.e. "modelOrgan" will
|
164 | 191 | // not display if the sampleEntityType is "specimens".
|
165 | 192 | if (!isSampleEntityTypeSpecimens(sampleEntityType)) {
|
166 |
| - details.set(DATA_SUMMARY.MODEL_ORGAN, stringifyValues(modelOrgan)); // Model Organ |
| 193 | + details.set( |
| 194 | + DATA_SUMMARY.MODEL_ORGAN, |
| 195 | + NTagCell({ |
| 196 | + label: getPluralizedMetadataLabel(METADATA_KEY.MODEL_ORGAN), |
| 197 | + values: modelOrgan, |
| 198 | + }) |
| 199 | + ); // Model Organ |
167 | 200 | }
|
168 |
| - details.set(DATA_SUMMARY.DISEASE, stringifyValues(disease)); // Disease Status (Specimen) |
169 |
| - details.set(DATA_SUMMARY.DONOR_DISEASE, stringifyValues(donorDisease)); // Disease Status (Donor) |
| 201 | + details.set( |
| 202 | + DATA_SUMMARY.DISEASE, |
| 203 | + NTagCell({ |
| 204 | + label: getPluralizedMetadataLabel(METADATA_KEY.DISEASE_STATUS_SPECIMEN), |
| 205 | + values: disease, |
| 206 | + }) |
| 207 | + ); // Disease Status (Specimen) |
| 208 | + details.set( |
| 209 | + DATA_SUMMARY.DONOR_DISEASE, |
| 210 | + NTagCell({ |
| 211 | + label: getPluralizedMetadataLabel(METADATA_KEY.DISEASE_STATUS_DONOR), |
| 212 | + values: donorDisease, |
| 213 | + }) |
| 214 | + ); // Disease Status (Donor) |
170 | 215 | details.set(
|
171 | 216 | DATA_SUMMARY.DEVELOPMENT_STAGE,
|
172 |
| - stringifyValues(developmentStage) |
| 217 | + NTagCell({ |
| 218 | + label: getPluralizedMetadataLabel(METADATA_KEY.DEVELOPMENT_STAGE), |
| 219 | + values: developmentStage, |
| 220 | + }) |
173 | 221 | ); // Development Stage
|
174 | 222 | details.set(
|
175 | 223 | DATA_SUMMARY.LIBRARY_CONSTRUCTION_APPROACH,
|
176 |
| - stringifyValues(libraryConstructionApproach) |
| 224 | + NTagCell({ |
| 225 | + label: getPluralizedMetadataLabel( |
| 226 | + METADATA_KEY.LIBRARY_CONSTRUCTION_APPROACH |
| 227 | + ), |
| 228 | + values: libraryConstructionApproach, |
| 229 | + }) |
177 | 230 | ); // Library Construction Method
|
178 | 231 | details.set(
|
179 | 232 | DATA_SUMMARY.NUCLEIC_ACID_SOURCE,
|
180 |
| - stringifyValues(nucleicAcidSource) |
| 233 | + NTagCell({ |
| 234 | + label: getPluralizedMetadataLabel(METADATA_KEY.NUCLEIC_ACID_SOURCE), |
| 235 | + values: nucleicAcidSource, |
| 236 | + }) |
181 | 237 | ); // Nucleic Acid Source
|
182 | 238 | details.set(DATA_SUMMARY.PAIRED_END, stringifyValues(pairedEnd)); // Paired End
|
183 | 239 | // Workflow will not display if "Unspecified".
|
184 | 240 | if (isWorkflowSpecified(workflow)) {
|
185 | 241 | details.set(DATA_SUMMARY.WORKFLOW, getWorkflowValue(workflow)); // Analysis Protocol
|
186 | 242 | }
|
187 |
| - details.set(DATA_SUMMARY.FILE_FORMAT, stringifyValues(fileFormat)); // File Format |
| 243 | + details.set( |
| 244 | + DATA_SUMMARY.FILE_FORMAT, |
| 245 | + NTagCell({ |
| 246 | + label: getPluralizedMetadataLabel(METADATA_KEY.FILE_FORMAT), |
| 247 | + values: fileFormat, |
| 248 | + }) |
| 249 | + ); // File Format |
188 | 250 | details.set(DATA_SUMMARY.TOTAL_CELLS, totalCells); // Cell Count Estimate
|
189 | 251 | details.set(DATA_SUMMARY.DONOR_COUNT, formatCountSize(donorCount)); // Donor Count
|
190 | 252 | return details;
|
|
0 commit comments