From 1e980c3886701dc12c3b59e3ff29ceb44944da60 Mon Sep 17 00:00:00 2001 From: Palash Date: Thu, 23 Jun 2022 12:37:42 +0530 Subject: [PATCH] feat: condition is updated --- .../Filters/Panel/PanelBody/CommonCheckBox/index.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/container/Trace/Filters/Panel/PanelBody/CommonCheckBox/index.tsx b/frontend/src/container/Trace/Filters/Panel/PanelBody/CommonCheckBox/index.tsx index 29255ae549..440c9652a7 100644 --- a/frontend/src/container/Trace/Filters/Panel/PanelBody/CommonCheckBox/index.tsx +++ b/frontend/src/container/Trace/Filters/Panel/PanelBody/CommonCheckBox/index.tsx @@ -39,6 +39,10 @@ function CommonCheckBox(props: CommonCheckBoxProps): JSX.Element { }); }; + const isMoreButtonAvilable = Boolean( + numberOfFilters && statusObj.length > numberOfFilters, + ); + return ( <> {statusObj.length > 0 && ( @@ -62,13 +66,15 @@ function CommonCheckBox(props: CommonCheckBoxProps): JSX.Element { } return countA - countB; }) - .filter((_, index) => index < numberOfFilters) .filter((filter) => { if (searchFilter.length === 0) { return true; } - return filter.includes(searchFilter); + return filter + .toLocaleLowerCase() + .includes(searchFilter.toLocaleLowerCase()); }) + .filter((_, index) => index < numberOfFilters) .map((e) => ( ))} - {numberOfFilters && statusObj.length > numberOfFilters && ( + {isMoreButtonAvilable && (