rusackas commented on code in PR #39257:
URL: https://github.com/apache/superset/pull/39257#discussion_r4140358706
##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx:
##########
@@ -713,6 +744,18 @@ function ColumnCollectionTable({
),
type: d => (d ? <Label>{String(d)}</Label> : null),
advanced_data_type: d => <Label>{d as string}</Label>,
+ expression: (v, onChange) => (
+ <TextAreaControl
+ initialValue={v as string}
+ onChange={onChange}
+ className="datasource-sql-expression"
+ language="sql"
+ offerEditInModal={false}
+ minLines={5}
+ textAreaStyles={{ minWidth: '100%', maxWidth: 'none' }}
+ resize="both"
+ />
Review Comment:
Same issue as the other stale-reference thread, would rather land one fix
for both than duplicate it here.
##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx:
##########
@@ -561,32 +589,29 @@ function ColumnCollectionTable({
filterTerm,
filterFields,
}: ColumnCollectionTableProps): JSX.Element {
+ const tableColumns = isFeatureEnabled(FeatureFlag.EnableAdvancedDataTypes)
+ ? [
+ 'column_name',
+ ...(showExpression ? ['expression'] : []),
+ 'advanced_data_type',
+ 'type',
+ 'is_dttm',
+ 'filterable',
+ 'groupby',
+ ]
+ : [
+ 'column_name',
+ ...(showExpression ? ['expression'] : []),
+ 'type',
+ 'is_dttm',
+ 'filterable',
+ 'groupby',
+ ];
Review Comment:
Good call, collapsed it into one array with `advanced_data_type` spread in
conditionally instead of two near-identical literals (d57cb9459a7f).
##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx:
##########
@@ -769,6 +800,18 @@ function ColumnCollectionTable({
),
type: d => (d ? <Label>{String(d)}</Label> : null),
advanced_data_type: d => <Label>{d as string}</Label>,
+ expression: (v, onChange) => (
+ <TextAreaControl
+ initialValue={v as string}
+ onChange={onChange}
+ className="datasource-sql-expression"
+ language="sql"
+ offerEditInModal={false}
+ minLines={5}
+ textAreaStyles={{ minWidth: '100%', maxWidth: 'none' }}
+ resize="both"
+ />
+ ),
Review Comment:
Yeah, that was copy-pasted, pulled it into one `renderExpressionCell` so
both branches share it (d57cb9459a7f).
--
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]