Skip to content

Commit

Permalink
feat: add exemption reason filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushnirwal committed Jun 18, 2024
1 parent 36bc786 commit 5220a9c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/cli-dashboard/src/hooks/useCookieListing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
calculateDynamicFilterValues,
evaluateSelectAllOption,
evaluateStaticFilterValues,
calculateExemptionReason,
} from '@ps-analysis-tool/design-system';
import { type CookieTableData } from '@ps-analysis-tool/common';

Expand Down Expand Up @@ -316,6 +317,26 @@ const useCookieListing = (
return (value as string[])?.includes(filterValue);
},
},
exemptionReason: {
title: 'Exemption Reason',
hasStaticFilterValues: true,
hasPrecalculatedFilterValues: true,
enableSelectAllOption: true,
isSelectAllOptionSelected: evaluateSelectAllOption(
'exemptionReason',
parsedQuery
),
filterValues: calculateExemptionReason(
tabCookies,
clearActivePanelQuery,
parsedQuery?.filter?.exemptionReason
),
comparator: (value: InfoType, filterValue: string) => {
const val = value as string;
return val === filterValue;
},
useGenericPersistenceKey: true,
},
}),
[clearActivePanelQuery, parsedQuery, tabCookies]
);
Expand Down

0 comments on commit 5220a9c

Please sign in to comment.