bito-code-review[bot] commented on code in PR #39257:
URL: https://github.com/apache/superset/pull/39257#discussion_r4140358630
##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx:
##########
@@ -435,9 +456,16 @@ const StyledButtonWrapper = styled.span`
`;
const checkboxGenerator = (
- d: boolean,
- onChange: (value: boolean) => void,
-): ReactNode => <CheckboxControl value={d} onChange={onChange} />;
+ d: unknown,
+ onChange: (value: unknown) => void,
+): ReactNode => (
Review Comment:
<!-- Bito Reply -->
The suggestion to revert the type widening is based on the concern that
using `unknown` bypasses the type contract expected by `CheckboxControl`.
However, as you noted, `itemRenderers` requires a uniform signature for all
renderers in the map, and `CheckboxControl` handles the coerced value correctly
at runtime. Given that the current implementation maintains runtime safety
while satisfying the required interface contract, the suggestion can be
considered addressed.
##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx:
##########
@@ -741,6 +784,18 @@ function ColumnCollectionTable({
</StyledLabelWrapper>
),
type: d => (d ? <Label>{String(d)}</Label> : null),
+ expression: (v, onChange) => (
+ <TextAreaControl
+ initialValue={v as string}
+ onChange={onChange}
+ extraClasses={['datasource-sql-expression']}
+ language="sql"
+ offerEditInModal={false}
+ minLines={5}
+ textAreaStyles={{ minWidth: '100%', maxWidth: 'none' }}
+ resize="both"
+ />
+ ),
Review Comment:
<!-- Bito Reply -->
The user's update to use `className` directly is a valid approach for
applying styles to the `TextAreaControl` component. Since `restProps` correctly
forwards the `className` to the underlying editor, the CSS rule will be applied
as intended. No further action is required for this specific point.
--
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]