Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: data column in SQL lab left panel open by default #13624

Merged
merged 4 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superset-frontend/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ export function addTable(query, tableName, schemaName) {
...table,
isMetadataLoading: true,
isExtraMetadataLoading: true,
expanded: false,
expanded: true,
}),
);

Expand Down
7 changes: 5 additions & 2 deletions superset-frontend/src/SqlLab/components/SqlEditorLeftBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ export default class SqlEditorLeftBar extends React.PureComponent {
<StyledScrollbarContainer>
<StyledScrollbarContent contentHeight={tableMetaDataHeight}>
<Collapse
ghost
expandIconPosition="right"
activeKey={this.props.tables
.filter(({ expanded }) => expanded)
.map(({ id }) => id)}
Comment on lines +151 to +152
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love Javascript's object unpacking, it's really elegant.

css={theme => css`
.ant-collapse-item {
margin-bottom: ${theme.gridUnit * 3}px;
Expand All @@ -169,6 +170,8 @@ export default class SqlEditorLeftBar extends React.PureComponent {
}
}
`}
expandIconPosition="right"
ghost
>
{this.props.tables.map(table => (
<TableElement
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/SqlLab/components/TableElement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class TableElement extends React.PureComponent {
{...this.props}
header={this.renderHeader()}
className="TableElement"
forceRender="true"
>
{this.renderBody()}
</Collapse.Panel>
Expand Down