From 8bcddfb573c99595b250090aa36a39b02139bfb8 Mon Sep 17 00:00:00 2001 From: Howard Tong Date: Mon, 3 Jun 2019 14:45:39 -0700 Subject: [PATCH 1/4] #1906: Adds disabled UI for criteria --- .../components/variant_central/index.js | 4 +- .../variant_central/interpretation.js | 10 ++-- .../interpretation/computational.js | 38 +++++++------ .../interpretation/criteria.js | 12 +++- .../interpretation/functional.js | 15 ++--- .../interpretation/population.js | 10 ++-- .../interpretation/segregation.js | 57 ++++++++++--------- .../interpretation/shared/form.js | 22 ++++--- .../scss/clincoded/modules/_curator.scss | 29 ++++++++++ 9 files changed, 125 insertions(+), 72 deletions(-) diff --git a/src/clincoded/static/components/variant_central/index.js b/src/clincoded/static/components/variant_central/index.js index b0d2fe473..c1ae584fb 100644 --- a/src/clincoded/static/components/variant_central/index.js +++ b/src/clincoded/static/components/variant_central/index.js @@ -557,6 +557,7 @@ var VariantCurationHub = createReactClass({ }, render() { + const unusedCriteria = ['BP6', 'PP5']; const variantData = this.state.variantObj; const editKey = this.state.editKey; const selectedTab = this.state.selectedTab; @@ -582,7 +583,7 @@ var VariantCurationHub = createReactClass({ {!this.state.summaryVisible ?
+ updateSelectedCriteria={this.updateSelectedCriteria} unusedCriteria={unusedCriteria} /> + selectedCriteria={this.state.selectedCriteria} unusedCriteria={this.props.unusedCriteria} />
: null} {this.state.selectedTab == 'variant-type' ? @@ -237,6 +238,7 @@ 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} /> : null} @@ -244,14 +246,14 @@ var VariantCurationInterpretation = module.exports.VariantCurationInterpretation
+ selectedCriteria={this.state.selectedCriteria} unusedCriteria={this.props.unusedCriteria} />
: null} {this.state.selectedTab == 'segregation-case' ?
+ selectedCriteria={this.state.selectedCriteria} unusedCriteria={this.props.unusedCriteria} />
: null} {this.state.selectedTab == 'gene-centric' ? diff --git a/src/clincoded/static/components/variant_central/interpretation/computational.js b/src/clincoded/static/components/variant_central/interpretation/computational.js index f7c069641..78c5edde1 100644 --- a/src/clincoded/static/components/variant_central/interpretation/computational.js +++ b/src/clincoded/static/components/variant_central/interpretation/computational.js @@ -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() { @@ -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} /> : null} @@ -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} /> : null} @@ -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} /> : null} @@ -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} /> : null} @@ -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} /> : null} @@ -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 (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, unusedCriteria)}
); } @@ -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 (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, unusedCriteria)}
); } @@ -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 (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); } @@ -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 (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); } @@ -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 (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); } diff --git a/src/clincoded/static/components/variant_central/interpretation/criteria.js b/src/clincoded/static/components/variant_central/interpretation/criteria.js index dd97ec59c..188afebc6 100644 --- a/src/clincoded/static/components/variant_central/interpretation/criteria.js +++ b/src/clincoded/static/components/variant_central/interpretation/criteria.js @@ -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() { @@ -101,13 +102,20 @@ var CurationInterpretationCriteria = module.exports.CurationInterpretationCriter }); } } + const unused = (this.props.unusedCriteria.indexOf(key) > -1) return ( ); }, diff --git a/src/clincoded/static/components/variant_central/interpretation/functional.js b/src/clincoded/static/components/variant_central/interpretation/functional.js index 726a226ba..8f05fdffc 100644 --- a/src/clincoded/static/components/variant_central/interpretation/functional.js +++ b/src/clincoded/static/components/variant_central/interpretation/functional.js @@ -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() { @@ -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} /> : null} @@ -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} /> : null} @@ -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 (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); }; @@ -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 (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); }; diff --git a/src/clincoded/static/components/variant_central/interpretation/population.js b/src/clincoded/static/components/variant_central/interpretation/population.js index ed0e54f8a..62f6567de 100644 --- a/src/clincoded/static/components/variant_central/interpretation/population.js +++ b/src/clincoded/static/components/variant_central/interpretation/population.js @@ -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() { @@ -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} /> : null} @@ -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 = ( @@ -1451,7 +1451,7 @@ var criteriaGroup1 = function() { ); return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)} {mafCutoffInput}
); diff --git a/src/clincoded/static/components/variant_central/interpretation/segregation.js b/src/clincoded/static/components/variant_central/interpretation/segregation.js index 9516f6231..379c393c9 100644 --- a/src/clincoded/static/components/variant_central/interpretation/segregation.js +++ b/src/clincoded/static/components/variant_central/interpretation/segregation.js @@ -26,7 +26,8 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg href_url: PropTypes.object, affiliation: PropTypes.object, session: PropTypes.object, - selectedCriteria: PropTypes.string + selectedCriteria: PropTypes.string, + unusedCriteria: PropTypes.array }, getInitialState() { @@ -82,7 +83,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg 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} /> : null} @@ -101,7 +102,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg evidenceData={null} evidenceDataUpdated={true} 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} /> : null} @@ -120,7 +121,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg evidenceData={null} evidenceDataUpdated={true} formDataUpdater={criteriaGroup3Update} 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} /> : null} @@ -139,7 +140,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg evidenceData={null} evidenceDataUpdated={true} formDataUpdater={criteriaGroup4Update} 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} /> : null} @@ -158,7 +159,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg evidenceData={null} evidenceDataUpdated={true} formDataUpdater={criteriaGroup5Update} variantUuid={this.props.data['@id']} interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj} - affiliation={affiliation} session={session} /> + unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} /> : null} @@ -177,7 +178,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg evidenceData={null} evidenceDataUpdated={true} formDataUpdater={criteriaGroup6Update} 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} /> : null} @@ -196,7 +197,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg evidenceData={null} evidenceDataUpdated={true} formDataUpdater={criteriaGroup7Update} 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} /> : null} @@ -216,7 +217,7 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg evidenceData={null} evidenceDataUpdated={true} criteriaCrossCheck={[['BP6', 'PP5']]} formDataUpdater={criteriaGroup8Update} variantUuid={this.state.data['@id']} interpretation={this.state.interpretation} updateInterpretationObj={this.props.updateInterpretationObj} - disableEvalForm={true} affiliation={affiliation} session={session} /> + unusedCriteria={this.props.unusedCriteria} affiliation={affiliation} session={session} /> : null} @@ -232,11 +233,11 @@ var CurationInterpretationSegregation = module.exports.CurationInterpretationSeg // code for rendering of this group of interpretation forms -var criteriaGroup1 = function() { +var criteriaGroup1 = function(unusedCriteria) { let criteriaList1 = ['BS2']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); }; @@ -248,11 +249,11 @@ var criteriaGroup1Update = function(nextProps) { // code for rendering of this group of interpretation forms -var criteriaGroup2 = function() { +var criteriaGroup2 = function(unusedCriteria) { let criteriaList1 = ['PS4']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); }; @@ -264,14 +265,14 @@ var criteriaGroup2Update = function(nextProps) { // code for rendering of this group of interpretation forms -var criteriaGroup3 = function() { +var criteriaGroup3 = function(unusedCriteria) { let criteriaList1 = ['BS4'], // array of criteria code handled subgroup of this section criteriaList2 = ['PP1']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, unusedCriteria)}
); }; @@ -283,14 +284,14 @@ var criteriaGroup3Update = function(nextProps) { // code for rendering of this group of interpretation forms -var criteriaGroup4 = function() { +var criteriaGroup4 = function(unusedCriteria) { let criteriaList1 = ['PM6'], // array of criteria code handled subgroup of this section criteriaList2 = ['PS2']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, unusedCriteria)}
); }; @@ -302,14 +303,14 @@ var criteriaGroup4Update = function(nextProps) { // code for rendering of this group of interpretation forms -var criteriaGroup5 = function() { +var criteriaGroup5 = function(unusedCriteria) { let criteriaList1 = ['BP2'], // array of criteria code handled subgroup of this section criteriaList2 = ['PM3']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList2, unusedCriteria)}
); }; @@ -321,11 +322,11 @@ var criteriaGroup5Update = function(nextProps) { // code for rendering of this group of interpretation forms -var criteriaGroup6 = function() { +var criteriaGroup6 = function(unusedCriteria) { let criteriaList1 = ['BP5']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); }; @@ -337,11 +338,11 @@ var criteriaGroup6Update = function(nextProps) { // code for rendering of this group of interpretation forms -var criteriaGroup7 = function() { +var criteriaGroup7 = function(unusedCriteria) { let criteriaList1 = ['PP4']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, false)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); }; @@ -357,11 +358,11 @@ var criteriaGroup7Update = function(nextProps) { * Disabling form currently only applies to 'BP6' and 'PP5' if the gene is NEITHER BRCA1 or BRCA2 * @param {boolean} disableEvalForm - The flag to disable criteria evaluation form */ -var criteriaGroup8 = function(disableEvalForm) { +var criteriaGroup8 = function(unusedCriteria) { let criteriaList1 = ['BP6', 'PP5']; // array of criteria code handled subgroup of this section return (
- {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, true)} + {vciFormHelper.renderEvalFormSection.call(this, criteriaList1, unusedCriteria)}
); }; diff --git a/src/clincoded/static/components/variant_central/interpretation/shared/form.js b/src/clincoded/static/components/variant_central/interpretation/shared/form.js index dded30cdf..a971bbd01 100644 --- a/src/clincoded/static/components/variant_central/interpretation/shared/form.js +++ b/src/clincoded/static/components/variant_central/interpretation/shared/form.js @@ -35,7 +35,7 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre criteriaCrossCheck: PropTypes.array, // an array of arrays of criteria codes that are to be checked upon submitForm to make sure there are no more than one 'Met' interpretation: PropTypes.object, // parent interpretation object updateInterpretationObj: PropTypes.func, // function from index.js; this function will pass the updated interpretation object back to index.js - disableEvalForm: PropTypes.bool, // TRUE to disable form elements of Segregation's 'Reputable source' section if the gene is NEITHER BRCA1 or BRCA2 + unusedCriteria: PropTypes.array, // used to determine whether or not to disable the field affiliation: PropTypes.object, session: PropTypes.object, criteriaEvalNote: PropTypes.func @@ -158,12 +158,14 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre // cross check criteria values here (no more than one met per cross-check group); for cross checking within the same form group var criteriaEvalConflictValues = ['met', 'supporting', 'moderate', 'strong', 'stand-alone', 'very-strong']; if (this.props.criteriaCrossCheck && this.props.criteriaCrossCheck.length > 0) { + // filter out disabled criteria + var criteriaCrossCheck = this.props.criteriaCrossCheck.filter(criterion => this.props.unusedCriteria.indexOf(criterion) === -1); var criteriaMetNum = 0, criteriaConflicting = [], errorMsgCriteria = '', crossCheckGroup; - for (var i = 0; i < this.props.criteriaCrossCheck.length; i++) { - crossCheckGroup = this.props.criteriaCrossCheck[i]; + for (var i = 0; i < criteriaCrossCheck.length; i++) { + crossCheckGroup = criteriaCrossCheck[i]; // reset criteria conflicting array and message when moving to next cross check group criteriaMetNum = 0; criteriaConflicting = []; @@ -231,7 +233,9 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre } */ // UNCOMMENT ABOVE + COMMENT LINE BELOW FOR DISEASE DEPENDENCY RESTRICTION - submittedCriteria.push(criterion); + if (this.props.unusedCriteria.indexOf(criterion) === -1) { + submittedCriteria.push(criterion); + } }); // do hard-coded check for PM2 vs PS4 // UNCOMMENT BELOW TO RE-ENABLE PM2 vs PS4 CHECK - SEE #1195 @@ -405,10 +409,11 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre }, render: function() { + const disableSubmit = this.props.criteria.every(criterion => this.props.unusedCriteria.indexOf(criterion) !== -1); return (
- {this.props.renderedFormContent.call(this, this.props.disableEvalForm)} + {this.props.renderedFormContent.call(this, this.props.unusedCriteria)}
{typeof this.props.criteriaEvalNote === 'function' ? @@ -416,7 +421,7 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre : null} + inputDisabled={(this.state.diseaseCriteria && this.state.diseaseCriteria.length == this.props.criteria.length && !this.state.diseaseAssociated) || disableSubmit} /> {this.state.updateMsg ?
{this.state.updateMsg}
: null} @@ -456,6 +461,7 @@ export function renderEvalFormSection(criteriaList, disableEvalForm) { return (
{criteriaList.map((criteria, i) => { + const disableEvalForm = (this.props.unusedCriteria.indexOf(criteria) > -1); return (
@@ -531,7 +537,9 @@ function evalFormValueDropdown(criteria, disableEvalForm) { error={this.getFormError(criteria + "-status")} clearError={this.clrFormErrors.bind(null, criteria + "-status")} labelClassName="control-label" wrapperClassName="col-xs-12 eval-form-criteria-dropdown" groupClassName="form-group" inputDisabled={disableEvalForm}> - + diff --git a/src/clincoded/static/scss/clincoded/modules/_curator.scss b/src/clincoded/static/scss/clincoded/modules/_curator.scss index cb22eaf9c..3307ed767 100644 --- a/src/clincoded/static/scss/clincoded/modules/_curator.scss +++ b/src/clincoded/static/scss/clincoded/modules/_curator.scss @@ -2162,6 +2162,35 @@ } } +.criteria-key { + z-index: 2; + position: relative; +} + +.criteria-cross { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + height: 100%; + z-index: 1; +} + +.criteria-neg-slope-line { + position: absolute; + height: 100%; + width: 100%; + background: linear-gradient(to top right, #fff calc(50% - 2px), #aaa, #aaa, #fff calc(50% + 2px)) +} + +.criteria-pos-slope-line { + position: absolute; + height: 100%; + width: 100%; + background: linear-gradient(to bottom right, transparent calc(50% - 2px), #aaa, #aaa, transparent calc(50% + 2px)) +} + .criteria-group.btn-group-sm { padding-top: 10px; padding-bottom: 10px; From 2966c9b9453d9eb1c845a17dbb38466a2f07912c Mon Sep 17 00:00:00 2001 From: Howard Tong Date: Tue, 11 Jun 2019 15:17:08 -0700 Subject: [PATCH 2/4] Adds variable check, fixes variable mistakes --- .../static/components/variant_central/index.js | 9 +++++---- .../variant_central/interpretation/criteria.js | 2 +- .../variant_central/interpretation/segregation.js | 4 ++-- .../variant_central/interpretation/shared/form.js | 12 +++++++----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/clincoded/static/components/variant_central/index.js b/src/clincoded/static/components/variant_central/index.js index c1ae584fb..3c7803031 100644 --- a/src/clincoded/static/components/variant_central/index.js +++ b/src/clincoded/static/components/variant_central/index.js @@ -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), @@ -75,7 +76,8 @@ var VariantCurationHub = createReactClass({ classificationStatus: 'In progress', classificationSnapshots: [], publishProvisionalReady: false, - publishSnapshotListReady: false + publishSnapshotListReady: false, + unusedCriteria: unusedCriteria }; }, @@ -557,7 +559,6 @@ var VariantCurationHub = createReactClass({ }, render() { - const unusedCriteria = ['BP6', 'PP5']; const variantData = this.state.variantObj; const editKey = this.state.editKey; const selectedTab = this.state.selectedTab; @@ -583,7 +584,7 @@ var VariantCurationHub = createReactClass({ {!this.state.summaryVisible ?
+ updateSelectedCriteria={this.updateSelectedCriteria} unusedCriteria={this.state.unusedCriteria} /> -1) + const unused = Array.isArray(this.props.unusedCriteria) && (this.props.unusedCriteria.indexOf(key) > -1); return (