Skip to content

Commit

Permalink
Change name of config flag, Apply flag to study view also
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisWakefield committed Dec 13, 2019
1 parent f79e7ae commit 0051dd6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/config/IAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface IServerConfig {
skin_title: string;
skin_authorization_message: string | null;
skin_patientview_filter_genes_profiled_all_samples: boolean;
show_mdacc_heatmap: boolean;
quick_search_enabled: boolean;
default_cross_cancer_study_list: string; // this has a default
default_cross_cancer_study_list_name: string; // this has a default
Expand All @@ -103,7 +104,6 @@ export interface IServerConfig {
studiesWithGermlineConsentedSamples: string[] | undefined;
mdacc_heatmap_study_meta_url: string | null;
mdacc_heatmap_study_url: string | null;
enable_mdacc_ngchm_button: boolean;
oncoprint_custom_driver_annotation_tiers_menu_label: string | null;
enable_darwin: boolean;
query_sets_of_genes: string | null;
Expand Down
2 changes: 1 addition & 1 deletion src/config/serverConfigDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ServerConfigDefaults: Partial<IServerConfig> = {
'https://bioinformatics.mdanderson.org/study2url?studyid=',
mdacc_heatmap_study_url:
'https:// bioinformatics.mdanderson.org/TCGA/NGCHMPortal/?',
enable_mdacc_ngchm_button: false,
show_mdacc_heatmap: false,

mygene_info_url:
'https://mygene.info/v3/gene/<%= entrezGeneId %>?fields=uniprot',
Expand Down
10 changes: 6 additions & 4 deletions src/pages/studyView/StudyViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2256,11 +2256,13 @@ export class StudyViewPageStore {
await: () => [this.queriedPhysicalStudyIds],
onError: (error => {}),
invoke: async () => {
let isSinglePhysicalStudy = this.queriedPhysicalStudyIds.result.length === 1;
if (isSinglePhysicalStudy) {
return await getHeatmapMeta(getMDAndersonHeatmapStudyMetaUrl(this.queriedPhysicalStudyIds.result[0]));
if (AppConfig.serverConfig.show_mdacc_heatmap) {
let isSinglePhysicalStudy = this.queriedPhysicalStudyIds.result.length === 1;
if (isSinglePhysicalStudy) {
return await getHeatmapMeta(getMDAndersonHeatmapStudyMetaUrl(this.queriedPhysicalStudyIds.result[0]));
}
}
return [];
return []; // if not enabled or conditions not met, just return default answer
}
}, []);

Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/oncoprint/ResultsViewOncoprint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export default class ResultsViewOncoprint extends React.Component<IResultsViewOn
return self.heatmapIsDynamicallyQueried;
},
get ngchmButtonActive() {
return (AppConfig.serverConfig.enable_mdacc_ngchm_button &&
return (AppConfig.serverConfig.show_mdacc_heatmap &&
(self.props.store.remoteNgchmUrl.result &&
self.props.store.remoteNgchmUrl.result != '') ? true : false);
},
Expand Down

0 comments on commit 0051dd6

Please sign in to comment.