Skip to content

Commit

Permalink
Merge branch 'release-3.x.x' into TASK-6635
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes authored Oct 4, 2024
2 parents 2ede06b + 274a1c1 commit 014f6cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/webcomponents/sample/sample-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ export default class SampleGrid extends LitElement {
this.permissionID = WebUtils.getPermissionID(this.toolbarConfig.resource, "WRITE");
}

fetchClinicalAnalysis(rows, casesLimit) {
fetchClinicalAnalysis(rows, individuals, casesLimit) {
if (rows && rows.length > 0) {
return this.opencgaSession.opencgaClient.clinical()
.search({
individual: rows.map(sample => sample.individualId).join(","),
individual: individuals,
study: this.opencgaSession.study.fqn,
include: "id,proband.id,family.members",
limit: casesLimit * 10,
Expand Down Expand Up @@ -233,7 +233,14 @@ export default class SampleGrid extends LitElement {
.then(response => {
sampleResponse = response;
// Fetch clinical analysis to display the Case ID
return this.fetchClinicalAnalysis(sampleResponse?.responses?.[0]?.results || [], casesLimit);
const samples = sampleResponse?.responses?.[0]?.results;
const individuals = (samples || [])
.map(sample => sample.individualId)
.filter(individualId => !!individualId)
.join(",");
if (individuals) {
return this.fetchClinicalAnalysis(samples || [], individuals, casesLimit);
}
})
.then(() => {
// Prepare data for columns extensions
Expand Down
5 changes: 4 additions & 1 deletion src/webcomponents/sample/sample-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ export default class SampleView extends LitElement {
},
{
title: "Individual ID",
field: "individualId"
field: "individualId",
display: {
defaultValue: "No individuals or no clinical analyses",
}
},
{
title: "Files",
Expand Down

0 comments on commit 014f6cb

Please sign in to comment.