fix: Ensure drill-through chart field works consistently across CRUD and Explore paths

Fixes two issues with the drill-through chart configuration:

1. **SelectAsyncControl crash on clear**: Fixed isLabeledValue function to handle null values properly when clearing selections
2. **Missing field in Explore path**: Added drill_through_chart_id to both dataset API response and SqlaTable.data property serialization

This ensures the drill-through chart field loads and saves correctly whether accessed from:
- Datasets CRUD interface
- Explore → Edit Dataset flow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Maxime Beauchemin
2025-08-30 11:00:39 -07:00
parent a891ccdb10
commit 56152c2366
4 changed files with 15 additions and 1 deletions

View File

@@ -104,3 +104,15 @@ test('Should send correct props to Select component - function onChange multi:fa
userEvent.click(await screen.findByText('onChange'));
expect(props.onChange).toHaveBeenCalledTimes(1);
});
test('Should handle null value without crashing when clearing selection', () => {
const props = createProps();
const { rerender } = render(<SelectAsyncControl {...props} />, {
useRedux: true,
});
// Simulate clearing the selection by passing null value
expect(() => {
rerender(<SelectAsyncControl {...props} value={null} />);
}).not.toThrow();
});