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>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-08 12:58:49 +00:00
parent 3501d77289
commit ea0e8c01de
2 changed files with 5 additions and 3 deletions

View File

@@ -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);
};

View File

@@ -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();