Skip to content

Commit

Permalink
Wrap user-facing strings in header.tsx
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Ung <[email protected]>
  • Loading branch information
nung22 committed Oct 23, 2023
1 parent a7ce8f6 commit 38162ca
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,31 @@ exports[`Header component Renders header component 1`] = `
<h1
className="euiTitle euiTitle--medium"
>
Compare search results
<FormattedMessage
defaultMessage="Compare search results"
id="searchRelevance.header.title"
values={Object {}}
>
<span>
Compare search results
</span>
</FormattedMessage>
</h1>
</EuiTitle>
<EuiText>
<div
className="euiText euiText--medium"
>
<p>
Compare results using the same search text with different queries.
<FormattedMessage
defaultMessage="Compare results using the same search text with different queries."
id="searchRelevance.header.description"
values={Object {}}
>
<span>
Compare results using the same search text with different queries.
</span>
</FormattedMessage>
<EuiLink
href="https://opensearch.org/docs/latest/search-plugins/search-relevance"
Expand All @@ -36,7 +52,15 @@ exports[`Header component Renders header component 1`] = `
rel="noopener noreferrer"
target="_blank"
>
Learn more
<FormattedMessage
defaultMessage="Learn more"
id="searchRelevance.header.descriptionLink"
values={Object {}}
>
<span>
Learn more
</span>
</FormattedMessage>
<EuiIcon
aria-label="External link"
className="euiLink__externalIcon"
Expand Down
18 changes: 15 additions & 3 deletions public/components/common/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import React from 'react';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiText, EuiLink, EuiPanel, EuiTitle } from '@elastic/eui';

interface HeaderProps {
Expand All @@ -20,16 +21,27 @@ export const Header = ({ children }: HeaderProps) => {
borderRadius="none"
>
<EuiTitle>
<h1>Compare search results</h1>
<h1>
<FormattedMessage
id="searchRelevance.header.title"
defaultMessage="Compare search results"
/>
</h1>
</EuiTitle>
<EuiText>
<p>
Compare results using the same search text with different queries.{' '}
<FormattedMessage
id="searchRelevance.header.description"
defaultMessage="Compare results using the same search text with different queries."
/>{' '}
<EuiLink
href="https://opensearch.org/docs/latest/search-plugins/search-relevance"
target="_blank"
>
Learn more
<FormattedMessage
id="searchRelevance.header.descriptionLink"
defaultMessage="Learn more"
/>
</EuiLink>
</p>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,31 @@ exports[`Create index component Renders create index component 1`] = `
<h1
className="euiTitle euiTitle--medium"
>
Compare search results
<FormattedMessage
defaultMessage="Compare search results"
id="searchRelevance.header.title"
values={Object {}}
>
<span>
Compare search results
</span>
</FormattedMessage>
</h1>
</EuiTitle>
<EuiText>
<div
className="euiText euiText--medium"
>
<p>
Compare results using the same search text with different queries.
<FormattedMessage
defaultMessage="Compare results using the same search text with different queries."
id="searchRelevance.header.description"
values={Object {}}
>
<span>
Compare results using the same search text with different queries.
</span>
</FormattedMessage>
<EuiLink
href="https://opensearch.org/docs/latest/search-plugins/search-relevance"
Expand All @@ -37,7 +53,15 @@ exports[`Create index component Renders create index component 1`] = `
rel="noopener noreferrer"
target="_blank"
>
Learn more
<FormattedMessage
defaultMessage="Learn more"
id="searchRelevance.header.descriptionLink"
values={Object {}}
>
<span>
Learn more
</span>
</FormattedMessage>
<EuiIcon
aria-label="External link"
className="euiLink__externalIcon"
Expand Down

0 comments on commit 38162ca

Please sign in to comment.