Skip to content

Commit

Permalink
Merge pull request #2325 from zhx828/i-6098
Browse files Browse the repository at this point in the history
Only show cancer study column in clinical data tab if the chart/column is visible

Former-commit-id: 6238a6dc32697a8fac797d9e7dee9421d84c6751
  • Loading branch information
zhx828 authored May 17, 2019
2 parents 388025a + 5668e49 commit 2aebc8d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/pages/studyView/tabs/ClinicalDataTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import {Column, default as LazyMobXTable} from "shared/components/lazyMobXTable/
import {observer} from "mobx-react";
import * as _ from 'lodash';
import {getPatientViewUrl, getSampleViewUrl} from "shared/api/urls";
import {getClinicalAttributeOverlay, getClinicalAttributeUniqueKey, chartMetaComparator} from "../StudyViewUtils";
import {chartMetaComparator, getClinicalAttributeOverlay, getClinicalAttributeUniqueKey} from "../StudyViewUtils";
import LoadingIndicator from "shared/components/loadingIndicator/LoadingIndicator";
import {ChartMeta, StudyViewPageStore} from "pages/studyView/StudyViewPageStore";
import {ChartMeta, StudyViewPageStore, UniqueKey} from "pages/studyView/StudyViewPageStore";
import {remoteData} from "shared/api/remoteData";
import {Else, If, Then} from 'react-if';
import ProgressIndicator, {IProgressIndicatorItem} from "../../../shared/components/progressIndicator/ProgressIndicator";
import autobind from 'autobind-decorator';
import windowStore from "../../../shared/components/window/WindowStore";
import {WindowWidthBox} from "../../../shared/components/WindowWidthBox/WindowWidthBox";

export interface IClinicalDataTabTable {
Expand Down Expand Up @@ -57,9 +56,13 @@ export class ClinicalDataTab extends React.Component<IClinicalDataTabTable, {}>
render: (data: { [id: string]: string }) => {
return <a href={getSampleViewUrl(data.studyId, data.sampleId)} target='_blank'>{data.sampleId}</a>
}
}, {
...this.getDefaultColumnConfig('studyId', 'Cancer Study')
}];

if (_.find(this.props.store.visibleAttributes, chartMeta => chartMeta.uniqueKey === UniqueKey.CANCER_STUDIES) !== undefined) {
defaultColumns.push({
...this.getDefaultColumnConfig('studyId', 'Cancer Study')
});
}
return _.reduce(this.props.store.visibleAttributes.sort(chartMetaComparator),
(acc: Column<{ [id: string]: string }>[], chartMeta: ChartMeta, index: number) => {
if (chartMeta.clinicalAttribute !== undefined) {
Expand Down

0 comments on commit 2aebc8d

Please sign in to comment.