mirror of
https://github.com/apache/superset.git
synced 2026-05-29 20:29:34 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user