geido commented on code in PR #30730:
URL: https://github.com/apache/superset/pull/30730#discussion_r1820954161
##########
superset-frontend/src/components/Chart/DrillBy/DrillByMenuItems.tsx:
##########
@@ -138,10 +138,9 @@ export const DrillByMenuItems = ({
useEffect(() => {
if (open) {
- ref.current?.input.focus({ preventScroll: true });
+ ref.current?.input?.focus({ preventScroll: true });
} else {
// Reset search input when menu is closed
- ref.current?.setValue('');
Review Comment:
We don't need this anymore? It seems unrelated to the upgrade
##########
superset-frontend/src/explore/components/controls/BoundsControl.test.jsx:
##########
@@ -34,7 +34,8 @@ test('renders two inputs', () => {
test('receives null on non-numeric', async () => {
render(<BoundsControl {...defaultProps} />);
const minInput = screen.getAllByRole('spinbutton')[0];
- userEvent.type(minInput, 'text');
+ userEvent.type(minInput, '1');
+ userEvent.clear(minInput);
Review Comment:
I think this will be giving a false positive for this test?
##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -983,8 +983,15 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
}
};
- const onCustomWidthChange = (value: number | null | undefined) => {
- updateAlertState('custom_width', value);
+ const onCustomWidthChange = (value: number | string | null | undefined) => {
+ // Convert string to number if needed and handle empty/invalid values
+ const numValue =
+ value === undefined || value === ''
+ ? undefined
+ : typeof value === 'string'
+ ? Number(value) || null
Review Comment:
Why are we defaulting to `null` here? What happens if value is '0'?
##########
superset-frontend/src/components/Chart/DrillBy/DrillByMenuItems.tsx:
##########
@@ -311,6 +310,7 @@ export const DrillByMenuItems = ({
margin: ${theme.gridUnit * 2}px ${theme.gridUnit * 3}px;
box-shadow: none;
`}
+ value={searchInput}
Review Comment:
Same for this. It seems unrelated to the upgrade? What is this for?
##########
superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx:
##########
@@ -51,17 +51,15 @@ export const AlertReportCronScheduler:
FC<AlertReportCronSchedulerProps> = ({
onChange,
}) => {
const theme = useTheme();
- const inputRef = useRef<AntdInput>(null);
Review Comment:
Is this not necessary after the upgrade?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]