Skip to content

Commit

Permalink
replace filters in adv search
Browse files Browse the repository at this point in the history
  • Loading branch information
charmingduchess committed Nov 1, 2023
1 parent 490bb87 commit 875be15
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pages/search/advanced.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ import type {
SearchFormActionType,
} from "../../src/types/searchTypes"
import { getQueryString } from "../../src/utils/searchUtils"

import ItemFilterContainer from "../../src/components/ItemFilters/FiltersContainer"
import testItemAggs from "../../src/components/ItemFilters/testAggregations"

/**
* The Advanced Search page is responsible for displaying the Advanced Search form fields and
Expand Down Expand Up @@ -123,6 +125,7 @@ export default function AdvancedSearch() {
}
/>
)}
<ItemFilterContainer itemAggs={testItemAggs} />
<Heading level="two">Advanced Search</Heading>
<Form
id="advancedSearchForm"
Expand Down
83 changes: 83 additions & 0 deletions src/components/ItemFilters/testAggregations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
const aggs = [
{
"@type": "nypl:Aggregation",
"@id": "res:location",
id: "location",
field: "location",
values: [
{
value: "loc:mal82",
count: 572,
label: "Schwarzman Building - Main Reading Room 315",
},
{
value: "loc:makk3",
count: 133,
label: "Schwarzman Building - Dewitt Wallace Reference Desk Room 108",
},
{
value: "loc:rc2ma",
count: 66,
label: "Offsite",
},
{
value: "loc:rcma2",
count: 66,
label: "Offsite",
},
],
},
{
"@type": "nypl:Aggregation",
"@id": "res:format",
id: "format",
field: "format",
values: [
{
value: "Text",
count: 704,
label: "Text",
},
{
value: "AUG. 23, 2021-CURRENT",
count: 109,
label: "AUG. 23, 2021-CURRENT",
},
{
value: "FEB. 15/22, 2021 - AUG. 16, 2021",
count: 24,
label: "FEB. 15/22, 2021 - AUG. 16, 2021",
},
],
},
{
"@type": "nypl:Aggregation",
"@id": "res:status",
id: "status",
field: "status",
values: [
{
value: "status:a",
count: 826,
label: "Available",
},
{
value: "status:na",
count: 6,
label: "Not available",
},
{
value: "status:co",
count: 4,
label: "Loaned",
},
{
value: "status:oh",
count: 1,
label: "On Holdshelf",
},
],
},
]

export default aggs

0 comments on commit 875be15

Please sign in to comment.