Skip to content

Commit

Permalink
[fleet] Tweak Header UI (#114704) (#115079)
Browse files Browse the repository at this point in the history
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
  • Loading branch information
thomasneirynck and clintandrewhall authored Oct 14, 2021
1 parent 6f57fcd commit 328b69d
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
```typescript
readonly links: {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
Expand Down

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ export class DocLinksService {
const PLUGIN_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`;
const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`;
const SECURITY_SOLUTION_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/`;
const STACK_GETTING_STARTED = `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack-get-started/${DOC_LINK_VERSION}/`;

return deepFreeze({
DOC_LINK_VERSION,
ELASTIC_WEBSITE_URL,
links: {
settings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/settings.html`,
elasticStackGetStarted: `${STACK_GETTING_STARTED}get-started-elastic-stack.html`,
apm: {
kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`,
supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`,
Expand Down Expand Up @@ -515,6 +517,7 @@ export interface DocLinksStart {
readonly ELASTIC_WEBSITE_URL: string;
readonly links: {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
Expand Down
1 change: 1 addition & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ export interface DocLinksStart {
// (undocumented)
readonly links: {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/
import React, { memo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiImage, EuiSpacer, EuiText } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiImage, EuiSpacer, EuiText, EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { i18n } from '@kbn/i18n';
Expand All @@ -17,7 +17,7 @@ import type { EuiTheme } from 'src/plugins/kibana_react/common';
import { useLink } from '../../../hooks';
import type { Section } from '../sections';

import { useLinks } from '../hooks';
import { useLinks, useStartServices } from '../hooks';

import { WithHeaderLayout } from './';

Expand All @@ -27,10 +27,14 @@ interface Props {
}

const Illustration = styled(EuiImage)`
margin-bottom: -68px;
margin-bottom: -77px;
position: relative;
top: -20px;
width: 80%;
top: -16px;
width: 395px;
`;

const Hero = styled.div`
text-align: right;
`;

const HeroImage = memo(() => {
Expand All @@ -39,21 +43,24 @@ const HeroImage = memo(() => {
const IS_DARK_THEME = theme.darkMode;

return (
<Illustration
alt={i18n.translate('xpack.fleet.epm.illustrationAltText', {
defaultMessage: 'Illustration of an integration',
})}
url={
IS_DARK_THEME
? toSharedAssets('illustration_integrations_darkmode.svg')
: toSharedAssets('illustration_integrations_lightmode.svg')
}
/>
<Hero>
<Illustration
alt={i18n.translate('xpack.fleet.epm.illustrationAltText', {
defaultMessage: 'Illustration of an integration',
})}
url={
IS_DARK_THEME
? toSharedAssets('illustration_integrations_darkmode.svg')
: toSharedAssets('illustration_integrations_lightmode.svg')
}
/>
</Hero>
);
});

export const DefaultLayout: React.FunctionComponent<Props> = memo(({ section, children }) => {
const { getHref } = useLink();
const { docLinks } = useStartServices();

return (
<WithHeaderLayout
Expand All @@ -64,7 +71,7 @@ export const DefaultLayout: React.FunctionComponent<Props> = memo(({ section, ch
<h1>
<FormattedMessage
id="xpack.fleet.integrationsHeaderTitle"
defaultMessage="Elastic Agent Integrations"
defaultMessage="Integrations"
/>
</h1>
</EuiText>
Expand All @@ -76,7 +83,16 @@ export const DefaultLayout: React.FunctionComponent<Props> = memo(({ section, ch
<p>
<FormattedMessage
id="xpack.fleet.epm.pageSubtitle"
defaultMessage="Collect data from popular apps and services using Elastic Agent"
defaultMessage="Collect data from popular applications and services. To learn more about Integrations, view {link}"
values={{
link: (
<EuiLink target="_blank" href={docLinks.links.elasticStackGetStarted}>
{i18n.translate('xpack.fleet.epm.pageSubtitleLinkText', {
defaultMessage: 'Getting started with Elastic Stack',
})}
</EuiLink>
),
}}
/>
</p>
</EuiText>
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/fleet/storybook/context/doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import type { DocLinksStart } from 'kibana/public';
export const getDocLinks = () => {
const docLinks: DocLinksStart = {
links: {
elasticStackGetStarted:
'https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-elastic-stack.html',
fleet: {
learnMoreBlog:
'https://www.elastic.co/blog/elastic-agent-and-fleet-make-it-easier-to-integrate-your-systems-with-elastic',
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -10869,7 +10869,6 @@
"xpack.fleet.epm.packageDetailsNav.packageCustomLinkText": "高度な設定",
"xpack.fleet.epm.packageDetailsNav.packagePoliciesLinkText": "ポリシー",
"xpack.fleet.epm.packageDetailsNav.settingsLinkText": "設定",
"xpack.fleet.epm.pageSubtitle": "Elasticエージェントを使用して一般的なアプリやサービスからデータを収集します",
"xpack.fleet.epm.releaseBadge.betaDescription": "この統合は本番環境用ではありません。",
"xpack.fleet.epm.releaseBadge.betaLabel": "ベータ",
"xpack.fleet.epm.releaseBadge.experimentalDescription": "この統合は、急に変更されたり、将来のリリースで削除されたりする可能性があります。",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -10984,7 +10984,6 @@
"xpack.fleet.epm.packageDetailsNav.packageCustomLinkText": "高级",
"xpack.fleet.epm.packageDetailsNav.packagePoliciesLinkText": "策略",
"xpack.fleet.epm.packageDetailsNav.settingsLinkText": "设置",
"xpack.fleet.epm.pageSubtitle": "使用 Elastic 代理从热门应用和服务中收集数据",
"xpack.fleet.epm.releaseBadge.betaDescription": "在生产环境中不推荐使用此集成。",
"xpack.fleet.epm.releaseBadge.betaLabel": "公测版",
"xpack.fleet.epm.releaseBadge.experimentalDescription": "此集成可能有重大更改或将在未来版本中移除。",
Expand Down

0 comments on commit 328b69d

Please sign in to comment.