From ecd8d83aae2b91883c64a1776f15e5a205b8352c Mon Sep 17 00:00:00 2001 From: Brandon Andre Date: Thu, 23 Nov 2023 13:29:21 -0500 Subject: [PATCH] Revert "Support #32267 - Saved search doesn't remember the group" This reverts commit dfc4c5423f4a42fef3d52b589197627da0afb10b. --- .../components/storage/StorageFilter.tsx | 17 +++++++---------- .../__tests__/BrowseStorageTree.test.tsx | 6 +++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/packages/dina-ui/components/storage/StorageFilter.tsx b/packages/dina-ui/components/storage/StorageFilter.tsx index 466169005f..af894c3d07 100644 --- a/packages/dina-ui/components/storage/StorageFilter.tsx +++ b/packages/dina-ui/components/storage/StorageFilter.tsx @@ -63,19 +63,16 @@ export function StorageFilter({ onChange }: StorageFilterProps) { ] : []), ...(groupNames - ? [ - { - id: -1234, + ? groupNames.map((group, index) => { + return { + id: -index, type: "FILTER_ROW" as const, + attribute: "group", predicate: "IS" as const, searchType: "EXACT_MATCH" as const, - value: groupNames.join(","), - attribute: { - allowRange: true, - name: "group" - } - } - ] + value: group + }; + }) : []) ] }); diff --git a/packages/dina-ui/components/storage/__tests__/BrowseStorageTree.test.tsx b/packages/dina-ui/components/storage/__tests__/BrowseStorageTree.test.tsx index 62c029ca29..9d85e719a6 100644 --- a/packages/dina-ui/components/storage/__tests__/BrowseStorageTree.test.tsx +++ b/packages/dina-ui/components/storage/__tests__/BrowseStorageTree.test.tsx @@ -77,7 +77,7 @@ const mockGet = jest.fn(async (path, params = {}) => { case "collection-api/storage-unit": if ( params.filter?.parentStorageUnit === null || - params.filter?.rsql === "group=in=(aafc,cnc)" + params.filter?.rsql === "group==aafc;group==cnc" ) { // Top-level units: return { data: [STORAGE_A], meta: { totalResourceCount: 1 } }; @@ -158,7 +158,7 @@ describe("BrowseStorageTree component", () => { // With no filter, gets the top-level units: expect(mockGet).lastCalledWith("collection-api/storage-unit", { filter: { - rsql: "group=in=(aafc,cnc)" + rsql: "group==aafc;group==cnc" }, include: "storageUnitChildren,storageUnitType", page: { @@ -179,7 +179,7 @@ describe("BrowseStorageTree component", () => { // With a filter, gets units from any level matching the search text: expect(mockGet).lastCalledWith("collection-api/storage-unit", { filter: { - rsql: "name==*test-search-text*;group=in=(aafc,cnc)" + rsql: "name==*test-search-text*;group==aafc;group==cnc" }, include: "storageUnitChildren,storageUnitType", page: {