From 98b26b77c337fbd258236fdd726e5e76e25e068f Mon Sep 17 00:00:00 2001 From: Alek Perron Date: Wed, 7 Feb 2024 11:41:37 -0500 Subject: [PATCH 1/3] fix: SKFP-817 adjust Variant entity sample type casing and biospecimen availability mapping --- .../components/PageContent/tabs/Biospecimens/index.tsx | 2 +- src/views/VariantEntity/utils/summary.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx index 37d45c721..a2aa01de0 100644 --- a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx +++ b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx @@ -154,7 +154,7 @@ const getDefaultColumns = (): ProColumnType[] => [ key: 'status', title: intl.get('entities.biospecimen.sample_availabilty'), dataIndex: 'status', - render: (status) => capitalize(status) || TABLE_EMPTY_PLACE_HOLDER, + render: (status: string) => (status?.toLowerCase() === 'available' ? 'Yes' : 'No'), }, { key: 'nb_files', diff --git a/src/views/VariantEntity/utils/summary.tsx b/src/views/VariantEntity/utils/summary.tsx index cf9e5a271..be83c1725 100644 --- a/src/views/VariantEntity/utils/summary.tsx +++ b/src/views/VariantEntity/utils/summary.tsx @@ -36,7 +36,9 @@ export const getSummaryItems = (variant?: IVariantEntity): IEntitySummaryColumns }, { label: intl.get('screen.variants.summary.type'), - value: variant?.variant_class || TABLE_EMPTY_PLACE_HOLDER, + value: variant?.variant_class + ? removeUnderscoreAndCapitalize(variant?.variant_class) + : TABLE_EMPTY_PLACE_HOLDER, }, { label: intl.get('screen.variants.summary.cytoband'), From 19f45c35c4b61fe58a1192b77de0131640aae794 Mon Sep 17 00:00:00 2001 From: Alek Perron Date: Wed, 7 Feb 2024 13:12:56 -0500 Subject: [PATCH 2/3] fix: SKFP-817 remove unused import --- .../components/PageContent/tabs/Biospecimens/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx index a2aa01de0..7678b858f 100644 --- a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx +++ b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx @@ -21,7 +21,6 @@ import { IBiospecimenEntity } from 'graphql/biospecimens/models'; import { INDEXES } from 'graphql/constants'; import { IParticipantEntity } from 'graphql/participants/models'; import { IStudyEntity } from 'graphql/studies/models'; -import { capitalize } from 'lodash'; import SetsManagementDropdown from 'views/DataExploration/components/SetsManagementDropdown'; import { BIOSPECIMENS_SAVED_SETS_FIELD, From 40696ea7443c0cd9eb0c95712d64bcb98c910da8 Mon Sep 17 00:00:00 2001 From: Alek Perron Date: Wed, 7 Feb 2024 13:57:39 -0500 Subject: [PATCH 3/3] fix: SKFP-817 make use of status ENUM and translations file for availability --- .../components/PageContent/tabs/Biospecimens/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx index 7678b858f..f06774368 100644 --- a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx +++ b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx @@ -17,7 +17,7 @@ import { SortDirection } from '@ferlab/ui/core/graphql/constants'; import { numberWithCommas } from '@ferlab/ui/core/utils/numberUtils'; import { Button, Tooltip } from 'antd'; import { useBiospecimen } from 'graphql/biospecimens/actions'; -import { IBiospecimenEntity } from 'graphql/biospecimens/models'; +import { IBiospecimenEntity, Status } from 'graphql/biospecimens/models'; import { INDEXES } from 'graphql/constants'; import { IParticipantEntity } from 'graphql/participants/models'; import { IStudyEntity } from 'graphql/studies/models'; @@ -153,7 +153,8 @@ const getDefaultColumns = (): ProColumnType[] => [ key: 'status', title: intl.get('entities.biospecimen.sample_availabilty'), dataIndex: 'status', - render: (status: string) => (status?.toLowerCase() === 'available' ? 'Yes' : 'No'), + render: (status: string) => + status === Status.AVAILABLE ? intl.get('global.yes') : intl.get('global.no'), }, { key: 'nb_files',