Skip to content

Commit

Permalink
Merge pull request BloomBooks#507 from BloomBooks/BL12551_FixLRFilter
Browse files Browse the repository at this point in the history
Fix leveledReaderLevel filter (BL-12551)
  • Loading branch information
hatton authored Jul 19, 2023
2 parents d3c1e6c + 1f76858 commit 3287975
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/IFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ export interface IFilter {
// BL-10865. Controls whether we include books that are marked as being exact duplicates except for branding.
// Can be true (only rebrands), false (no rebrands), or "all", which means ignore that property.
rebrand?: BooleanOptions;

leveledReaderLevel?: number;
}
3 changes: 2 additions & 1 deletion src/components/Grid/GridColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ export function getBookGridColumnsDefinitions(): IGridColumn[] {
defaultVisible: false,
sortingEnabled: true,
addToFilter: (filter: IFilter, value: string) => {
filter.search += ` leveledReaderLevel:${value}`;
const num = parseFloat(value);
if (Number.isInteger(num)) filter.leveledReaderLevel = num;
},
},
{
Expand Down

0 comments on commit 3287975

Please sign in to comment.