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

Show expanded columns in gray in SQL Editor #7627

Merged
merged 5 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions superset/assets/src/SqlLab/components/ResultSet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ export default class ResultSet extends React.PureComponent {
data = results.data;
}
if (data && data.length > 0) {
const expandedColumns = results.expanded_columns
? results.expanded_columns.map(col => col.name)
: [];
return (
<React.Fragment>
{this.renderControls.bind(this)()}
Expand All @@ -216,6 +219,7 @@ export default class ResultSet extends React.PureComponent {
orderedColumnKeys={results.columns.map(col => col.name)}
height={height}
filterText={this.state.searchText}
expandedColumns={expandedColumns}
/>
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const propTypes = {
overscanRowCount: PropTypes.number,
rowHeight: PropTypes.number,
striped: PropTypes.bool,
expandedColumns: PropTypes.array,
};

const defaultProps = {
Expand All @@ -52,6 +53,7 @@ const defaultProps = {
overscanRowCount: 10,
rowHeight: 32,
striped: true,
expandedColumns: [],
};

export default class FilterableTable extends PureComponent {
Expand Down Expand Up @@ -141,7 +143,15 @@ export default class FilterableTable extends PureComponent {
return (
<TooltipWrapper label="header" tooltip={label}>
<div className="header-style">
{label}
<span
className={
this.props.expandedColumns.indexOf(label) > -1
? 'header-style-disabled'
: ''
}
>
{label}
</span>
{sortBy === dataKey &&
<SortIndicator sortDirection={sortDirection} />
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.header-style-disabled {
color: #aaa;
}