diff --git a/src/main/webapp/app/pages/actionableGenesPage/ActionableGenesPage.tsx b/src/main/webapp/app/pages/actionableGenesPage/ActionableGenesPage.tsx index d5178f66f..655e1a551 100644 --- a/src/main/webapp/app/pages/actionableGenesPage/ActionableGenesPage.tsx +++ b/src/main/webapp/app/pages/actionableGenesPage/ActionableGenesPage.tsx @@ -91,7 +91,7 @@ export default class ActionableGenesPage extends React.Component< ActionableGenesPageProps, any > { - @observable relevantTumorTypeSearchKeyword = ''; + @observable relevantCancerTypeSearchKeyword = ''; @observable drugSearchKeyword = ''; @observable geneSearchKeyword = ''; @observable refGenome = DEFAULT_REFERENCE_GENOME; @@ -120,28 +120,6 @@ export default class ActionableGenesPage extends React.Component< default: [], }); - readonly allTumorTypes = remoteData({ - await: () => [this.allMainTypes, this.evidencesByLevel], - invoke: async () => { - let allTumorTypes: string[] = _.uniq( - this.allMainTypes.result - .filter(mainType => !mainType.endsWith('NOS')) - .map(mainType => mainType) - ); - - this.allTreatments.forEach(treatment => { - allTumorTypes = allTumorTypes.concat( - treatment.cancerTypes.map(cancerType => - getCancerTypeNameFromOncoTreeType(cancerType) - ) - ); - }); - - return Promise.resolve(_.uniq(allTumorTypes)); - }, - default: [], - }); - readonly evidencesByLevel = remoteData({ await: () => [], async invoke() { @@ -183,7 +161,10 @@ export default class ActionableGenesPage extends React.Component< this.geneSearchKeyword = queryStrings.hugoSymbol; } if (queryStrings.tumorType) { - this.relevantTumorTypeSearchKeyword = queryStrings.tumorType; + this.relevantCancerTypeSearchKeyword = queryStrings.tumorType; + } + if (queryStrings.cancerType) { + this.relevantCancerTypeSearchKeyword = queryStrings.cancerType; } if (queryStrings.drug) { this.drugSearchKeyword = queryStrings.drug; @@ -325,8 +306,8 @@ export default class ActionableGenesPage extends React.Component< if (this.geneSearchKeyword) { queryString.hugoSymbol = this.geneSearchKeyword; } - if (this.relevantTumorTypeSearchKeyword) { - queryString.tumorType = this.relevantTumorTypeSearchKeyword; + if (this.relevantCancerTypeSearchKeyword) { + queryString.cancerType = this.relevantCancerTypeSearchKeyword; } if (this.drugSearchKeyword) { queryString.drug = this.drugSearchKeyword; @@ -390,15 +371,15 @@ export default class ActionableGenesPage extends React.Component< match = false; } if ( - this.relevantTumorTypeSearchKeyword && + this.relevantCancerTypeSearchKeyword && treatment.relevantCancerTypes.filter(rct => { if (rct.code) { return ( - rct.code === this.relevantTumorTypeSearchKeyword || - rct.subtype === this.relevantTumorTypeSearchKeyword + rct.code === this.relevantCancerTypeSearchKeyword || + rct.subtype === this.relevantCancerTypeSearchKeyword ); } else { - return rct.mainType === this.relevantTumorTypeSearchKeyword; + return rct.mainType === this.relevantCancerTypeSearchKeyword; } }).length === 0 ) { @@ -429,7 +410,7 @@ export default class ActionableGenesPage extends React.Component< get secondLayerFilterEnabled() { return ( !!this.geneSearchKeyword || - !!this.relevantTumorTypeSearchKeyword || + !!this.relevantCancerTypeSearchKeyword || !!this.drugSearchKeyword ); } @@ -530,10 +511,10 @@ export default class ActionableGenesPage extends React.Component< @computed get tumorTypeSelectValue() { - return this.relevantTumorTypeSearchKeyword + return this.relevantCancerTypeSearchKeyword ? { - label: this.relevantTumorTypeSearchKeyword, - value: this.relevantTumorTypeSearchKeyword, + label: this.relevantCancerTypeSearchKeyword, + value: this.relevantCancerTypeSearchKeyword, } : null; } @@ -574,7 +555,7 @@ export default class ActionableGenesPage extends React.Component< @action clearFilters() { this.levelSelected = this.initLevelSelected(); - this.relevantTumorTypeSearchKeyword = ''; + this.relevantCancerTypeSearchKeyword = ''; this.drugSearchKeyword = ''; this.geneSearchKeyword = ''; } @@ -938,9 +919,9 @@ export default class ActionableGenesPage extends React.Component< xs={12} > - (this.relevantTumorTypeSearchKeyword = selectedOption + (this.relevantCancerTypeSearchKeyword = selectedOption ? selectedOption.value : '') } diff --git a/src/main/webapp/app/pages/annotationPage/AlterationView.tsx b/src/main/webapp/app/pages/annotationPage/AlterationView.tsx index 2eea557eb..f2a551259 100644 --- a/src/main/webapp/app/pages/annotationPage/AlterationView.tsx +++ b/src/main/webapp/app/pages/annotationPage/AlterationView.tsx @@ -140,7 +140,7 @@ export default class AlterationView extends React.Component< }), menu: base => ({ ...base, zIndex: 10 }), }} - tumorType={this.props.tumorType} + cancerType={this.props.tumorType} onChange={(selectedOption: any) => this.updateTumorTypeQuery(selectedOption) } diff --git a/src/main/webapp/app/shared/dropdown/CancerTypeSelect.tsx b/src/main/webapp/app/shared/dropdown/CancerTypeSelect.tsx index b0d5b7aa1..d13eebc10 100644 --- a/src/main/webapp/app/shared/dropdown/CancerTypeSelect.tsx +++ b/src/main/webapp/app/shared/dropdown/CancerTypeSelect.tsx @@ -8,7 +8,7 @@ import privateClient from 'app/shared/api/oncokbPrivateClientInstance'; import { remoteData } from 'cbioportal-frontend-commons'; interface ICancerTypeSelect extends SelectProps { - tumorType?: string; + cancerType?: string; } @observer @@ -26,10 +26,10 @@ export default class CancerTypeSelect extends React.Component< @computed get tumorTypeSelectValue() { - if (this.props.tumorType) { + if (this.props.cancerType) { const matchedSubtype = _.find( this.allSubtypes, - tumorType => tumorType.code === this.props.tumorType + cancerType => cancerType.code === this.props.cancerType ); if (matchedSubtype) { return { @@ -38,8 +38,8 @@ export default class CancerTypeSelect extends React.Component< }; } else { return { - label: this.props.tumorType, - value: this.props.tumorType, + label: this.props.cancerType, + value: this.props.cancerType, }; } } else { @@ -78,19 +78,19 @@ export default class CancerTypeSelect extends React.Component< label: 'Cancer Type', options: _.uniq(cancerTypesGroup) .sort() - .map(tumorType => { + .map(cancerType => { return { - value: tumorType, - label: tumorType, + value: cancerType, + label: cancerType, }; }), }, { label: 'Cancer Type Detailed', - options: _.sortBy(_.uniq(this.allSubtypes), 'name').map(tumorType => { + options: _.sortBy(_.uniq(this.allSubtypes), 'name').map(cancerType => { return { - value: tumorType.code, - label: `${tumorType.subtype} (${tumorType.code})`, + value: cancerType.code, + label: `${cancerType.subtype} (${cancerType.code})`, }; }), }, diff --git a/src/main/webapp/app/shared/route/types.tsx b/src/main/webapp/app/shared/route/types.tsx index 6af75a4da..e58cd4317 100644 --- a/src/main/webapp/app/shared/route/types.tsx +++ b/src/main/webapp/app/shared/route/types.tsx @@ -23,6 +23,7 @@ export type ActionableGenesPageHashQueries = { levels?: string[]; hugoSymbol?: string; tumorType?: string; + cancerType?: string; drug?: string; refGenome?: REFERENCE_GENOME; };