From 474a459cf462c8454bdb52836cb1a5e97d2787b8 Mon Sep 17 00:00:00 2001 From: Nick Kerr Date: Thu, 14 Nov 2024 08:51:33 -0800 Subject: [PATCH] Issue 51648: Specify container filter for plate template well data (#6049) --- assay/package-lock.json | 8 ++++---- assay/package.json | 2 +- .../org/labkey/assay/plate/PlateManager.java | 18 ++++++++++++------ core/package-lock.json | 8 ++++---- core/package.json | 2 +- experiment/package-lock.json | 16 ++++++++-------- experiment/package.json | 4 ++-- pipeline/package-lock.json | 8 ++++---- pipeline/package.json | 2 +- 9 files changed, 37 insertions(+), 31 deletions(-) diff --git a/assay/package-lock.json b/assay/package-lock.json index f30b547d6cd..bba5dc48a99 100644 --- a/assay/package-lock.json +++ b/assay/package-lock.json @@ -8,7 +8,7 @@ "name": "assay", "version": "0.0.0", "dependencies": { - "@labkey/components": "5.22.0" + "@labkey/components": "5.22.9" }, "devDependencies": { "@labkey/build": "8.3.0", @@ -2252,9 +2252,9 @@ } }, "node_modules/@labkey/components": { - "version": "5.22.0", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.0.tgz", - "integrity": "sha512-NcfAcnAMqEW6yf2OuDTxtg7mrFLvTGbTRubNQ1dXRi6DtDlLNY3QAPkuXXElUHlJxN2LFzaLL3hF1ZnBrffyNA==", + "version": "5.22.9", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.9.tgz", + "integrity": "sha512-YkXditiUaA3pqRIRBMs71XcDG32knRSDKXub/JHq4vNs1+giJQk76s1neJpxCMhPmOgQPC63VFYiRDUfiSOsEA==", "dependencies": { "@hello-pangea/dnd": "17.0.0", "@labkey/api": "1.36.0", diff --git a/assay/package.json b/assay/package.json index 0350bebd943..cf8b316b0d6 100644 --- a/assay/package.json +++ b/assay/package.json @@ -12,7 +12,7 @@ "clean": "rimraf resources/web/assay/gen && rimraf resources/views/gen && rimraf resources/web/gen" }, "dependencies": { - "@labkey/components": "5.22.0" + "@labkey/components": "5.22.9" }, "devDependencies": { "@labkey/build": "8.3.0", diff --git a/assay/src/org/labkey/assay/plate/PlateManager.java b/assay/src/org/labkey/assay/plate/PlateManager.java index fa7e4fe8e8e..9aee0f7c875 100644 --- a/assay/src/org/labkey/assay/plate/PlateManager.java +++ b/assay/src/org/labkey/assay/plate/PlateManager.java @@ -682,9 +682,10 @@ else if (matchingPlates.isEmpty()) */ public ContainerFilter getPlateContainerFilter(@Nullable ExpProtocol protocol, Container container, User user) { - ContainerFilter lookupCf = QueryService.get().getContainerFilterForLookups(container, user); - ContainerFilter currentCf = ContainerFilter.Type.Current.create(protocol != null ? protocol.getContainer() : container, user); - return lookupCf != null ? lookupCf : currentCf; + ContainerFilter containerFilter = QueryService.get().getContainerFilterForLookups(container, user); + if (containerFilter == null) + containerFilter = ContainerFilter.Type.Current.create(protocol != null ? protocol.getContainer() : container, user); + return containerFilter; } @Override @@ -1531,14 +1532,19 @@ public TableInfo getPlateTableInfo() return getPlateTable(container, user, null); } - public @NotNull TableInfo getPlateTable(Container container, User user, @Nullable ContainerFilter cf) + private @NotNull TableInfo getPlateTable(Container container, User user, @Nullable ContainerFilter cf) { return getPlateUserSchema(container, user).getTableOrThrow(PlateTable.NAME, cf); } private @NotNull TableInfo getWellTable(Container container, User user) { - return getPlateUserSchema(container, user).getTableOrThrow(WellTable.NAME); + return getWellTable(container, user, null); + } + + private @NotNull TableInfo getWellTable(Container container, User user, @Nullable ContainerFilter cf) + { + return getPlateUserSchema(container, user).getTableOrThrow(WellTable.NAME, cf); } private @NotNull QueryUpdateService requiredUpdateService(@NotNull TableInfo table) @@ -3497,7 +3503,7 @@ public List getWellData(Container container, User user, int plateRowId if (includeSamples) columns.add(WellTable.Column.SampleID.name()); - var wellTable = getWellTable(container, user); + var wellTable = getWellTable(container, user, getPlateLookupContainerFilter(container, user)); var filter = new SimpleFilter(FieldKey.fromParts(WellTable.Column.PlateId.name()), plateRowId); var wellDatas = new TableSelector(wellTable, columns, filter, new Sort(WellTable.Column.RowId.name())).getArrayList(WellData.class); diff --git a/core/package-lock.json b/core/package-lock.json index 4c49ce1c06c..525b84a49a3 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -8,7 +8,7 @@ "name": "labkey-core", "version": "0.0.0", "dependencies": { - "@labkey/components": "5.22.2", + "@labkey/components": "5.22.9", "@labkey/themes": "1.4.0" }, "devDependencies": { @@ -3058,9 +3058,9 @@ } }, "node_modules/@labkey/components": { - "version": "5.22.2", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.2.tgz", - "integrity": "sha512-rx2Jzo/1l5axYrMWLuAjUQAlj+54moTsViuN6C8oezXEXKpmppSHeWGuDkqeTvsKyOc8SrAcxhA7D8b+qTp/yg==", + "version": "5.22.9", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.9.tgz", + "integrity": "sha512-YkXditiUaA3pqRIRBMs71XcDG32knRSDKXub/JHq4vNs1+giJQk76s1neJpxCMhPmOgQPC63VFYiRDUfiSOsEA==", "dependencies": { "@hello-pangea/dnd": "17.0.0", "@labkey/api": "1.36.0", diff --git a/core/package.json b/core/package.json index 844fbd58010..f8e33802ea1 100644 --- a/core/package.json +++ b/core/package.json @@ -54,7 +54,7 @@ } }, "dependencies": { - "@labkey/components": "5.22.2", + "@labkey/components": "5.22.9", "@labkey/themes": "1.4.0" }, "devDependencies": { diff --git a/experiment/package-lock.json b/experiment/package-lock.json index 35e3ebddaa7..345032a5c4a 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -8,11 +8,11 @@ "name": "experiment", "version": "0.0.0", "dependencies": { - "@labkey/components": "5.22.2" + "@labkey/components": "5.22.9" }, "devDependencies": { "@labkey/build": "8.3.0", - "@labkey/test": "1.7.0", + "@labkey/test": "1.7.1", "@types/jest": "29.5.14", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", @@ -2864,9 +2864,9 @@ } }, "node_modules/@labkey/components": { - "version": "5.22.2", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.2.tgz", - "integrity": "sha512-rx2Jzo/1l5axYrMWLuAjUQAlj+54moTsViuN6C8oezXEXKpmppSHeWGuDkqeTvsKyOc8SrAcxhA7D8b+qTp/yg==", + "version": "5.22.9", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.9.tgz", + "integrity": "sha512-YkXditiUaA3pqRIRBMs71XcDG32knRSDKXub/JHq4vNs1+giJQk76s1neJpxCMhPmOgQPC63VFYiRDUfiSOsEA==", "dependencies": { "@hello-pangea/dnd": "17.0.0", "@labkey/api": "1.36.0", @@ -2895,9 +2895,9 @@ } }, "node_modules/@labkey/test": { - "version": "1.7.0", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/test/-/@labkey/test-1.7.0.tgz", - "integrity": "sha512-VcpMMRasPwubtF2yID+9Ovz4rpuJWYk45XcONmkWA7CVQxGWy8NoYae8DDY4R8g7sNNaDSWWGG2nHs4lcXq45Q==", + "version": "1.7.1", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/test/-/@labkey/test-1.7.1.tgz", + "integrity": "sha512-74BDT3KB3NMCrsCzIScyIgOI9Q4IguOME71YJzU0o+nnxjuHChuHwUqj+1rEJm+nNzp4tbtp6g4vP3KiTFp3kg==", "dev": true, "dependencies": { "properties-reader": "2.3.0", diff --git a/experiment/package.json b/experiment/package.json index 066cd49bad3..dce2e4d008c 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -13,11 +13,11 @@ "test-integration": "cross-env NODE_ENV=test jest --ci --runInBand -c test/js/jest.config.integration.js" }, "dependencies": { - "@labkey/components": "5.22.2" + "@labkey/components": "5.22.9" }, "devDependencies": { "@labkey/build": "8.3.0", - "@labkey/test": "1.7.0", + "@labkey/test": "1.7.1", "@types/jest": "29.5.14", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", diff --git a/pipeline/package-lock.json b/pipeline/package-lock.json index e1bee736691..b63d29efbed 100644 --- a/pipeline/package-lock.json +++ b/pipeline/package-lock.json @@ -8,7 +8,7 @@ "name": "pipeline", "version": "0.0.0", "dependencies": { - "@labkey/components": "5.22.0" + "@labkey/components": "5.22.9" }, "devDependencies": { "@labkey/build": "8.3.0", @@ -2428,9 +2428,9 @@ } }, "node_modules/@labkey/components": { - "version": "5.22.0", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.0.tgz", - "integrity": "sha512-NcfAcnAMqEW6yf2OuDTxtg7mrFLvTGbTRubNQ1dXRi6DtDlLNY3QAPkuXXElUHlJxN2LFzaLL3hF1ZnBrffyNA==", + "version": "5.22.9", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-5.22.9.tgz", + "integrity": "sha512-YkXditiUaA3pqRIRBMs71XcDG32knRSDKXub/JHq4vNs1+giJQk76s1neJpxCMhPmOgQPC63VFYiRDUfiSOsEA==", "dependencies": { "@hello-pangea/dnd": "17.0.0", "@labkey/api": "1.36.0", diff --git a/pipeline/package.json b/pipeline/package.json index 7cb7f2a91b3..25a59f9c964 100644 --- a/pipeline/package.json +++ b/pipeline/package.json @@ -14,7 +14,7 @@ "build-prod": "npm run clean && cross-env NODE_ENV=production PROD_SOURCE_MAP=source-map webpack --config node_modules/@labkey/build/webpack/prod.config.js --color --progress --profile" }, "dependencies": { - "@labkey/components": "5.22.0" + "@labkey/components": "5.22.9" }, "devDependencies": { "@labkey/build": "8.3.0",