Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connects to #1906: Disabled UI for criteria #1939

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
Open
7 changes: 5 additions & 2 deletions src/clincoded/static/components/variant_central/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var VariantCurationHub = createReactClass({
},

getInitialState: function() {
const unusedCriteria = ['BP6', 'PP5'];
return {
variantUuid: queryKeyValue('variant', this.props.href),
interpretationUuid: queryKeyValue('interpretation', this.props.href),
Expand Down Expand Up @@ -75,7 +76,8 @@ var VariantCurationHub = createReactClass({
classificationStatus: 'In progress',
classificationSnapshots: [],
publishProvisionalReady: false,
publishSnapshotListReady: false
publishSnapshotListReady: false,
unusedCriteria: unusedCriteria
};
},

Expand Down Expand Up @@ -582,14 +584,15 @@ var VariantCurationHub = createReactClass({
{!this.state.summaryVisible ?
<div>
<CurationInterpretationCriteria interpretation={interpretation} selectedTab={selectedTab}
updateSelectedCriteria={this.updateSelectedCriteria} />
updateSelectedCriteria={this.updateSelectedCriteria} unusedCriteria={this.state.unusedCriteria} />
<VariantCurationActions variantData={variantData} interpretation={interpretation} editKey={editKey} session={session}
href_url={this.props.href} updateInterpretationObj={this.updateInterpretationObj}
calculatedAssertion={calculated_pathogenicity} provisionalPathogenicity={this.state.provisionalPathogenicity}
affiliation={affiliation} />
<VariantCurationInterpretation variantData={variantData} interpretation={interpretation} editKey={editKey} session={session}
href_url={this.props.href_url} updateInterpretationObj={this.updateInterpretationObj} getSelectedTab={this.getSelectedTab}
getSelectedSubTab={this.getSelectedSubTab}
unusedCriteria={this.state.unusedCriteria}
ext_myGeneInfo={my_gene_info}
ext_pageData={this.state.ext_pageData}
ext_myVariantInfo={this.state.ext_myVariantInfo}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ var VariantCurationInterpretation = module.exports.VariantCurationInterpretation
selectedTab: PropTypes.string,
selectedSubtab: PropTypes.string,
selectedCriteria: PropTypes.string,
affiliation: PropTypes.object
affiliation: PropTypes.object,
unusedCriteria: PropTypes.array
},

getInitialState: function() {
Expand Down Expand Up @@ -221,7 +222,7 @@ var VariantCurationInterpretation = module.exports.VariantCurationInterpretation
loading_myVariantInfo={this.state.loading_myVariantInfo}
loading_ensemblVariation={this.state.loading_ensemblVariation}
affiliation={this.props.affiliation}
selectedCriteria={this.state.selectedCriteria} />
selectedCriteria={this.state.selectedCriteria} unusedCriteria={this.props.unusedCriteria} />
</div>
: null}
{this.state.selectedTab == 'variant-type' ?
Expand All @@ -237,21 +238,22 @@ var VariantCurationInterpretation = module.exports.VariantCurationInterpretation
affiliation={this.props.affiliation}
selectedSubtab={this.state.selectedSubtab}
selectedCriteria={this.state.selectedCriteria}
unusedCriteria={this.props.unusedCriteria}
getSelectedSubTab={this.props.getSelectedSubTab} />
</div>
: null}
{this.state.selectedTab == 'experimental' ?
<div role="tabpanel" className="tab-panel">
<CurationInterpretationFunctional data={variant} data={variant} href_url={this.props.href_url} session={this.props.session}
interpretation={interpretation} updateInterpretationObj={this.props.updateInterpretationObj} affiliation={this.props.affiliation}
selectedCriteria={this.state.selectedCriteria} />
selectedCriteria={this.state.selectedCriteria} unusedCriteria={this.props.unusedCriteria} />
</div>
: null}
{this.state.selectedTab == 'segregation-case' ?
<div role="tabpanel" className="tab-panel">
<CurationInterpretationSegregation data={variant} data={variant} href_url={this.props.href_url} session={this.props.session}
interpretation={interpretation} updateInterpretationObj={this.props.updateInterpretationObj} affiliation={this.props.affiliation}
selectedCriteria={this.state.selectedCriteria} />
selectedCriteria={this.state.selectedCriteria} unusedCriteria={this.props.unusedCriteria} />
</div>
: null}
{this.state.selectedTab == 'gene-centric' ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ var CurationInterpretationComputational = module.exports.CurationInterpretationC
affiliation: PropTypes.object,
selectedSubtab: PropTypes.string,
selectedCriteria: PropTypes.string,
getSelectedSubTab: PropTypes.func
getSelectedSubTab: PropTypes.func,
unusedCriteria: PropTypes.array
},

getInitialState: function() {
Expand Down Expand Up @@ -567,7 +568,8 @@ var CurationInterpretationComputational = module.exports.CurationInterpretationC
formDataUpdater={criteriaMissense1Update} variantUuid={variant['@id']}
criteria={['BP1', 'PP2', 'PP3', 'BP4']} criteriaCrossCheck={[['BP1', 'PP2'], ['PP3', 'BP4']]}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} criteriaEvalNote={this.renderCriteriaEvalNote} />
affiliation={affiliation} session={session} criteriaEvalNote={this.renderCriteriaEvalNote}
unusedCriteria={this.props.unusedCriteria} />
</div>
</div>
: null}
Expand Down Expand Up @@ -823,7 +825,7 @@ var CurationInterpretationComputational = module.exports.CurationInterpretationC
evidenceData={null} evidenceDataUpdated={true}
formDataUpdater={criteriaMissense2Update} variantUuid={variant['@id']}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} />
unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} />
</div>
</div>
: null}
Expand Down Expand Up @@ -854,7 +856,7 @@ var CurationInterpretationComputational = module.exports.CurationInterpretationC
evidenceData={null} evidenceDataUpdated={true}
formDataUpdater={criteriaLof1Update} variantUuid={this.state.data['@id']}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} criteriaEvalNote={this.renderCriteriaEvalLink} />
unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} criteriaEvalNote={this.renderCriteriaEvalLink} />
</div>
</div>
: null}
Expand Down Expand Up @@ -894,7 +896,7 @@ var CurationInterpretationComputational = module.exports.CurationInterpretationC
evidenceData={null} evidenceDataUpdated={true}
formDataUpdater={criteriaSilentIntron1Update} variantUuid={this.state.data['@id']}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} />
unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} />
</div>
</div>
: null}
Expand Down Expand Up @@ -924,7 +926,7 @@ var CurationInterpretationComputational = module.exports.CurationInterpretationC
evidenceData={null} evidenceDataUpdated={true} criteriaCrossCheck={[['BP3', 'PM4']]}
formDataUpdater={criteriaIndel1Update} variantUuid={this.state.data['@id']}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} />
unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} />
</div>
</div>
: null}
Expand Down Expand Up @@ -987,14 +989,14 @@ var CurationInterpretationComputational = module.exports.CurationInterpretationC
/**
* Code for rendering of this group of interpretation forms
*/
function criteriaMissense1() {
function criteriaMissense1(unusedCriteria) {
let criteriaList1 = ['BP1', 'PP2'], // array of criteria code handled subgroup of this section
criteriaList2 = ['PP3', 'BP4']; // array of criteria code handled subgroup of this section
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
<div className="clear criteria-evaluation-divider"></div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList2, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList2, unusedCriteria)}
</div>
);
}
Expand All @@ -1011,14 +1013,14 @@ function criteriaMissense1Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
function criteriaMissense2() {
function criteriaMissense2(unusedCriteria) {
let criteriaList1 = ['PM5'], // array of criteria code handled subgroup of this section
criteriaList2 = ['PS1']; // array of criteria code handled subgroup of this section
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
<div className="clear criteria-evaluation-divider"></div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList2, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList2, unusedCriteria)}
</div>
);
}
Expand All @@ -1035,11 +1037,11 @@ function criteriaMissense2Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
function criteriaLof1() {
function criteriaLof1(unusedCriteria) {
let criteriaList1 = ['PVS1']; // array of criteria code handled subgroup of this section
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
</div>
);
}
Expand All @@ -1056,11 +1058,11 @@ function criteriaLof1Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
function criteriaSilentIntron1() {
function criteriaSilentIntron1(unusedCriteria) {
let criteriaList1 = ['BP7']; // array of criteria code handled subgroup of this section
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
</div>
);
}
Expand All @@ -1077,11 +1079,11 @@ function criteriaSilentIntron1Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
function criteriaIndel1() {
function criteriaIndel1(unusedCriteria) {
let criteriaList1 = ['BP3', 'PM4']; // array of criteria code handled subgroup of this section
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ var CurationInterpretationCriteria = module.exports.CurationInterpretationCriter
propTypes: {
interpretation: PropTypes.object,
selectedTab: PropTypes.string,
updateSelectedCriteria: PropTypes.func
updateSelectedCriteria: PropTypes.func,
unusedCriteria: PropTypes.array
},

getInitialState() {
Expand Down Expand Up @@ -101,13 +102,20 @@ var CurationInterpretationCriteria = module.exports.CurationInterpretationCriter
});
}
}
const unused = Array.isArray(this.props.unusedCriteria) && (this.props.unusedCriteria.indexOf(key) > -1);
return (
<button className={'btn btn-default ' + evidence[key].class + ' ' + evidence[key].category + this.getCurrentTab(evidence[key].category)}
type="button" key={key} data-status={status}
data-toggle="tooltip" data-placement="top"
data-tooltip={evidence[key].definition}
onClick={this.handleClick.bind(this, key, evidence[key].category)}>
<span>{key}</span>
{unused &&
<div className="criteria-cross">
<div className="criteria-neg-slope-line" />
<div className="criteria-pos-slope-line" />
</div>
}
<span className="criteria-key">{key}</span>
</button>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ var CurationInterpretationFunctional = module.exports.CurationInterpretationFunc
href_url: PropTypes.object,
affiliation: PropTypes.object,
session: PropTypes.object,
selectedCriteria: PropTypes.string
selectedCriteria: PropTypes.string,
unusedCriteria: PropTypes.array
},

