Skip to content

Commit

Permalink
Merge pull request #568 from BloomBooks/BL13916_GridFilterLicense
Browse files Browse the repository at this point in the history
Allow grid to filter on license (BL-13916)
  • Loading branch information
hatton authored Sep 23, 2024
2 parents a240e5d + 03e85fb commit 1988642
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Grid/GridColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,13 @@ export function getBookGridColumnsDefinitions(): IGridColumn[] {
},
},

{ name: "license", sortingEnabled: true },
{
name: "license",
sortingEnabled: true,
addToFilter: (filter: IFilter, value: string) => {
filter.search += ` license:${value} `;
},
},
{
name: "copyright",
sortingEnabled: true,
Expand Down
2 changes: 2 additions & 0 deletions src/connection/LibraryQueryHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ const facets = [
"title:",
"uploader:",
"copyright:",
"license:",
"harvestState:",
"country:",
"phash:",
Expand Down Expand Up @@ -1218,6 +1219,7 @@ export function constructParseBookQuery(
switch (facetLabel) {
case "title":
case "copyright":
case "license":
case "country":
case "publisher":
case "originalPublisher":
Expand Down

0 comments on commit 1988642

Please sign in to comment.