Skip to content

Commit

Permalink
fix Lens heading structure
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Oct 27, 2020
1 parent e6ab812 commit 9c173a0
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
EuiPageContentHeader,
EuiFlexGroup,
EuiFlexItem,
EuiScreenReaderOnly,
} from '@elastic/eui';
import { Datasource, FramePublicAPI, Visualization } from '../../../types';
import { NativeRenderer } from '../../../native_renderer';
Expand Down Expand Up @@ -104,18 +105,25 @@ export function WorkspacePanelWrapper({
</EuiFlexGroup>
</div>
<EuiPageContent className="lnsWorkspacePanelWrapper">
{(!emptyExpression || title) && (
{!emptyExpression || title ? (
<EuiPageContentHeader
className={classNames('lnsWorkspacePanelWrapper__pageContentHeader', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'lnsWorkspacePanelWrapper__pageContentHeader--unsaved': !title,
})}
>
<span data-test-subj="lns_ChartTitle">
<h1 data-test-subj="lns_ChartTitle">
{title ||
i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
</span>
</h1>
</EuiPageContentHeader>
) : (
<EuiScreenReaderOnly>
<h1 data-test-subj="lns_ChartTitle">
{title ||
i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
</h1>
</EuiScreenReaderOnly>
)}
<EuiPageContentBody className="lnsWorkspacePanelWrapper__pageContentBody">
{children}
Expand Down

0 comments on commit 9c173a0

Please sign in to comment.