diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 4227c7a3a6..a8dc6feba5 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/components", - "version": "6.49.1", + "version": "6.49.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/components", - "version": "6.49.1", + "version": "6.49.2", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", diff --git a/packages/components/package.json b/packages/components/package.json index 166545bde5..492aa0f364 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/components", - "version": "6.49.1", + "version": "6.49.2", "description": "Components, models, actions, and utility functions for LabKey applications and pages", "sideEffects": false, "files": [ diff --git a/packages/components/releaseNotes/components.md b/packages/components/releaseNotes/components.md index 74aff12c99..54c727946f 100644 --- a/packages/components/releaseNotes/components.md +++ b/packages/components/releaseNotes/components.md @@ -1,6 +1,10 @@ # @labkey/components Components, models, actions, and utility functions for LabKey applications and pages +### version 6.49.2 +*Released*: 17 June 2025 +- GitHub Issue 748: "View Assay Results for Selected" gives error when no rows have sample IDs + ### version 6.49.1 *Released*: 16 June 2025 - GH Issue 796: App assay Samples > Find Derivatives in Sample Finder not working for field with special characters diff --git a/packages/components/src/internal/components/samples/actions.ts b/packages/components/src/internal/components/samples/actions.ts index 3a75d82308..aac8abf8ff 100644 --- a/packages/components/src/internal/components/samples/actions.ts +++ b/packages/components/src/internal/components/samples/actions.ts @@ -445,6 +445,12 @@ export async function createSessionAssayRunSummaryQuery(sampleIds: number[]): Pr assayRunsQuery = 'AssayRunsPerSampleChildFolder'; } + // GitHub Issue 748: need to account for the case with no sampleIds + let whereClause = 'WHERE RowId IN (' + sampleIds.join(',') + ')\n'; + if (sampleIds.length === 0) { + whereClause = 'WHERE 1 = 0\n'; // add where clause that will always result in zero rows + } + return await selectRowsDeprecated({ saveInSession: true, schemaName: 'exp', @@ -453,9 +459,7 @@ export async function createSessionAssayRunSummaryQuery(sampleIds: number[]): Pr "FROM (SELECT RowId, SampleID, SampleType, Assay || ' Run Count' AS Assay FROM " + assayRunsQuery + ') X\n' + - 'WHERE RowId IN (' + - sampleIds.join(',') + - ')\n' + + whereClause + 'GROUP BY RowId, SampleID, SampleType, Assay\n' + 'PIVOT RunCount BY Assay', maxRows: 0, // we don't need any data back here, we just need to get the temp session schema/query