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

[fleet] Tweak Header UI #114704

Merged
merged 5 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
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,6 +26,7 @@ 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-getting-started/${DOC_LINK_VERSION}/`;

return deepFreeze({
DOC_LINK_VERSION,
Expand Down Expand Up @@ -477,6 +478,7 @@ export class DocLinksService {
upgradeElasticAgent: `${FLEET_DOCS}upgrade-elastic-agent.html`,
upgradeElasticAgent712lower: `${FLEET_DOCS}upgrade-elastic-agent.html#upgrade-7.12-lower`,
learnMoreBlog: `${ELASTIC_WEBSITE_URL}blog/elastic-agent-and-fleet-make-it-easier-to-integrate-your-systems-with-elastic`,
elasticStackGetStarted: `${STACK_GETTING_STARTED}get-started-elastic-stack.html`,
Copy link
Member

Choose a reason for hiding this comment

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

nit: I might consider moving this out of fleet since it isn't specific to that domain. Maybe just a top level links.stackGettingStarted or similar.

},
ecs: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/ecs/current/index.html`,
Expand Down Expand Up @@ -732,6 +734,7 @@ export interface DocLinksStart {
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
elasticStackGetStarted: string;
}>;
readonly ecs: {
readonly guide: 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.fleet.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 @@ -13,6 +13,8 @@ export const getDocLinks = () => {
fleet: {
learnMoreBlog:
'https://www.elastic.co/blog/elastic-agent-and-fleet-make-it-easier-to-integrate-your-systems-with-elastic',
elasticStackGetStarted:
'https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-elastic-stack.html',
},
},
} as unknown as DocLinksStart;
Expand Down