Skip to content

Commit

Permalink
wc: replace select clinical-interpreter & variant-review #TASK-5070
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodielm committed Nov 15, 2023
1 parent 8a72400 commit 83953ec
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ClinicalAnalysisUtils from "../clinical-analysis-utils.js";
import "../clinical-analysis-comment-editor.js";
import "../../commons/forms/data-form.js";
import "../../commons/forms/text-field-filter.js";

import "../../commons/forms/select-field-filter2.js";

class ClinicalInterpretationEditor extends LitElement {

Expand Down Expand Up @@ -87,7 +87,7 @@ class ClinicalInterpretationEditor extends LitElement {
opencgaSessionObserver() {
this._users = [];
if (this.opencgaSession && this.opencgaSession.study) {
for (let group of this.opencgaSession.study.groups) {
for (const group of this.opencgaSession.study.groups) {
if (group.id === "@members") {
this._users.push(...group.userIds.filter(user => user !== "*"));
}
Expand Down Expand Up @@ -118,13 +118,18 @@ class ClinicalInterpretationEditor extends LitElement {
renderStatus(status) {
return html`
<div class="">
<select-field-filter .data="${ClinicalAnalysisUtils.getInterpretationStatuses()}" .value="${status.id}"
.classes="${this.updateParams.status ? "updated" : ""}"
@filterChange="${e => {e.detail.param = "interpretation.status.id"; this.onFieldChange(e)}}">
</select-field-filter>
${status.description
? html`<span class="help-block" style="padding: 0px 5px">${status.description}</span>`
: null
<select-field-filter2
.data="${ClinicalAnalysisUtils.getInterpretationStatuses()}"
.value="${status.id}"
.classes="${this.updateParams.status ? "updated" : ""}"
@filterChange="${e => {
e.detail.param = "interpretation.status.id";
this.onFieldChange(e);
}}">
</select-field-filter2>
${status.description ?
html`<span class="help-block" style="padding: 0px 5px">${status.description}</span>` :
null
}
</div>`;
}
Expand All @@ -133,7 +138,7 @@ class ClinicalInterpretationEditor extends LitElement {
switch (e.detail.param) {
case "interpretation.status.id":
case "interpretation.analyst.id":
let field = e.detail.param.split(".")[1];
const field = e.detail.param.split(".")[1];
if (this._clinicalAnalysis.interpretation[field]?.id !== e.detail.value && e.detail.value !== null) {
this.clinicalAnalysis.interpretation[field].id = e.detail.value;
this.updateParams[field] = {
Expand All @@ -159,7 +164,7 @@ class ClinicalInterpretationEditor extends LitElement {
}

onCommentChange(e) {
this.commentsUpdate = e.detail
this.commentsUpdate = e.detail;
}

getDefaultConfig() {
Expand Down Expand Up @@ -208,8 +213,8 @@ class ClinicalInterpretationEditor extends LitElement {
type: "custom",
display: {
render: proband => {
let sex = (proband.sex && proband.sex !== "UNKNOWN") ? `(${proband.sex})` : "";
let sampleIds = proband.samples.map(sample => sample.id).join(", ");
const sex = (proband.sex && proband.sex !== "UNKNOWN") ? `(${proband.sex})` : "";
const sampleIds = proband.samples.map(sample => sample.id).join(", ");
return html`
<span style="padding-right: 25px">${proband.id} ${sex}</span>
<span style="font-weight: bold; padding-right: 10px">Sample(s):</span><span>${sampleIds}</span>`;
Expand Down Expand Up @@ -373,11 +378,12 @@ class ClinicalInterpretationEditor extends LitElement {
}

return html`
<data-form .data="${this.clinicalAnalysis}"
.config="${this._config}"
@fieldChange="${e => this.onFieldChange(e)}"
@clear="${this.onClear}"
@submit="${this.onRun}">
<data-form
.data="${this.clinicalAnalysis}"
.config="${this._config}"
@fieldChange="${e => this.onFieldChange(e)}"
@clear="${this.onClear}"
@submit="${this.onRun}">
</data-form>
`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {LitElement, html} from "lit";
import LitUtils from "../../commons/utils/lit-utils.js";
import UtilsNew from "../../../core/utils-new.js";
import "../../commons/filters/acmg-filter.js";
import "../../commons/forms/select-field-filter.js";
import "../../commons/forms/select-field-filter2.js";

export default class ClinicalInterpretationVariantEvidenceReview extends LitElement {

Expand Down Expand Up @@ -149,11 +149,11 @@ export default class ClinicalInterpretationVariantEvidenceReview extends LitElem
type: "custom",
display: {
render: clinicalSignificance => html`
<select-field-filter
<select-field-filter2
.data=${CLINICAL_SIGNIFICANCE}
.value=${(clinicalSignificance || "").toLowerCase()}
@filterChange="${e => this.onFieldChange(e, "clinicalSignificance")}">
</select-field-filter>
</select-field-filter2>
`,
defaultValue: "",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1559,9 +1559,9 @@ export default class VariantInterpreterGrid extends LitElement {
<div class="modal fade" id="${this._prefix}ReviewSampleModal" tabindex="-1"
role="dialog" aria-hidden="true" style="padding-top:0; overflow-y: visible">
<div class="modal-dialog" style="width: 768px">
<div class="modal-dialog modal-lg" style="width: 768px">
<div class="modal-content">
<div class="modal-header" style="padding: 5px 15px">
<div class="modal-header">
<h3>Review Variant</h3>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,6 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" style="padding: 5px 15px">
<h3>Review Variant</h3>
</div>
${this.variantsReview ? html`
Expand Down

0 comments on commit 83953ec

Please sign in to comment.