From ea0e8c01ded75c7ddd1817b1a56e134604ecf33f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:58:49 +0000 Subject: [PATCH] fix: TypeScript errors in new components - Fix potential undefined access in QueryBuilderTab - Fix unused variable in featureConfig test - Add proper undefined checks for array access Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- src/components/admin/QueryBuilderTab.tsx | 4 +++- src/utils/featureConfig.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/admin/QueryBuilderTab.tsx b/src/components/admin/QueryBuilderTab.tsx index ce7bded..b875675 100644 --- a/src/components/admin/QueryBuilderTab.tsx +++ b/src/components/admin/QueryBuilderTab.tsx @@ -108,7 +108,9 @@ export default function QueryBuilderTab({ value: string, ) => { const updated = [...whereConditions]; - updated[index][field] = value; + if (updated[index]) { + updated[index][field] = value; + } setWhereConditions(updated); }; diff --git a/src/utils/featureConfig.test.ts b/src/utils/featureConfig.test.ts index afe0cf5..45cc3de 100644 --- a/src/utils/featureConfig.test.ts +++ b/src/utils/featureConfig.test.ts @@ -90,8 +90,8 @@ describe('FeatureConfig', () => { it('should return undefined for disabled feature', () => { // This test assumes there might be disabled features in the config const features = getFeatures(); - const enabledIds = features.map(f => f.id); - + const _enabledIds = features.map(f => f.id); + // Try to get a feature that doesn't exist in enabled list const disabledFeature = getFeatureById('disabled-test-feature'); expect(disabledFeature).toBeUndefined();