Skip to content

Commit

Permalink
Fix the option to configure default view oncoprint (#5117)
Browse files Browse the repository at this point in the history
  • Loading branch information
TJMKuijpers authored Mar 4, 2025
1 parent b0e0b32 commit 2c0bf4c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/config/IAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export interface IServerConfig {
oncoprint_clinical_tracks_config_json: string;
oncoprint_clustered_default: boolean; // this has a default
enable_cross_study_expression: string;
oncoprint_defaultview: string; // this has a default
studyview_max_samples_selected: number;
study_download_url: string;
studyview_clinical_attribute_chart_count: number;
Expand Down
2 changes: 1 addition & 1 deletion src/config/serverConfigDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ServerConfigDefaults: Partial<IServerConfig> = {
oncoprint_hide_vus_default: false,
oncokb_public_api_url: 'oncokb.org/api/v1',
oncokb_merge_icons_by_default: true,

oncoprint_defaultview: 'patient',
pubmed_url: 'https://www.ncbi.nlm.nih.gov/pubmed/<%=pmid%>',

show_hotspot: true,
Expand Down
13 changes: 9 additions & 4 deletions src/shared/components/oncoprint/ResultsViewOncoprint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ export default class ResultsViewOncoprint extends React.Component<
(window as any).resultsViewOncoprint = this;

const self = this;

this.setSessionClinicalTracks = this.setSessionClinicalTracks.bind(
this
);
Expand Down Expand Up @@ -1711,9 +1710,15 @@ export default class ResultsViewOncoprint extends React.Component<

// @computed
public get oncoprintAnalysisCaseType() {
return this.urlWrapper.query.show_samples === 'true'
? OncoprintAnalysisCaseType.SAMPLE
: OncoprintAnalysisCaseType.PATIENT;
if (this.urlWrapper.query.show_samples == undefined) {
return getServerConfig().oncoprint_defaultview === 'patient'
? OncoprintAnalysisCaseType.PATIENT
: OncoprintAnalysisCaseType.SAMPLE;
} else {
return this.urlWrapper.query.show_samples === 'true'
? OncoprintAnalysisCaseType.SAMPLE
: OncoprintAnalysisCaseType.PATIENT;
}
}

@computed get sortOrder() {
Expand Down

0 comments on commit 2c0bf4c

Please sign in to comment.