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

[Onboarding][Auto-detect] Update design for supported integrations badges #195351

Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import {
EuiCodeBlock,
EuiSpacer,
EuiSkeletonText,
EuiBadge,
EuiFlexGroup,
EuiFlexItem,
EuiText,
useGeneratedHtmlId,
EuiIcon,
Expand All @@ -38,6 +35,7 @@ import { isSupportedLogo, LogoIcon } from '../../shared/logo_icon';
import { FeedbackButtons } from '../shared/feedback_buttons';
import { ObservabilityOnboardingContextValue } from '../../../plugin';
import { useAutoDetectTelemetry } from './use_auto_detect_telemetry';
import { SupportedIntegrationsList } from './supported_integrations_list';

export const AutoDetectPanel: FunctionComponent = () => {
const { status, data, error, refetch, installedIntegrations } = useOnboardingFlow();
Expand Down Expand Up @@ -92,28 +90,7 @@ export const AutoDetectPanel: FunctionComponent = () => {
</p>
</EuiText>
<EuiSpacer size="s" />
<EuiFlexGroup gutterSize="s">
{[
'Apache',
'Docker',
'Nginx',
'System',
'MySQL',
'PostgreSQL',
'Redis',
'HAProxy',
'Kafka',
'RabbitMQ',
'Prometheus',
'Tomcat',
'MongoDB',
'Custom .log files',
].map((item) => (
<EuiFlexItem key={item} grow={false}>
<EuiBadge color="hollow">{item}</EuiBadge>
</EuiFlexItem>
))}
</EuiFlexGroup>
<SupportedIntegrationsList />
<EuiSpacer />
{/* Bash syntax highlighting only highlights a few random numbers (badly) so it looks less messy to go with plain text */}
<EuiCodeBlock paddingSize="m" language="text">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import {
EuiBadge,
EuiFlexGroup,
EuiFlexItem,
EuiText,
EuiTextColor,
EuiToolTip,
IconType,
useEuiTheme,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import apacheIconSrc from '../../../assets/apache.svg';
import dockerIconSrc from '../../../assets/docker.svg';
import nginxIconSrc from '../../../assets/nginx.svg';
import mysqlIconSrc from '../../../assets/mysql.svg';

const SUPPORTED_INTEGRATIONS_LIST = [
'Apache',
'Docker',
'Nginx',
'System',
'MySQL',
'PostgreSQL',
'Redis',
'Haproxy',
'Kafka',
'RabbitMQ',
'Prometheus',
'Apache Tomcat',
'MongoDB',
] as const;

type SupportedIntegrationName = (typeof SUPPORTED_INTEGRATIONS_LIST)[number];

interface SupportedIntegrationItem {
title: SupportedIntegrationName;
icon: IconType;
}

const FEATURED_INTEGRATIONS_LIST: SupportedIntegrationItem[] = [
{ title: 'Apache', icon: apacheIconSrc },
{ title: 'Docker', icon: dockerIconSrc },
{ title: 'Nginx', icon: nginxIconSrc },
{ title: 'MySQL', icon: mysqlIconSrc },
{ title: 'System', icon: 'desktop' },
];

export function SupportedIntegrationsList() {
const {
euiTheme: { colors },
} = useEuiTheme();
const customLogFilesTitle = i18n.translate(
'xpack.observability_onboarding.autoDetectPanel.supportedIntegrationsList.customIntegrationTitle',
{ defaultMessage: 'Custom .log files' }
);
return (
<EuiFlexGroup gutterSize="s" responsive={false} css={{ flexWrap: 'wrap' }}>
{FEATURED_INTEGRATIONS_LIST.map(({ title, icon }) => (
<EuiFlexItem grow={false}>
<EuiBadge iconType={icon} color="hollow" key={title}>
{title}
</EuiBadge>
</EuiFlexItem>
))}

<EuiBadge iconType="documents" color="hollow">
{customLogFilesTitle}
</EuiBadge>

<EuiToolTip
content={
<EuiText size="s">
<ul>
{SUPPORTED_INTEGRATIONS_LIST.map((integration) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the tooltip only list the ones that are not already spelled out individually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took this from the desings. At first I thought the same, that it should have only the remaining services, but it seems convenient to have the full list in one place, I suspect that was the logic behind the designs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, no worries then :)

<li key={integration}>{integration}</li>
))}
<li>{customLogFilesTitle}</li>
</ul>
</EuiText>
}
>
<EuiBadge color="hollow">
<EuiTextColor color={colors.link}>
{`+${SUPPORTED_INTEGRATIONS_LIST.length - FEATURED_INTEGRATIONS_LIST.length}`}
</EuiTextColor>
</EuiBadge>
</EuiToolTip>
</EuiFlexGroup>
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.