From de0fb26609134f3810251cfc62f341f795341edb Mon Sep 17 00:00:00 2001 From: YANG QIA <2013xile@gmail.com> Date: Sat, 15 Jun 2024 13:35:27 +0800 Subject: [PATCH] fix(data-vi): custom filter conditions are not applied (#4671) * fix(data-vi): custom filter conditions are not applied * fix: default value --- .../plugin-data-visualization/src/client/hooks/filter.ts | 2 +- .../src/client/hooks/useVariableOptions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/filter.ts b/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/filter.ts index 1b23d1d271..846291c0e0 100644 --- a/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/filter.ts +++ b/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/filter.ts @@ -417,7 +417,7 @@ export const useChartFilter = () => { if (!(typeof value === 'string' && value.startsWith('{{$') && value?.endsWith('}}'))) { return value; } - if (['$user', '$date', '$nDate', '$nRole'].some((n) => value.includes(n))) { + if (['$user', '$date', '$nDate', '$nRole', '$nFilter'].some((n) => value.includes(n))) { return value; } const result = variables?.parseVariable(value); diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/useVariableOptions.ts b/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/useVariableOptions.ts index 957e1eb64c..cd6e57e5b7 100644 --- a/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/useVariableOptions.ts +++ b/packages/plugins/@nocobase/plugin-data-visualization/src/client/hooks/useVariableOptions.ts @@ -36,7 +36,7 @@ export const useGeneralVariableOptions = ( [datetimeSettings, currentUserSettings, currentRoleSettings, urlSearchParamsSettings], ); - if (!operator || !schema) return []; + if (!schema) return []; return result; };