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: Restructure chart header to wrap nicely #11643

Merged
merged 1 commit into from
Nov 12, 2020
Merged
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
96 changes: 51 additions & 45 deletions superset-frontend/src/explore/components/ExploreChartHeader.jsx
Original file line number Diff line number Diff line change
@@ -60,17 +60,21 @@ const StyledHeader = styled.div`
flex-direction: row;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;

span[role='button'] {
display: flex;
height: 100%;
}

.title-panel {
display: flex;
align-items: center;
}

.right-button-panel {
display: flex;
flex: 1 1 auto;
align-items: center;
justify-content: flex-end;

> .btn-group {
flex: 0 0 auto;
@@ -132,50 +136,52 @@ export class ExploreChartHeader extends React.PureComponent {
this.props.chart.chartStatus,
);
return (
<StyledHeader id="slice-header" className="clearfix panel-title-large">
<EditableTitle
title={this.getSliceName()}
canEdit={!this.props.slice || this.props.can_overwrite}
onSaveTitle={this.props.actions.updateChartTitle}
/>

{this.props.slice && (
<StyledButtons>
<FaveStar
itemId={this.props.slice.slice_id}
fetchFaveStar={this.props.actions.fetchFaveStar}
saveFaveStar={this.props.actions.saveFaveStar}
isStarred={this.props.isStarred}
showTooltip
/>
<PropertiesModal
show={this.state.isPropertiesModalOpen}
onHide={this.closePropertiesModal}
onSave={this.props.sliceUpdated}
slice={this.props.slice}
/>
<TooltipWrapper
label="edit-desc"
tooltip={t('Edit chart properties')}
>
<span
role="button"
tabIndex={0}
className="edit-desc-icon"
onClick={this.openProperiesModal}
>
<i className="fa fa-edit" />
</span>
</TooltipWrapper>
</StyledButtons>
)}
{this.props.chart.sliceFormData && (
<AlteredSliceTag
className="altered"
origFormData={this.props.chart.sliceFormData}
currentFormData={formData}
<StyledHeader id="slice-header" className="panel-title-large">
<div className="title-panel">
<EditableTitle
title={this.getSliceName()}
canEdit={!this.props.slice || this.props.can_overwrite}
onSaveTitle={this.props.actions.updateChartTitle}
/>
)}

{this.props.slice && (
<StyledButtons>
<FaveStar
itemId={this.props.slice.slice_id}
fetchFaveStar={this.props.actions.fetchFaveStar}
saveFaveStar={this.props.actions.saveFaveStar}
isStarred={this.props.isStarred}
showTooltip
/>
<PropertiesModal
show={this.state.isPropertiesModalOpen}
onHide={this.closePropertiesModal}
onSave={this.props.sliceUpdated}
slice={this.props.slice}
/>
<TooltipWrapper
label="edit-desc"
tooltip={t('Edit chart properties')}
>
<span
role="button"
tabIndex={0}
className="edit-desc-icon"
onClick={this.openProperiesModal}
>
<i className="fa fa-edit" />
</span>
</TooltipWrapper>
{this.props.chart.sliceFormData && (
<AlteredSliceTag
className="altered"
origFormData={this.props.chart.sliceFormData}
currentFormData={formData}
/>
)}
</StyledButtons>
)}
</div>
<div className="right-button-panel">
{chartFinished && queryResponse && (
<RowCountLabel