Skip to content

Commit

Permalink
Merge branch '2.0' into fix-source-text-tumor-descriptor-display
Browse files Browse the repository at this point in the history
  • Loading branch information
evans-g-crsj authored Nov 16, 2023
2 parents b8b980f + 93f1ab1 commit 4f6c5f9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 44 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@apollo/client": "^3.5.10",
"@dnd-kit/core": "^4.0.3",
"@dnd-kit/sortable": "^5.1.0",
"@ferlab/ui": "^7.14.7",
"@ferlab/ui": "^7.14.8",
"@loadable/component": "^5.15.2",
"@react-keycloak/core": "^3.2.0",
"@react-keycloak/web": "^3.4.0",
Expand Down
6 changes: 6 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1511,25 +1511,31 @@ const en = {
family_id: 'Family ID',
family_relationship: 'Family Relationship',
family_unit: 'Family Composition',
hpo_phenotype_observed: 'Observed Phenotype (HPO)',
hpo_term: 'HPO Term',
hpo_term_tooltip: '# of participants with this exact HPO term',
interpretation: 'Interpretation',
mondo_diagnosis: 'Diagnosis (MONDO)',
mondo_term: 'MONDO Term',
mondo_term_tooltip: '# of participants with this exact MONDO term',
nb_biospecimens: 'Biospecimens',
nb_files: 'Files',
not_observed: 'Not observed',
observed: 'Observed',
other: 'Other',
participant_id: 'Participant ID',
pedcBioPortal: 'PedcBioPortal',
phenotype: 'Phenotype',
phenotype_hpo: 'Phenotype (HPO)',
phenotypes_hpo_not_observed: 'Not Observed Phenotype (HPO)',
phenotype_source_text: 'Phenotype (Source Text)',
proband: 'Proband',
proband_only: 'Proband-only',
profile: 'Profile',
race: 'Race',
sex: 'Sex',
source_text_phenotype: 'Observed Phenotype (Source Text)',
study: 'Study',
trio: 'Trio',
trio_plus: ' Trio+',
trisomy: 'T21: "Trisomy 21"',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
import intl from 'react-intl-universal';
import { useDispatch } from 'react-redux';
import { Link } from 'react-router-dom';
import { DownloadOutlined } from '@ant-design/icons';
Expand Down Expand Up @@ -49,7 +50,6 @@ import {
import { mapStudyToPedcBioportal } from 'views/Studies/utils/helper';

import { TABLE_EMPTY_PLACE_HOLDER } from 'common/constants';
import OutcomesAgeCells from 'components/OutcomesAgeCells';
import { ReportType } from 'services/api/reports/models';
import { SetType } from 'services/api/savedSet/models';
import { fetchReport, fetchTsvReport } from 'store/report/thunks';
Expand All @@ -65,10 +65,10 @@ interface OwnProps {
sqon?: ISqonGroupFilter;
}

const defaultColumns: ProColumnType[] = [
const getDefaultColumns = (): ProColumnType[] => [
{
key: 'participant_id',
title: 'Participant ID',
title: intl.get('entities.participant.participant_id'),
dataIndex: 'participant_id',
sorter: {
multiple: 1,
Expand All @@ -79,7 +79,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'study.study_code',
title: 'Study',
title: intl.get('entities.participant.study'),
sorter: {
multiple: 1,
},
Expand All @@ -89,7 +89,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'study_external_id',
title: 'dbGaP',
title: intl.get('entities.participant.dbgap'),
dataIndex: 'study_external_id',
render: (study_external_id: string) =>
study_external_id ? (
Expand All @@ -104,7 +104,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'is_proband',
title: 'Proband',
title: intl.get('entities.participant.proband'),
dataIndex: 'is_proband',
sorter: {
multiple: 1,
Expand All @@ -114,7 +114,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'sex',
title: 'Sex',
title: intl.get('entities.participant.sex'),
dataIndex: 'sex',
sorter: {
multiple: 1,
Expand All @@ -128,7 +128,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'diagnosis.mondo_id_diagnosis',
title: 'Diagnosis (MONDO)',
title: intl.get('entities.participant.mondo_diagnosis'),
dataIndex: 'diagnosis',
className: styles.diagnosisCell,
render: (diagnosis: IArrangerResultsTree<IParticipantDiagnosis>) => {
Expand Down Expand Up @@ -162,7 +162,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'phenotype.hpo_phenotype_observed',
title: 'Observed Phenotype (HPO)',
title: intl.get('entities.participant.hpo_phenotype_observed'),
dataIndex: 'phenotype',
className: styles.phenotypeCell,
render: (phenotype: IArrangerResultsTree<IParticipantPhenotype>) => {
Expand Down Expand Up @@ -196,7 +196,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'families_id',
title: 'Family ID',
title: intl.get('entities.participant.family_id'),
dataIndex: 'families_id',
sorter: {
multiple: 1,
Expand All @@ -205,7 +205,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'family_type',
title: 'Family Composition',
title: intl.get('entities.participant.family_unit'),
dataIndex: 'family_type',
sorter: {
multiple: 1,
Expand All @@ -215,7 +215,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'pedcbioportal',
title: 'PedcBioPortal',
title: intl.get('entities.participant.pedcBioPortal'),
sorter: {
multiple: 1,
},
Expand All @@ -237,7 +237,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'nb_biospecimens',
title: 'Biospecimens',
title: intl.get('entities.participant.nb_biospecimens'),
sorter: {
multiple: 1,
},
Expand Down Expand Up @@ -272,7 +272,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'nb_files',
title: 'Files',
title: intl.get('entities.participant.nb_files'),
sorter: {
multiple: 1,
},
Expand Down Expand Up @@ -304,7 +304,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'race',
title: 'Race',
title: intl.get('entities.participant.race'),
dataIndex: 'race',
defaultHidden: true,
sorter: {
Expand All @@ -314,7 +314,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'ethnicity',
title: 'Ethnicity',
title: intl.get('entities.participant.ethnicity'),
dataIndex: 'ethnicity',
defaultHidden: true,
sorter: {
Expand All @@ -324,7 +324,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'external_id',
title: 'Participant External ID',
title: intl.get('entities.participant.external_id_tooltip'),
dataIndex: 'external_id',
defaultHidden: true,
sorter: {
Expand All @@ -334,7 +334,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'diagnosis.ncit_id_diagnosis',
title: 'Diagnosis (NCIT)',
title: intl.get('entities.participant.diagnosis_NCIT'),
dataIndex: 'diagnosis',
defaultHidden: true,
sorter: {
Expand Down Expand Up @@ -363,7 +363,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'diagnosis.source_text',
title: 'Diagnosis (Source Text)',
title: intl.get('entities.participant.diagnosis_source_text'),
dataIndex: 'diagnosis',
defaultHidden: true,
render: (mondo: IArrangerResultsTree<IParticipantDiagnosis>) => {
Expand All @@ -383,7 +383,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'outcomes.vital_status',
title: 'Vital Status',
title: intl.get('entities.participant.vital_status'),
dataIndex: 'outcomes',
defaultHidden: true,
sorter: {
Expand All @@ -397,7 +397,7 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'phenotypes_hpo_not_observed',
title: 'Not Observed Phenotype (HPO)',
title: intl.get('entities.participant.phenotypes_hpo_not_observed'),
dataIndex: 'phenotype',
defaultHidden: true,
sorter: {
Expand All @@ -407,26 +407,14 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'source_text_phenotype',
title: 'Observed Phenotype (Source Text)',
title: intl.get('entities.participant.source_text_phenotype'),
dataIndex: 'phenotype',
defaultHidden: true,
sorter: {
multiple: 1,
},
render: () => TABLE_EMPTY_PLACE_HOLDER,
},
{
key: 'outcomes.age_at_event_days.value',
title: 'Age at Outcome',
dataIndex: 'outcomes',
defaultHidden: true,
sorter: {
multiple: 1,
},
render: (outcomes: IArrangerResultsTree<IParticipantOutcomes>) => (
<OutcomesAgeCells outcomes={outcomes} />
),
},
];

const ParticipantsTab = ({ sqon }: OwnProps) => {
Expand Down Expand Up @@ -530,7 +518,7 @@ const ParticipantsTab = ({ sqon }: OwnProps) => {
return (
<ProTable<ITableParticipantEntity>
tableId="participants_table"
columns={defaultColumns}
columns={getDefaultColumns()}
wrapperClassName={styles.participantTabWrapper}
loading={results.loading}
initialColumnState={userInfo?.config.data_exploration?.tables?.participants?.columns}
Expand Down Expand Up @@ -569,7 +557,7 @@ const ParticipantsTab = ({ sqon }: OwnProps) => {
dispatch(
fetchTsvReport({
columnStates: userInfo?.config.data_exploration?.tables?.participants?.columns,
columns: defaultColumns,
columns: getDefaultColumns(),
index: INDEXES.PARTICIPANT,
sqon: getCurrentSqon(),
}),
Expand Down

0 comments on commit 4f6c5f9

Please sign in to comment.