From 1f76858a6b0403f0f35b80bef1764cb2b20b92c1 Mon Sep 17 00:00:00 2001 From: Andrew Polk Date: Tue, 18 Jul 2023 16:32:29 -0700 Subject: [PATCH] Fix leveledReaderLevel filter (BL-12551) --- src/IFilter.ts | 2 ++ src/components/Grid/GridColumns.tsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/IFilter.ts b/src/IFilter.ts index 48e2167d..fe08f007 100644 --- a/src/IFilter.ts +++ b/src/IFilter.ts @@ -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; } diff --git a/src/components/Grid/GridColumns.tsx b/src/components/Grid/GridColumns.tsx index e90e9215..f2ef5084 100644 --- a/src/components/Grid/GridColumns.tsx +++ b/src/components/Grid/GridColumns.tsx @@ -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; }, }, {