fix(dashboard): resolve TS errors in risonFilters.ts

- Cast through `unknown` for the default-case comparator since `value`
  is narrowed to `object` in that branch
- Guard against `Partial<Filter>['id']` being optional when indexing
  `updatedDataMask`; fall back to the matched key

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Hugh A Miles II
2026-05-08 00:14:08 -04:00
parent 4d001c7d9c
commit 2aa44d83e1

View File

@@ -86,7 +86,7 @@ function parseFilterCondition(key: string, value: unknown): RisonFilter {
return {
subject: key,
operator: '==',
comparator: value as string | number,
comparator: value as unknown as string | number,
};
}
}
@@ -464,13 +464,14 @@ export function injectRisonFiltersIntelligently(
if (matchingFilterId) {
const matchedFilter = nativeFilters[matchingFilterId];
if (matchedFilter) {
const filterId = matchedFilter?.id ?? matchingFilterId;
if (matchedFilter && filterId) {
const columnName =
matchedFilter.targets?.[0]?.column?.name ?? risonFilter.subject;
const dataMaskEntry = buildDataMaskForFilter(
risonFilter,
matchedFilter as {
{ ...matchedFilter, id: filterId } as {
id: string;
filterType?: string;
targets?: { column?: { name?: string } }[];
@@ -478,8 +479,8 @@ export function injectRisonFiltersIntelligently(
columnName,
);
updatedDataMask[matchedFilter.id] = {
...updatedDataMask[matchedFilter.id],
updatedDataMask[filterId] = {
...updatedDataMask[filterId],
...dataMaskEntry,
};
return;