Skip to content

Commit

Permalink
Merge branch 'release-3.x.x' into TASK-6854
Browse files Browse the repository at this point in the history
  • Loading branch information
gpveronica authored Sep 24, 2024
2 parents 31f27dc + 2c0bfe6 commit dcc987c
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 108 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/iva/genome-browser.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ context("GenomeBrowser", () => {

cy.get("@karyotype")
.find(`div[data-cy="gb-karyotype-toggle"]`)
.trigger("click");
.trigger("click", {force: true});

cy.get("@karyotypeContent")
.invoke("css", "display")
Expand Down
2 changes: 1 addition & 1 deletion src/genome-browser/genome-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class GenomeBrowser {
// Generate GB template
const template = UtilsNew.renderHTML(`
<div id="${this.prefix}" data-cy="gb-parent" class="card text-bg-light mb-3">
<div id="${this.prefix}Navigation" data-cy="gb-navigation" class="card-header"></div>
<div id="${this.prefix}Navigation" data-cy="gb-navigation" class="card-header bg-light sticky-top"></div>
<ul class="list-group rounded-0">
<li id="${this.prefix}Karyotype" data-cy="gb-karyotype" class="list-group-item" style="display:none;"></li>
<li id="${this.prefix}Chromosome" data-cy="gb-chromosome" class="list-group-item" style="display:none;"></li>
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/clinical/clinical-analysis-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export default class ClinicalAnalysisGrid extends LitElement {
// const btnClassName = "d-inline-flex align-items-center btn btn-light dropdown-toggle";
const btnClassName = "d-flex justify-content-between align-items-center btn btn-light dropdown-toggle w-100";
// const btnStyle = "display:inline-flex;align-items:center;";
debugger

return `
<div class="dropdown">
<button class="${btnClassName}" type="button" data-bs-toggle="dropdown" ${!isEditable ? "disabled=\"disabled\"" : ""}>
Expand Down
5 changes: 5 additions & 0 deletions src/webcomponents/commons/forms/select-field-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ export default class SelectFieldFilter extends LitElement {
}

this.select.empty();

// Force to unbind 'select2:select' and 'select2:unselect' listeners
this.select.off("select2:select");
this.select.off("select2:unselect");

const options = this.data.map(item => this.getOptions(item));

const selectConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/commons/layouts/custom-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default class CustomFooter extends LitElement {
<div class="d-flex gap-3">
<div class="footer-item footer-section-text">
<a class="text-white" href="https://github.com/opencb/jsorolla" target="blank">
${this.appName || "IVA (JSorolla)"} <sup>${this.version || this.config?.version}</sup>
${this.appName || "IVA (JSorolla)"} <sup>v${this.version || this.config?.version}</sup>
</a>
</div>
${this.host?.opencga ? html `
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/commons/opencga-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export default class OpencgaBrowser extends LitElement {

renderButtonViews() {
return html `
<div class="content-pills mb-3" role="toolbar" aria-label="toolbar">
<div class="d-flex gap-1 mb-3" role="toolbar" aria-label="toolbar">
${(this._config.views || []).map(view => html`
<button
type="button"
Expand Down
1 change: 1 addition & 0 deletions src/webcomponents/commons/utils/web-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default class WebUtils {
"JOB": "JOBS",
"FILE": "FILES",
"CLINICAL_ANALYSIS": "CLINICAL_ANALYSIS",
"CLINICAL_VARIANT": "CLINICAL_VARIANT",
"PROJECT": "PROJECTS",
"STUDY": "STUDIES",
"USER": "USERS",
Expand Down
6 changes: 3 additions & 3 deletions src/webcomponents/variant/custom/steiner-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class SteinerReport extends LitElement {

#init() {
this.gridTypes = {
snv: "variantInterpreterCancerSNV",
cnv: "variantInterpreterCancerCNV",
rearrangements: "variantInterpreterRearrangement",
snv: "variant-interpreter-cancer-snv",
cnv: "variant-interpreter-cancer-cnv",
rearrangements: "variant-interpreter-rearrangement",
};

this.callersInfo = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ class VariantInterpreterBrowserTemplate extends LitElement {
<button class="${`btn btn-success ${this.activeView === id ? "active" : ""}`}" @click="${() => this.onChangeView(id)}">
<i class="${`fa fa-${icon} icon-padding`}" aria-hidden="true"></i>
<strong>${title}</strong>
</button>`;
</button>
`;
}

render() {
Expand Down Expand Up @@ -435,7 +436,7 @@ class VariantInterpreterBrowserTemplate extends LitElement {
<div class="flex-grow-1">
<!-- View toolbar -->
<div class="content-pills mb-3" role="toolbar" aria-label="toolbar">
<div class="d-flex gap-1 mb-3" role="toolbar" aria-label="toolbar">
${this.renderViewButton("table", "Table Result", "table")}
${!this.settings?.hideGenomeBrowser ? this.renderViewButton("genome-browser", "Genome Browser", "dna") : nothing}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ export default class VariantInterpreterGrid extends LitElement {
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a id="${reviewId}" href="javascript: void 0" class="dropdown-item reviewButton" data-action="edit" ${reviewDisabled}>
<a id="${reviewId}" href="javascript: void 0" class="dropdown-item reviewButton ${reviewDisabled}" data-action="edit">
<i class="fas fa-edit me-1 reviewButton" aria-hidden="true"></i> Edit ...
</a>
</li>
Expand Down Expand Up @@ -1382,9 +1382,9 @@ export default class VariantInterpreterGrid extends LitElement {
const reviewActionButton = document.getElementById(`${this._prefix}${variantId}VariantReviewActionButton`);
if (reviewActionButton) {
if (e.currentTarget.checked) {
reviewActionButton.removeAttribute("disabled");
reviewActionButton.classList.remove("disabled");
} else {
reviewActionButton.setAttribute("disabled", "true");
reviewActionButton.classList.add("disabled");
}
}

Expand Down Expand Up @@ -1598,6 +1598,7 @@ export default class VariantInterpreterGrid extends LitElement {
<div class="modal-content">
<div class="modal-header">
<h3>Review Variant Evidence</h3>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
${this.evidenceReview ? html`
<clinical-interpretation-variant-evidence-review
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
this.table.bootstrapTable({
theadClasses: "table-light",
buttonsClass: "light",
data: variants,
columns: this._getDefaultColumns(),
sidePagination: "server",
// Josemi Note 2024-01-31: we have added the ajax function for local variants for getting genes info
Expand Down Expand Up @@ -430,7 +429,7 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
/*
* GRID FORMATTERS
*/
detailFormatter(value, row, a) {
detailFormatter(value, row) {
let result = "<div class='row' style='padding-bottom: 20px'>";
let detailHtml = "";
if (row && row.annotation) {
Expand Down Expand Up @@ -489,29 +488,6 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
return "-";
}

// DEPRECATED
pathogeniticyFormatter(value, row, index) {
// TODO we must call to PathDB to get the frequency of each variant, next code is just an example
return `
<div class="col-md-12" style="padding: 0px">
<form class="form-horizontal">
<div class="col-md-12" style="padding: 0px">
<form class="form-horizontal">
<div class="form-group" style="margin: 0px 2px">
<label class="col-md-5">HP:00${Math.floor((Math.random() * 1000) + 1)}</label>
<div class="col-md-7">${Number(Math.random()).toFixed(2)}</div>
</div>
<div class="form-group" style="margin: 0px 2px">
<label class="col-md-5">HP:00${Math.floor((Math.random() * 1000) + 1)}</label>
<div class="col-md-7">${Number(Math.random()).toFixed(2)}</div>
</div>
</form>
</div>
</form>
</div>
`;
}

_getDefaultColumns() {
// This code creates dynamically the columns for the VCF INFO and FORMAT column data.
// Multiple file callers are supported.
Expand Down Expand Up @@ -648,7 +624,7 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
</a>`,
field: "interpretation",
rowspan: 1,
colspan: 4,
colspan: 2,
halign: "center"
},
{
Expand All @@ -667,7 +643,7 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a id="${reviewId}" href="javascript:void 0;" class="dropdown-item reviewButton" data-action="edit" ${reviewDisabled}>
<a id="${reviewId}" href="javascript:void 0;" class="dropdown-item reviewButton ${reviewDisabled}" data-action="edit">
<i class="fas fa-edit icon-padding reviewButton" aria-hidden="true"></i> Edit ...
</a>
</li>
Expand All @@ -686,6 +662,7 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this)
},
visible: this._config?.showActions,
excludeFromExport: true,
excludeFromSettings: true,
}
Expand Down Expand Up @@ -717,25 +694,6 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
},
...vcfDataColumns.vcf1,
...vcfDataColumns.vcf2,
{
id: "cohorts",
title: "Cohorts",
field: "cohort",
colspan: 1,
rowspan: 1,
formatter: VariantInterpreterGridFormatter.studyCohortsFormatter.bind(this),
visible: (this.clinicalAnalysis.type.toUpperCase() === "SINGLE" || this.clinicalAnalysis.type.toUpperCase() === "FAMILY") && this.gridCommons.isColumnVisible("cohorts",)
},
{
id: "prediction",
title: `${this.clinicalAnalysis.type !== "CANCER" ? "ACMG <br> Prediction" : "Prediction"}`,
field: "prediction",
rowspan: 1,
colspan: 1,
formatter: VariantInterpreterGridFormatter.predictionFormatter,
halign: "center",
visible: (this.clinicalAnalysis.type.toUpperCase() === "SINGLE" || this.clinicalAnalysis.type.toUpperCase() === "FAMILY") && this.gridCommons.isColumnVisible("prediction"),
},
{
title: "Select",
rowspan: 1,
Expand Down Expand Up @@ -788,9 +746,9 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
UtilsNew.objectClone(this.checkedVariants.get(row[1].id)),
];
this.requestUpdate();
// $("#" + this._prefix + "ReviewSampleModal").modal("show");
// const reviewSampleModal = new bootstrap.Modal("#" + this._prefix + "ReviewSampleModal");
this.reviewSampleModal.show();
// eslint-disable-next-line no-undef
const reviewSampleModal = new bootstrap.Modal("#" + this._prefix + "ReviewSampleModal");
reviewSampleModal.show();
}
break;
case "download":
Expand Down Expand Up @@ -947,9 +905,9 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
const reviewActionButton = document.getElementById(`${this._prefix}${this._rows[index][0].id}VariantReviewActionButton`);
if (reviewActionButton) {
if (event.currentTarget.checked) {
reviewActionButton.removeAttribute("disabled");
reviewActionButton.classList.remove("disabled");
} else {
reviewActionButton.setAttribute("disabled", "true");
reviewActionButton.classList.add("disabled");
}
}

Expand All @@ -973,18 +931,12 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
];
this.requestUpdate();

// $("#" + this._prefix + "ReviewSampleModal").modal("show");
// const reviewSampleModal = new bootstrap.Modal("#" + this._prefix + "ReviewSampleModal");
this.reviewSampleModal.show();
// eslint-disable-next-line no-undef
const reviewSampleModal = new bootstrap.Modal("#" + this._prefix + "ReviewSampleModal");
reviewSampleModal.show();
}
}

onConfigClick(e) {
// $("#" + this._prefix + "ConfigModal").modal("show");
const configModal = new bootstrap.Modal("#" + this._prefix + "ConfigModal");
configModal.show();
}

onVariantChange(e) {
this.variantsReview[0] = e.detail.value;
}
Expand Down Expand Up @@ -1016,10 +968,9 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
this.requestUpdate();
}

onCancelVariant(e) {
onCancelVariant() {
this.variantsReview = null;
this.requestUpdate();
// this._variantChanged = null;
}

render() {
Expand Down Expand Up @@ -1058,8 +1009,9 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
role="dialog" aria-hidden="true" style="overflow-y: visible">
<div class="modal-dialog modal-lg">
<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>
${this.variantsReview ? html`
<clinical-interpretation-variant-review
Expand All @@ -1070,38 +1022,12 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
</clinical-interpretation-variant-review>
` : null}
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="${() => this.onCancelVariant()}">Cancel</button>
<button type="button" class="btn btn-light" data-bs-dismiss="modal" @click="${() => this.onCancelVariant()}">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="${e => this.onSaveVariant(e)}">OK</button>
</div>
</div>
</div>
</div>
<div class="modal fade pt-0" id="${this._prefix}ConfigModal" tabindex="-1"
role="dialog" aria-hidden="true" style="overflow-y: visible">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" style="padding: 5px 15px">
<h3>Settings</h3>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="container-fluid">
<variant-interpreter-grid-config
.opencgaSession="${this.opencgaSession}"
.config="${this._config}"
.gridColumns="${this._columns}"
@configChange="${this.onGridConfigChange}">
</variant-interpreter-grid-config>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="${e => this.onGridConfigSave(e)}">OK</button>
</div>
</div>
</div>
</div>
`;
}

Expand All @@ -1116,7 +1042,7 @@ export default class VariantInterpreterRearrangementGrid extends LitElement {
showReview: true,
showEditReview: true,
showSelectCheckbox: false,
showActions: false,
showActions: true,
multiSelection: false,
nucleotideGenotype: true,
hideVcfFileData: false,
Expand Down
8 changes: 4 additions & 4 deletions src/webcomponents/variant/variant-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,24 +346,24 @@ export default class VariantBrowser extends LitElement {
<div class="col-md-10">
<!-- TAB buttons -->
<div class="content-pills mb-3" role="toolbar" aria-label="toolbar">
<div class="d-flex gap-1 mb-3" role="toolbar" aria-label="toolbar">
<button
type="button"
class="${`btn btn-success ${this.activeTab === "table-tab" ? "active" : ""} content-pills`}"
class="${`btn btn-success ${this.activeTab === "table-tab" ? "active" : ""}`}"
@click="${() => this.changeView("table-tab")}">
<i class="fa fa-table icon-padding" aria-hidden="true"></i>
<strong>Table Result</strong>
</button>
<button
type="button"
class="${`btn btn-success ${this.activeTab === "facet-tab" ? "active" : ""} content-pills`}"
class="${`btn btn-success ${this.activeTab === "facet-tab" ? "active" : ""}`}"
@click="${() => this.changeView("facet-tab")}">
<i class="fas fa-chart-bar icon-padding" aria-hidden="true"></i>
<strong>Aggregation Stats</strong>
</button>
<button
type="button"
class="${`btn btn-success ${this.activeTab === "genome-tab" ? "active" : ""} content-pills`}"
class="${`btn btn-success ${this.activeTab === "genome-tab" ? "active" : ""}`}"
@click="${() => this.changeView("genome-tab")}">
<i class="fas fa-dna icon-padding" aria-hidden="true"></i>
<strong>Genome Browser</strong>
Expand Down

0 comments on commit dcc987c

Please sign in to comment.