Skip to content

Commit

Permalink
Merge pull request #3588 from kalletlak/fix-7814
Browse files Browse the repository at this point in the history
Support study view without any molecuar profiles
  • Loading branch information
kalletlak authored Jan 20, 2021
2 parents bb51a33 + 1b9c380 commit 3734d4a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/pages/studyView/StudyViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4135,6 +4135,9 @@ export class StudyViewPageStore {
readonly filteredGenePanelData = remoteData({
await: () => [this.molecularProfiles, this.samples],
invoke: async () => {
if (_.isEmpty(this.molecularProfiles.result)) {
return [];
}
const studyMolecularProfilesSet = _.groupBy(
this.molecularProfiles.result,
molecularProfile => molecularProfile.studyId
Expand Down Expand Up @@ -4686,6 +4689,11 @@ export class StudyViewPageStore {
@computed
get chartMetaSet(): { [id: string]: ChartMeta } {
let _chartMetaSet = _.fromPairs(this._customCharts.toJSON());
if (_.isEmpty(this.molecularProfiles.result)) {
delete _chartMetaSet[
SpecialChartsUniqueKeyEnum.GENOMIC_PROFILES_SAMPLE_COUNT
];
}
_chartMetaSet = _.merge(
_chartMetaSet,
_.fromPairs(this._geneSpecificCharts.toJSON()),
Expand Down
5 changes: 4 additions & 1 deletion src/pages/studyView/addChartButton/AddChartButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,10 @@ class AddChartTabs extends React.Component<IAddChartTabsProps, {}> {
key={1}
id={ChartMetaDataTypeEnum.GENOMIC}
linkText={TabNamesEnum.GENOMIC}
hide={this.props.disableGenomicTab}
hide={
this.props.disableGenomicTab ||
this.genomicChartOptions.length === 0
}
className="addGenomicChartTab"
>
<AddChartByType
Expand Down

0 comments on commit 3734d4a

Please sign in to comment.