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

[Look&Feel] Use semantic headers for page, modal, & flyouts across the board #7616

Merged
Merged
Show file tree
Hide file tree
Changes from 6 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: 2 additions & 0 deletions changelogs/fragments/7616.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Refactor:
- [Look&Feel] Use semantic headers for page, modal, & flyouts across the board ([#7616](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7616))

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { FormattedMessage } from '@osd/i18n/react';

export const PageTitle = () => {
return (
<EuiText>
<EuiText size="s">
<h1 data-test-subj="managementSettingsTitle">
<FormattedMessage id="advancedSettings.pageTitle" defaultMessage="Settings" />
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React from 'react';

import { EuiSpacer, EuiTitle, EuiText, EuiFlexItem, EuiFlexGroup } from '@elastic/eui';
import { EuiSpacer, EuiText, EuiFlexItem, EuiFlexGroup } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import { useOpenSearchDashboards } from '../../../../../../opensearch_dashboards_react/public';
Expand All @@ -25,7 +25,7 @@ export const Header = () => {
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<div>
<EuiTitle>
<EuiText size="s">
<h1 data-test-subj="createDataSourceHeader">
{
<FormattedMessage
Expand All @@ -34,7 +34,7 @@ export const Header = () => {
/>
}
</h1>
</EuiTitle>
</EuiText>
<EuiSpacer size="s" />
<EuiText>
<p>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import { CreateDataSourcePanelHeader } from './create_data_source_panel_header';
import { EuiFlexGroup, EuiTitle, EuiText } from '@elastic/eui';
import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';

describe('CreateDataSourcePanelHeader', () => {
Expand All @@ -20,11 +20,11 @@ describe('CreateDataSourcePanelHeader', () => {
test('contains correct title and description', () => {
const wrapper = shallowComponent();

const titleMessage = wrapper.find(EuiTitle).find(FormattedMessage);
const titleMessage = wrapper.find(EuiText).at(0).find(FormattedMessage);
expect(titleMessage.prop('id')).toEqual('dataSourcesManagement.createDataSourcePanel.title');
expect(titleMessage.prop('defaultMessage')).toEqual('Create Data Source');

const descriptionMessage = wrapper.find(EuiText).find(FormattedMessage);
const descriptionMessage = wrapper.find(EuiText).at(1).find(FormattedMessage);
expect(descriptionMessage.prop('id')).toEqual(
'dataSourcesManagement.createDataSourcePanel.description'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui';
import React from 'react';
import { FormattedMessage } from '@osd/i18n/react';

export const CreateDataSourcePanelHeader: React.FC = () => {
return (
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h2>
<EuiText size="s">
<h1>
Copy link
Collaborator

Choose a reason for hiding this comment

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

why did this change to an h1? is this the title of the page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's the create data source page :
Screenshot 2024-08-05 at 2 52 10 PM
Screenshot 2024-08-05 at 2 52 38 PM

<FormattedMessage
id="dataSourcesManagement.createDataSourcePanel.title"
defaultMessage="Create Data Source"
/>
</h2>
</EuiTitle>
</h1>
</EuiText>
<EuiSpacer size="s" />
<EuiText>
<p>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import { DataSourceHeader } from './data_source_page_header';
import { EuiTitle, EuiText } from '@elastic/eui';
import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';

describe('DataSourceHeader', () => {
Expand All @@ -25,12 +25,11 @@ describe('DataSourceHeader', () => {

test('contains correct title and description', () => {
const wrapper = shallowComponent();

const titleMessage = wrapper.find(EuiTitle).find(FormattedMessage);
const titleMessage = wrapper.find(EuiText).at(0).find(FormattedMessage);
expect(titleMessage.prop('id')).toEqual('dataSourcesManagement.dataSourcesTable.title');
expect(titleMessage.prop('defaultMessage')).toEqual('Data Sources');

const descriptionMessage = wrapper.find(EuiText).find(FormattedMessage);
const descriptionMessage = wrapper.find(EuiText).at(1).find(FormattedMessage);
expect(descriptionMessage.prop('id')).toEqual(
'dataSourcesManagement.dataSourcesTable.description'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui';
import React from 'react';
import { FormattedMessage } from '@osd/i18n/react';
import { RouteComponentProps } from 'react-router-dom';
Expand All @@ -14,14 +14,14 @@ export const DataSourceHeader: React.FC<DataSourceHeaderProps> = () => {
return (
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h2>
<EuiText size="s">
<h1>
Copy link
Collaborator

Choose a reason for hiding this comment

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

same for this one (assuming its just the page title)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, also the title of Data Sources page
Screenshot 2024-08-05 at 2 53 23 PM

<FormattedMessage
id="dataSourcesManagement.dataSourcesTable.title"
defaultMessage="Data Sources"
/>
</h2>
</EuiTitle>
</h1>
</EuiText>
<EuiSpacer size="s" />
<EuiText>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {
EuiLink,
EuiPageHeader,
EuiPageHeaderSection,
EuiSpacer,
EuiText,
EuiTitle,
} from '@elastic/eui';
import { EuiLink, EuiPageHeader, EuiPageHeaderSection, EuiSpacer, EuiText } from '@elastic/eui';
import React from 'react';
import { OPENSEARCH_ACC_DOCUMENTATION_URL } from '../../../constants';

Expand All @@ -19,9 +12,9 @@ export const CreateAccelerationHeader = () => {
<div>
<EuiPageHeader>
<EuiPageHeaderSection>
<EuiTitle size="l" data-test-subj="acceleration-header">
<EuiText size="s" data-test-subj="acceleration-header">
<h1>Accelerate data</h1>
</EuiTitle>
</EuiText>
</EuiPageHeaderSection>
</EuiPageHeader>
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
EuiPageHeaderSection,
EuiFlexGroup,
EuiFlexItem,
EuiTitle,
EuiPanel,
EuiSpacer,
EuiText,
Expand Down Expand Up @@ -434,9 +433,9 @@ export const DirectQueryDataConnectionDetail: React.FC<DirectQueryDataConnection
<EuiPageHeaderSection style={{ width: '100%', justifyContent: 'space-between' }}>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiTitle data-test-subj="datasourceTitle" size="l">
<EuiText data-test-subj="datasourceTitle" size="s">
<h1>{datasourceDetails.name}</h1>
</EuiTitle>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageHeaderSection>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export const ConfigureS3DatasourcePanel: React.FC<ConfigureS3DatasourceProps> =
return (
<div>
<EuiPanel>
<EuiTitle>
<EuiText size="s">
<h1>{`Configure Amazon S3 data source`}</h1>
</EuiTitle>
</EuiText>
<EuiSpacer size="s" />
<EuiCallOut title="Setup Amazon EMR as execution engine first" iconType="iInCircle">
<EuiText size="s" color="subdued">
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import {
EuiPanel,
EuiTitle,
EuiSpacer,
EuiText,
EuiLink,
Expand Down Expand Up @@ -88,9 +87,9 @@ export const ConfigurePrometheusDatasourcePanel = (props: ConfigurePrometheusDat
return (
<div>
<EuiPanel>
<EuiTitle>
<h4>{`Configure Prometheus data source`}</h4>
</EuiTitle>
<EuiText size="s">
<h1>{`Configure Prometheus data source`}</h1>
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this a page title?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the title of this page for creating a Prometheus data source:
Screenshot 2024-08-05 at 2 53 47 PM

</EuiText>
<EuiSpacer size="s" />
<EuiText size="s" color="subdued">
{`Connect to Prometheus with OpenSearch and OpenSearch Dashboards. `}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import {
EuiPanel,
EuiTitle,
EuiSpacer,
EuiText,
EuiFlexGroup,
Expand Down Expand Up @@ -41,9 +40,9 @@ export const ReviewPrometheusDatasource = (props: ConfigurePrometheusDatasourceP
return (
<div>
<EuiPanel>
<EuiTitle>
<EuiText size="s">
<h1 data-test-subj="reviewTitle">{`Review Prometheus data source configuration`}</h1>
</EuiTitle>
</EuiText>
<EuiSpacer size="s" />
<EuiSpacer />
<EuiFlexGroup justifyContent="spaceBetween">
Expand Down
Loading
Loading