From d0c753805ff432adbe2c9af39d892d3a8aa976fc Mon Sep 17 00:00:00 2001 From: gpveronica Date: Fri, 27 Oct 2023 18:38:16 +0200 Subject: [PATCH] wc - Fixed bug disorder as array --- .../clinical/clinical-analysis-grid.js | 2 +- .../clinical/clinical-analysis-summary.js | 2 +- .../clinical/clinical-analysis-update.js | 2 +- .../clinical/clinical-analysis-view.js | 2 +- .../clinical-interpretation-editor.js | 18 +++++++++++++++--- .../commons/catalog-grid-formatter.js | 6 ++++-- src/webcomponents/family/family-view.js | 2 +- .../individual/individual-view.js | 2 +- .../variant-interpreter-qc-summary.js | 2 +- src/webcomponents/variant/variant-samples.js | 2 +- 10 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/webcomponents/clinical/clinical-analysis-grid.js b/src/webcomponents/clinical/clinical-analysis-grid.js index 02dc729fa2..0e31e798da 100644 --- a/src/webcomponents/clinical/clinical-analysis-grid.js +++ b/src/webcomponents/clinical/clinical-analysis-grid.js @@ -633,7 +633,7 @@ export default class ClinicalAnalysisGrid extends LitElement { formatter: (value, row) => { const panelHtml = row.panels?.length > 0 ? CatalogGridFormatter.panelFormatter(row.panels) : "-"; return ` -
${CatalogGridFormatter.disorderFormatter(value, row)}
+
${CatalogGridFormatter.disorderFormatter([value], row)}
${panelHtml}
`; }, diff --git a/src/webcomponents/clinical/clinical-analysis-summary.js b/src/webcomponents/clinical/clinical-analysis-summary.js index 6c0d41fc5f..982ef66f22 100644 --- a/src/webcomponents/clinical/clinical-analysis-summary.js +++ b/src/webcomponents/clinical/clinical-analysis-summary.js @@ -137,7 +137,7 @@ export default class ClinicalAnalysisSummary extends LitElement { field: "disorder", type: "custom", display: { - render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter(disorder)), + render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter([disorder])), } }, { diff --git a/src/webcomponents/clinical/clinical-analysis-update.js b/src/webcomponents/clinical/clinical-analysis-update.js index 3bb9e60045..df07d845e1 100644 --- a/src/webcomponents/clinical/clinical-analysis-update.js +++ b/src/webcomponents/clinical/clinical-analysis-update.js @@ -213,7 +213,7 @@ export default class ClinicalAnalysisUpdate extends LitElement { field: "disorder", type: "custom", display: { - render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter(disorder)), + render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter([disorder])), } }, { diff --git a/src/webcomponents/clinical/clinical-analysis-view.js b/src/webcomponents/clinical/clinical-analysis-view.js index af9b98d002..8a1f5bc337 100644 --- a/src/webcomponents/clinical/clinical-analysis-view.js +++ b/src/webcomponents/clinical/clinical-analysis-view.js @@ -239,7 +239,7 @@ export default class ClinicalAnalysisView extends LitElement { id: "type", type: "custom", display: { - render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter(disorder)), + render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter([disorder])), }, }, { diff --git a/src/webcomponents/clinical/interpretation/clinical-interpretation-editor.js b/src/webcomponents/clinical/interpretation/clinical-interpretation-editor.js index c291754830..09ee8fb576 100644 --- a/src/webcomponents/clinical/interpretation/clinical-interpretation-editor.js +++ b/src/webcomponents/clinical/interpretation/clinical-interpretation-editor.js @@ -221,7 +221,7 @@ class ClinicalInterpretationEditor extends LitElement { field: "disorder", type: "custom", display: { - render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter(disorder)) + render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter([disorder])) } }, { @@ -322,7 +322,13 @@ class ClinicalInterpretationEditor extends LitElement { _updateOrDeleteComments(notify) { if (this.commentsUpdate?.updated?.length > 0) { - this.opencgaSession.opencgaClient.clinical().updateInterpretation(this.clinicalAnalysis.id, this.clinicalAnalysis.interpretation.id, {comments: this.commentsUpdate.updated}, {commentsAction: "REPLACE", study: this.opencgaSession.study.fqn}) + this.opencgaSession.opencgaClient.clinical() + .updateInterpretation( + this.clinicalAnalysis.id, + this.clinicalAnalysis.interpretation.id, + {comments: this.commentsUpdate.updated}, + {commentsAction: "REPLACE", study: this.opencgaSession.study.fqn} + ) .then(response => { if (notify && this.commentsUpdate?.deleted?.length === 0) { this._postUpdate(response); @@ -333,7 +339,13 @@ class ClinicalInterpretationEditor extends LitElement { }); } if (this.commentsUpdate?.deleted?.length > 0) { - this.opencgaSession.opencgaClient.clinical().updateInterpretation(this.clinicalAnalysis.id, this.clinicalAnalysis.interpretation.id, {comments: this.commentsUpdate.deleted}, {commentsAction: "REMOVE", study: this.opencgaSession.study.fqn}) + this.opencgaSession.opencgaClient.clinical() + .updateInterpretation( + this.clinicalAnalysis.id, + this.clinicalAnalysis.interpretation.id, + {comments: this.commentsUpdate.deleted}, + {commentsAction: "REMOVE", study: this.opencgaSession.study.fqn} + ) .then(response => { if (notify) { this._postUpdate(response); diff --git a/src/webcomponents/commons/catalog-grid-formatter.js b/src/webcomponents/commons/catalog-grid-formatter.js index 31452fe077..3b59c1c952 100644 --- a/src/webcomponents/commons/catalog-grid-formatter.js +++ b/src/webcomponents/commons/catalog-grid-formatter.js @@ -200,7 +200,8 @@ export default class CatalogGridFormatter { html += `
${variable}: ${annotationSet.annotations[variable]} -
`; + + `; } } else { // This entity has not this variableSetId annotated @@ -215,7 +216,8 @@ export default class CatalogGridFormatter { html += `
${variable}: ${annotationSet.annotations[variable]} -
`; + + `; } } } else { diff --git a/src/webcomponents/family/family-view.js b/src/webcomponents/family/family-view.js index 274a8ae29d..b25a488834 100644 --- a/src/webcomponents/family/family-view.js +++ b/src/webcomponents/family/family-view.js @@ -247,7 +247,7 @@ export default class FamilyView extends LitElement { type: "list", display: { contentLayout: "vertical", - render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter(disorder)), + render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter([disorder])), defaultValue: "N/A" } }, diff --git a/src/webcomponents/individual/individual-view.js b/src/webcomponents/individual/individual-view.js index 02e48f17ea..3477574278 100644 --- a/src/webcomponents/individual/individual-view.js +++ b/src/webcomponents/individual/individual-view.js @@ -249,7 +249,7 @@ export default class IndividualView extends LitElement { type: "list", display: { contentLayout: "vertical", - render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter(disorder)), + render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter([disorder])), defaultValue: "N/A", }, }, diff --git a/src/webcomponents/variant/interpretation/variant-interpreter-qc-summary.js b/src/webcomponents/variant/interpretation/variant-interpreter-qc-summary.js index ec07bd04b5..e2af840663 100644 --- a/src/webcomponents/variant/interpretation/variant-interpreter-qc-summary.js +++ b/src/webcomponents/variant/interpretation/variant-interpreter-qc-summary.js @@ -182,7 +182,7 @@ class VariantInterpreterQcSummary extends LitElement { field: "disorder", type: "custom", display: { - render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter(disorder)), + render: disorder => UtilsNew.renderHTML(CatalogGridFormatter.disorderFormatter([disorder])), }, }, { diff --git a/src/webcomponents/variant/variant-samples.js b/src/webcomponents/variant/variant-samples.js index 7ddef92dd0..2676d61222 100644 --- a/src/webcomponents/variant/variant-samples.js +++ b/src/webcomponents/variant/variant-samples.js @@ -330,7 +330,7 @@ export default class VariantSamples extends LitElement { colspan: 1, rowspan: 1, formatter: disorders => { - const result = disorders?.map(disorder => CatalogGridFormatter.disorderFormatter(disorder)).join("
"); + const result = disorders?.map(disorder => CatalogGridFormatter.disorderFormatter([disorder])).join("
"); return result ? result : "-"; }, halign: "center"