Skip to content

Commit

Permalink
[Lens] Remove visible title in workspace panel (#82234)
Browse files Browse the repository at this point in the history
  • Loading branch information
lykims authored Nov 5, 2020
1 parent bc05e79 commit 52e8d14
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ export function WorkspacePanel({
title={title}
framePublicAPI={framePublicAPI}
dispatch={dispatch}
emptyExpression={expression === null}
visualizationState={visualizationState}
visualizationId={activeVisualizationId}
datasourceStates={datasourceStates}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
position: relative; // For positioning the dnd overlay
min-height: $euiSizeXXL * 10;

.lnsWorkspacePanelWrapper__pageContentHeader {
@include euiTitle('xs');
padding: $euiSizeM;
// override EuiPage
margin-bottom: 0 !important; // sass-lint:disable-line no-important
}

.lnsWorkspacePanelWrapper__pageContentHeader--unsaved {
color: $euiTextSubduedColor;
}

.lnsWorkspacePanelWrapper__pageContentBody {
@include euiScrollBar;
flex-grow: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('workspace_panel_wrapper', () => {
visualizationMap={{ myVis: mockVisualization }}
datasourceMap={{}}
datasourceStates={{}}
emptyExpression={false}
>
<MyChild />
</WorkspacePanelWrapper>
Expand All @@ -58,7 +57,6 @@ describe('workspace_panel_wrapper', () => {
visualizationMap={{ myVis: { ...mockVisualization, renderToolbar: renderToolbarMock } }}
datasourceMap={{}}
datasourceStates={{}}
emptyExpression={false}
/>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import './workspace_panel_wrapper.scss';

import React, { useCallback } from 'react';
import { i18n } from '@kbn/i18n';
import classNames from 'classnames';
import {
EuiPageContent,
EuiPageContentBody,
EuiPageContentHeader,
EuiFlexGroup,
EuiFlexItem,
EuiScreenReaderOnly,
Expand All @@ -27,7 +25,6 @@ export interface WorkspacePanelWrapperProps {
framePublicAPI: FramePublicAPI;
visualizationState: unknown;
dispatch: (action: Action) => void;
emptyExpression: boolean;
title?: string;
visualizationMap: Record<string, Visualization>;
visualizationId: string | null;
Expand All @@ -47,7 +44,6 @@ export function WorkspacePanelWrapper({
visualizationState,
dispatch,
title,
emptyExpression,
visualizationId,
visualizationMap,
datasourceMap,
Expand Down Expand Up @@ -105,26 +101,12 @@ export function WorkspacePanelWrapper({
</EuiFlexGroup>
</div>
<EuiPageContent className="lnsWorkspacePanelWrapper">
{!emptyExpression || title ? (
<EuiPageContentHeader
className={classNames('lnsWorkspacePanelWrapper__pageContentHeader', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'lnsWorkspacePanelWrapper__pageContentHeader--unsaved': !title,
})}
>
<h1 data-test-subj="lns_ChartTitle">
{title ||
i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
</h1>
</EuiPageContentHeader>
) : (
<EuiScreenReaderOnly>
<h1 data-test-subj="lns_ChartTitle">
{title ||
i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
</h1>
</EuiScreenReaderOnly>
)}
<EuiScreenReaderOnly>
<h1 data-test-subj="lns_ChartTitle">
{title ||
i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
</h1>
</EuiScreenReaderOnly>
<EuiPageContentBody className="lnsWorkspacePanelWrapper__pageContentBody">
{children}
</EuiPageContentBody>
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/page_objects/lens_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
},

getTitle() {
return testSubjects.getVisibleText('lns_ChartTitle');
return testSubjects.getAttribute('lns_ChartTitle', 'innerText');
},

async getFiltersAggLabels() {
Expand Down

0 comments on commit 52e8d14

Please sign in to comment.