Skip to content

Commit

Permalink
wc - Fixed bug disorder as array
Browse files Browse the repository at this point in the history
  • Loading branch information
gpveronica committed Oct 27, 2023
1 parent 379b1b7 commit d0c7538
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 13 deletions.
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 @@ -633,7 +633,7 @@ export default class ClinicalAnalysisGrid extends LitElement {
formatter: (value, row) => {
const panelHtml = row.panels?.length > 0 ? CatalogGridFormatter.panelFormatter(row.panels) : "-";
return `
<div>${CatalogGridFormatter.disorderFormatter(value, row)}</div>
<div>${CatalogGridFormatter.disorderFormatter([value], row)}</div>
<div style="margin: 5px 0">${panelHtml}</div>
`;
},
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/clinical/clinical-analysis-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])),
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/clinical/clinical-analysis-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])),
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/clinical/clinical-analysis-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])),
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
}
},
{
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions src/webcomponents/commons/catalog-grid-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export default class CatalogGridFormatter {
html += `
<div style="white-space: nowrap">
<span style="margin: 2px 0; font-weight: bold">${variable}:</span> ${annotationSet.annotations[variable]}
</div>`;
</div>
`;
}
} else {
// This entity has not this variableSetId annotated
Expand All @@ -215,7 +216,8 @@ export default class CatalogGridFormatter {
html += `
<div style="white-space: nowrap">
<span style="margin: 2px 0; font-weight: bold">${variable}:</span> ${annotationSet.annotations[variable]}
</div>`;
</div>
`;
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/family/family-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/individual/individual-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])),
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/variant/variant-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("<br>");
const result = disorders?.map(disorder => CatalogGridFormatter.disorderFormatter([disorder])).join("<br>");
return result ? result : "-";
},
halign: "center"
Expand Down

0 comments on commit d0c7538

Please sign in to comment.