Skip to content

Commit

Permalink
Fix non-i18n'd breadcrumb strings
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Aug 5, 2020
1 parent 6b1e8dc commit 7753d79
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export const SetupGuide: React.FC = () => (
standardAuthLink="https://swiftype.com/documentation/app-search/self-managed/security#standard"
elasticsearchNativeAuthLink="https://swiftype.com/documentation/app-search/self-managed/security#elasticsearch-native-realm"
>
<SetBreadcrumbs text="Setup Guide" />
<SetBreadcrumbs
text={i18n.translate('xpack.enterpriseSearch.setupGuide.title', {
defaultMessage: 'Setup Guide',
})}
/>
<SendTelemetry action="viewed" metric="setup_guide" />

<a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import { EuiBreadcrumb } from '@elastic/eui';
import { History } from 'history';

import {
ENTERPRISE_SEARCH_PLUGIN,
APP_SEARCH_PLUGIN,
WORKPLACE_SEARCH_PLUGIN,
} from '../../../../common/constants';

import { letBrowserHandleEvent } from '../react_router_helpers';

/**
Expand Down Expand Up @@ -44,14 +50,20 @@ export type TBreadcrumbs = IGenerateBreadcrumbProps[];
export const enterpriseSearchBreadcrumbs = (history: History) => (
breadcrumbs: TBreadcrumbs = []
) => [
generateBreadcrumb({ text: 'Enterprise Search' }),
generateBreadcrumb({ text: ENTERPRISE_SEARCH_PLUGIN.NAME }),
...breadcrumbs.map(({ text, path }: IGenerateBreadcrumbProps) =>
generateBreadcrumb({ text, path, history })
),
];

export const appSearchBreadcrumbs = (history: History) => (breadcrumbs: TBreadcrumbs = []) =>
enterpriseSearchBreadcrumbs(history)([{ text: 'App Search', path: '/' }, ...breadcrumbs]);
enterpriseSearchBreadcrumbs(history)([
{ text: APP_SEARCH_PLUGIN.NAME, path: '/' },
...breadcrumbs,
]);

export const workplaceSearchBreadcrumbs = (history: History) => (breadcrumbs: TBreadcrumbs = []) =>
enterpriseSearchBreadcrumbs(history)([{ text: 'Workplace Search', path: '/' }, ...breadcrumbs]);
enterpriseSearchBreadcrumbs(history)([
{ text: WORKPLACE_SEARCH_PLUGIN.NAME, path: '/' },
...breadcrumbs,
]);
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export const SetupGuide: React.FC = () => {
standardAuthLink="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-security.html#standard"
elasticsearchNativeAuthLink="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-security.html#elasticsearch-native-realm"
>
<SetBreadcrumbs text="Setup Guide" />
<SetBreadcrumbs
text={i18n.translate('xpack.enterpriseSearch.setupGuide.title', {
defaultMessage: 'Setup Guide',
})}
/>
<SendTelemetry action="viewed" metric="setup_guide" />

<a href={GETTING_STARTED_LINK_URL} target="_blank" rel="noopener noreferrer">
Expand Down

0 comments on commit 7753d79

Please sign in to comment.