getInitialState() {
Expand Down Expand Up @@ -69,7 +70,7 @@ var CurationInterpretationFunctional = module.exports.CurationInterpretationFunc
evidenceData={null} evidenceDataUpdated={true}
formDataUpdater={criteriaGroup1Update} variantUuid={this.state.data['@id']}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} />
unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} />
</div>
</div>
: null}
Expand All @@ -87,7 +88,7 @@ var CurationInterpretationFunctional = module.exports.CurationInterpretationFunc
evidenceData={null} evidenceDataUpdated={true} criteriaCrossCheck={[['BS3', 'PS3']]}
formDataUpdater={criteriaGroup2Update} variantUuid={this.state.data['@id']}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} />
unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} />
</div>
</div>
: null}
Expand All @@ -107,11 +108,11 @@ var CurationInterpretationFunctional = module.exports.CurationInterpretationFunc


// code for rendering of this group of interpretation forms
var criteriaGroup1 = function() {
var criteriaGroup1 = function(unusedCriteria) {
let criteriaList1 = ['PM1']; // array of criteria code handled subgroup of this section
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
</div>
);
};
Expand All @@ -123,11 +124,11 @@ var criteriaGroup1Update = function(nextProps) {


// code for rendering of this group of interpretation forms
var criteriaGroup2 = function() {
var criteriaGroup2 = function(unusedCriteria) {
let criteriaList1 = ['BS3', 'PS3']; // array of criteria code handled subgroup of this section
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ var CurationInterpretationPopulation = module.exports.CurationInterpretationPopu
href_url: PropTypes.object,
affiliation: PropTypes.object,
session: PropTypes.object,
selectedCriteria: PropTypes.string

selectedCriteria: PropTypes.string,
unusedCriteria: PropTypes.array
},

getInitialState: function() {
Expand Down Expand Up @@ -1158,7 +1158,7 @@ var CurationInterpretationPopulation = module.exports.CurationInterpretationPopu
formDataUpdater={criteriaGroup1Update} variantUuid={this.state.data['@id']}
criteria={['BA1', 'PM2', 'BS1']} criteriaCrossCheck={[['BA1', 'PM2', 'BS1']]}
interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj}
affiliation={affiliation} session={session} />
unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} />
</div>
</div>
: null}
Expand Down Expand Up @@ -1437,7 +1437,7 @@ var CurationInterpretationPopulation = module.exports.CurationInterpretationPopu


// code for rendering of this group of interpretation forms
var criteriaGroup1 = function() {
var criteriaGroup1 = function(unusedCriteria) {
let criteriaList1 = ['BA1', 'BS1', 'PM2']; // array of criteria code handled subgroup of this section
let mafCutoffInput = (
<span>
Expand All @@ -1451,7 +1451,7 @@ var criteriaGroup1 = function() {
);
return (
<div>
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)}
{vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
{mafCutoffInput}
</div>
);
Expand Down
Loading