Skip to content

Commit

Permalink
Columns tab name field no longer editable, calculated columns rows no…
Browse files Browse the repository at this point in the history
…w vertically aligned (#18164)
  • Loading branch information
lyndsiWilliams authored Jan 25, 2022
1 parent 9900e5a commit 2491b89
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
41 changes: 21 additions & 20 deletions superset-frontend/src/components/Datasource/DatasourceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,6 @@ class DatasourceEditor extends React.PureComponent {
</ColumnButtonWrapper>
<ColumnCollectionTable
className="columns-table"
editableColumnName
columns={this.state.databaseColumns}
datasource={datasource}
onColumnsChange={databaseColumns =>
Expand All @@ -1291,25 +1290,27 @@ class DatasourceEditor extends React.PureComponent {
}
key={3}
>
<ColumnCollectionTable
columns={this.state.calculatedColumns}
onColumnsChange={calculatedColumns =>
this.setColumns({ calculatedColumns })
}
onDatasourceChange={this.onDatasourceChange}
datasource={datasource}
editableColumnName
showExpression
allowAddItem
allowEditDataType
itemGenerator={() => ({
column_name: '<new column>',
filterable: true,
groupby: true,
expression: '<enter SQL expression here>',
__expanded: true,
})}
/>
<StyledColumnsTabWrapper>
<ColumnCollectionTable
columns={this.state.calculatedColumns}
onColumnsChange={calculatedColumns =>
this.setColumns({ calculatedColumns })
}
onDatasourceChange={this.onDatasourceChange}
datasource={datasource}
editableColumnName
showExpression
allowAddItem
allowEditDataType
itemGenerator={() => ({
column_name: '<new column>',
filterable: true,
groupby: true,
expression: '<enter SQL expression here>',
__expanded: true,
})}
/>
</StyledColumnsTabWrapper>
</Tabs.TabPane>
<Tabs.TabPane key={4} tab={t('Settings')}>
<Row gutter={16}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('DatasourceEditor', () => {
});
userEvent.click(getToggles[0]);
const getTextboxes = screen.getAllByRole('textbox');
expect(getTextboxes.length).toEqual(12);
expect(getTextboxes.length).toEqual(5);

const inputLabel = screen.getByPlaceholderText('Label');
const inputDescription = screen.getByPlaceholderText('Description');
Expand Down

0 comments on commit 2491b89

Please sign in to comment.