From eff6b5ab9ac36e2d915f4fef29b22a6decfd3280 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Sun, 16 Aug 2026 17:47:51 -0700 Subject: [PATCH 1/3] fix: remove references to sampleId field removed from Azul backend The Azul backend no longer supports the `sampleId` field, and the inner `samples[].id` property is likewise absent from `/index/samples` and `/index/files` responses. This broke the HCA and LungMAP samples tables, which sorted by `sampleId` by default and so failed with `400 BadRequestError: Unknown field 'sampleId'`, and left the Sample Id columns in the samples and files tables rendering empty values. Remove the Sample Id columns from the HCA and LungMAP samples and files tables, along with the category key and label, the `buildSampleId` and `buildAggregatedSampleId` view model builders, the `SAMPLE_ID` metadata key, and the `id` property on `SampleResponse` and `AggregatedSampleResponse`. Default sorting on both samples tables changes to `projectTitle`, now the leading column, matching the files tables which sort by their own leading column. Co-Authored-By: Claude Opus 5 (1M context) --- .../azul/hca-dcp/common/aggregatedEntities.ts | 1 - app/apis/azul/hca-dcp/common/entities.ts | 1 - app/components/Index/common/constants.ts | 2 -- app/components/Index/common/entities.ts | 1 - .../azul/hca-dcp/common/viewModelBuilders.tsx | 27 ------------------- site-config/hca-dcp/category.ts | 2 -- .../hca-dcp/ma-dev/entities/files/columns.ts | 11 -------- .../ma-dev/entities/files/tableOptions.ts | 1 - .../ma-dev/entities/samples/columns.ts | 11 -------- .../ma-dev/entities/samples/tableOptions.ts | 2 +- .../lungmap/dev/index/filesEntityConfig.ts | 10 ------- .../lungmap/dev/index/samplesEntityConfig.ts | 11 +------- 12 files changed, 2 insertions(+), 78 deletions(-) diff --git a/app/apis/azul/hca-dcp/common/aggregatedEntities.ts b/app/apis/azul/hca-dcp/common/aggregatedEntities.ts index 945a71218..bd184abde 100644 --- a/app/apis/azul/hca-dcp/common/aggregatedEntities.ts +++ b/app/apis/azul/hca-dcp/common/aggregatedEntities.ts @@ -120,7 +120,6 @@ export interface AggregatedSampleResponse { cellLineType?: string[]; disease?: (string | null)[]; effectiveOrgan?: (string | null)[]; - id: string[]; modelOrgan?: (string | null)[]; modelOrganPart?: (string | null)[]; organ?: string[]; diff --git a/app/apis/azul/hca-dcp/common/entities.ts b/app/apis/azul/hca-dcp/common/entities.ts index 905ad447c..6f0c0ad4d 100644 --- a/app/apis/azul/hca-dcp/common/entities.ts +++ b/app/apis/azul/hca-dcp/common/entities.ts @@ -138,7 +138,6 @@ export interface SampleResponse { cellLineType?: string; disease?: (string | null)[]; effectiveOrgan: string | null; - id: string; modelOrgan?: string | null; modelOrganPart?: string | null; organ?: string; diff --git a/app/components/Index/common/constants.ts b/app/components/Index/common/constants.ts index e2ca7209f..755d8bafa 100644 --- a/app/components/Index/common/constants.ts +++ b/app/components/Index/common/constants.ts @@ -32,7 +32,6 @@ const { PHENOTYPIC_SEX, PLATFORM, REPORTED_ETHNICITY, - SAMPLE_ID, SAMPLE_TYPE, SELECTED_CELL_TYPE, STUDY, @@ -118,7 +117,6 @@ export const PLURALIZED_METADATA_LABEL = { [PHENOTYPIC_SEX]: "phenotypic sexes", [PLATFORM]: "platforms", [REPORTED_ETHNICITY]: "reported ethnicities", - [SAMPLE_ID]: "sample ids", [SAMPLE_TYPE]: "sample types", [SELECTED_CELL_TYPE]: "cell types", [STUDY]: "studies", diff --git a/app/components/Index/common/entities.ts b/app/components/Index/common/entities.ts index f900f2f6c..9c276a1b8 100644 --- a/app/components/Index/common/entities.ts +++ b/app/components/Index/common/entities.ts @@ -34,7 +34,6 @@ export enum METADATA_KEY { PHENOTYPIC_SEX = "PHENOTYPIC_SEX", PLATFORM = "PLATFORM", REPORTED_ETHNICITY = "REPORTED_ETHNICITY", - SAMPLE_ID = "SAMPLE_ID", SAMPLE_TYPE = "SAMPLE_TYPE", SELECTED_CELL_TYPE = "SELECTED_CELL_TYPE", SPECIES = "SPECIES", diff --git a/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.tsx b/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.tsx index bc632f70d..025841713 100644 --- a/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.tsx +++ b/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.tsx @@ -404,20 +404,6 @@ export const buildAggregatedSampleEntityType = ( }; }; -/** - * Build props for the aggregated sample ID NTagCell component from the given entity response. - * @param entityResponse - Response model return from the entity response API. - * @returns model to be used as props for the NTagCell component. - */ -export const buildAggregatedSampleId = ( - entityResponse: ProjectsResponse | FilesResponse -): React.ComponentProps => { - return { - label: getPluralizedMetadataLabel(METADATA_KEY.SAMPLE_ID), - values: processAggregatedOrArrayValue(entityResponse.samples, "id"), - }; -}; - /** * Build props for the aggregated model organ NTagCell component from the given entity response. * @param entityResponse - Response model return from the entity response API. @@ -1392,19 +1378,6 @@ export const buildSampleEntityType = ( }; }; -/** - * Build props for sample identifier BasicCell component from the given sample response. - * @param samplesResponse - Response model return from samples API. - * @returns model to be used as props for the BasicCell component. - */ -export const buildSampleId = ( - samplesResponse: SamplesResponse -): React.ComponentProps => { - return { - value: processEntityValue(samplesResponse.samples, "id"), - }; -}; - /** * Build props for the model organ BasicCell component from the given samples response. * @param samplesResponse - Response model return from the samples API. diff --git a/site-config/hca-dcp/category.ts b/site-config/hca-dcp/category.ts index 803d59f23..d439dab65 100644 --- a/site-config/hca-dcp/category.ts +++ b/site-config/hca-dcp/category.ts @@ -38,7 +38,6 @@ export const HCA_DCP_CATEGORY_KEY = { PROJECT_TITLE: "projectTitle", PUBLICATION_TITLE: "publicationTitle", SAMPLE_ENTITY_TYPE: "sampleEntityType", - SAMPLE_ID: "sampleId", SAMPLE_TYPE: "sampleType", SELECTED_CELL_TYPE: "selectedCellType", SPECIMEN_DISEASE: "specimenDisease", @@ -84,7 +83,6 @@ export const HCA_DCP_CATEGORY_LABEL = { PROJECT_TITLE: "Project Title", PUBLICATION_TITLE: "Publication Title", SAMPLE_ENTITY_TYPE: "Sample Type", - SAMPLE_ID: "Sample Id", SAMPLE_TYPE: "Sample Type", SELECTED_CELL_TYPE: "Selected Cell Type", SPECIMEN_DISEASE: "Specimen Disease", diff --git a/site-config/hca-dcp/ma-dev/entities/files/columns.ts b/site-config/hca-dcp/ma-dev/entities/files/columns.ts index f74d2f9ad..a2468a0b7 100644 --- a/site-config/hca-dcp/ma-dev/entities/files/columns.ts +++ b/site-config/hca-dcp/ma-dev/entities/files/columns.ts @@ -214,16 +214,6 @@ const SAMPLE_ENTITY_TYPE: ColumnConfig = { 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, @@ -274,7 +264,6 @@ export const COLUMNS: EntityConfig["list"]["columns"] = [ CONTENT_DESCRIPTION, FILE_SOURCE, PROJECT_TITLE, - SAMPLE_ID, GENUS_SPECIES, SAMPLE_ENTITY_TYPE, SPECIMEN_ORGAN, diff --git a/site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts b/site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts index b5454e0a5..548198be5 100644 --- a/site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts +++ b/site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts @@ -11,7 +11,6 @@ export const TABLE_OPTIONS: EntityConfig["list"]["tableOptions"] 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, diff --git a/site-config/hca-dcp/ma-dev/entities/samples/columns.ts b/site-config/hca-dcp/ma-dev/entities/samples/columns.ts index 407ae8a3b..9641cd34b 100644 --- a/site-config/hca-dcp/ma-dev/entities/samples/columns.ts +++ b/site-config/hca-dcp/ma-dev/entities/samples/columns.ts @@ -141,16 +141,6 @@ const SAMPLE_ENTITY_TYPE: ColumnConfig = { 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, @@ -192,7 +182,6 @@ const WORKFLOW: ColumnConfig = { }; export const COLUMNS: EntityConfig["list"]["columns"] = [ - SAMPLE_ID, PROJECT_TITLE, GENUS_SPECIES, SAMPLE_ENTITY_TYPE, diff --git a/site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts b/site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts index 04982ac73..4f5e0722e 100644 --- a/site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts +++ b/site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts @@ -23,7 +23,7 @@ export const TABLE_OPTIONS: EntityConfig["list"]["tableOptions" sorting: [ { desc: SORT_DIRECTION.ASCENDING, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, + id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, }, ], }, diff --git a/site-config/lungmap/dev/index/filesEntityConfig.ts b/site-config/lungmap/dev/index/filesEntityConfig.ts index 76cb79484..11983cddf 100644 --- a/site-config/lungmap/dev/index/filesEntityConfig.ts +++ b/site-config/lungmap/dev/index/filesEntityConfig.ts @@ -100,15 +100,6 @@ export const filesEntityConfig: EntityConfig = { 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, @@ -250,7 +241,6 @@ export const filesEntityConfig: EntityConfig = { 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, diff --git a/site-config/lungmap/dev/index/samplesEntityConfig.ts b/site-config/lungmap/dev/index/samplesEntityConfig.ts index dcfa2116e..76afaf64d 100644 --- a/site-config/lungmap/dev/index/samplesEntityConfig.ts +++ b/site-config/lungmap/dev/index/samplesEntityConfig.ts @@ -25,15 +25,6 @@ export const samplesEntityConfig: EntityConfig = { 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, @@ -207,7 +198,7 @@ export const samplesEntityConfig: EntityConfig = { sorting: [ { desc: SORT_DIRECTION.ASCENDING, - id: HCA_DCP_CATEGORY_KEY.SAMPLE_ID, + id: HCA_DCP_CATEGORY_KEY.PROJECT_TITLE, }, ], }, From 4e3a1318ca57004143440c5c43d6fa5ca044159d Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Wed, 19 Aug 2026 09:11:28 -0700 Subject: [PATCH 2/3] fix: drop stale samples id from schema.org project fixture (#4928) The fixture in the buildHcaProjectJsonLd test still set `id` on the aggregated samples entry, a field removed from `AggregatedSampleResponse` in this branch. The `as unknown as Partial` double assertion suppressed the resulting type error, so `tsc` did not flag it. `buildKeywords` never reads `id`, so no assertion changes. The `id` on the adjacent specimens entry is left alone: `AggregatedSpecimenResponse` still declares it. Co-Authored-By: Claude Opus 5 (1M context) --- __tests__/utils/schemaOrg/hcaProjectDataset.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts b/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts index eb7b5ad41..48c0248ed 100644 --- a/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts +++ b/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts @@ -250,7 +250,6 @@ describe("buildHcaProjectJsonLd", () => { samples: [ { disease: ["normal"], - id: ["s1"], organ: ["brain"], organPart: ["cortex"], sampleEntityType: ["specimens"], From 9f2f3dffc5a030fc083070761b41cbbf9cf80078 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Wed, 19 Aug 2026 09:15:50 -0700 Subject: [PATCH 3/3] fix: remove stale specimens id from aggregated response type (#4928) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `AggregatedSpecimenResponse.id` no longer exists in the Azul response. Verified against catalog dcp60: across 74 inner `specimens` objects from /index/projects, /index/files and /index/samples, the keys are only disease, organ, organPart, preservationMethod and source. No code read the field — the three readers of `specimens` use disease, organ and organPart — so this is a type-accuracy fix with no behavioural change. The matching `id` in the buildHcaProjectJsonLd fixture goes too, since leaving it would reintroduce the same silently-cast stale property. Co-Authored-By: Claude Opus 5 (1M context) --- __tests__/utils/schemaOrg/hcaProjectDataset.test.ts | 1 - app/apis/azul/hca-dcp/common/aggregatedEntities.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts b/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts index 48c0248ed..0c5ba137f 100644 --- a/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts +++ b/__tests__/utils/schemaOrg/hcaProjectDataset.test.ts @@ -258,7 +258,6 @@ describe("buildHcaProjectJsonLd", () => { specimens: [ { disease: ["normal"], - id: ["s1"], organ: ["brain"], organPart: ["cortex"], preservationMethod: [], diff --git a/app/apis/azul/hca-dcp/common/aggregatedEntities.ts b/app/apis/azul/hca-dcp/common/aggregatedEntities.ts index bd184abde..248a4b14a 100644 --- a/app/apis/azul/hca-dcp/common/aggregatedEntities.ts +++ b/app/apis/azul/hca-dcp/common/aggregatedEntities.ts @@ -143,7 +143,6 @@ export interface AggregatedSamplesResponse { */ export interface AggregatedSpecimenResponse { disease: (string | null)[]; - id: string[]; organ: string[]; organPart: (string | null)[]; preservationMethod: (string | null)[];