Skip to content

Commit

Permalink
[Serverless Search] Update Getting Ingest Data section (#171035)
Browse files Browse the repository at this point in the history
## Summary

PR updates Getting Started Ingest data row to match
[design](https://www.figma.com/file/aRW3wtDRGgwOunC8vXIvdm/Milestone-0-UX?type=design&node-id=3893-443443&mode=design&t=PYPiODRJvKspgxQc-0)
.

## Screen shot 
<img width="1402" alt="Getting ingest data row"
src="https://github.com/elastic/kibana/assets/55930906/1b932469-f151-4e71-844b-da6b9b667e2a">

## Screen Recording


https://github.com/elastic/kibana/assets/55930906/2c9454ee-b23f-4a7e-9d16-cfcd3697e1a1



### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
saarikabhasi and kibanamachine authored Nov 22, 2023
1 parent 938069d commit a8f2039
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 320 deletions.
134 changes: 31 additions & 103 deletions packages/kbn-search-api-panels/components/ingest_data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,30 @@
* Side Public License, v 1.
*/

import React, { useState } from 'react';
import React from 'react';

import { EuiCheckableCard, EuiFormFieldset, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { EuiSpacer, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import type { ApplicationStart } from '@kbn/core-application-browser';
import type { SharePluginStart } from '@kbn/share-plugin/public';
import { CodeBox } from './code_box';
import { LanguageDefinition } from '../types';
import { OverviewPanel } from './overview_panel';
import { IntegrationsPanel } from './integrations_panel';

import { IngestionsPanel } from './ingestions_panel';
interface IngestDataProps {
codeSnippet: string;
selectedLanguage: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
docLinks: {
beats: string;
connectors: string;
integrations: string;
logstash: string;
};
assetBasePath: string;
application?: ApplicationStart;
sharePlugin: SharePluginStart;
languages: LanguageDefinition[];
consoleRequest?: string;
additionalIngestionPanel?: React.ReactNode;
}

export const IngestData: React.FC<IngestDataProps> = ({
Expand All @@ -44,115 +42,45 @@ export const IngestData: React.FC<IngestDataProps> = ({
sharePlugin,
languages,
consoleRequest,
additionalIngestionPanel,
}) => {
const [selectedIngestMethod, setSelectedIngestMethod] = useState<
'ingestViaApi' | 'ingestViaIntegration'
>('ingestViaApi');
return (
<OverviewPanel
description={i18n.translate('searchApiPanels.welcomeBanner.ingestData.description', {
defaultMessage:
'Add data to your data stream or index to make it searchable. Choose an ingestion method that fits your application and workflow.',
defaultMessage: 'Add data to your data stream or index to make it searchable via API. ',
})}
leftPanelContent={
selectedIngestMethod === 'ingestViaApi' ? (
<CodeBox
consoleRequest={consoleRequest}
codeSnippet={codeSnippet}
languages={languages}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
assetBasePath={assetBasePath}
application={application}
sharePlugin={sharePlugin}
/>
) : (
<IntegrationsPanel docLinks={docLinks} assetBasePath={assetBasePath} />
)
<CodeBox
consoleRequest={consoleRequest}
codeSnippet={codeSnippet}
languages={languages}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
assetBasePath={assetBasePath}
application={application}
sharePlugin={sharePlugin}
/>
}
links={[
...(selectedLanguage.apiReference
? [
{
href: selectedLanguage.apiReference,
label: i18n.translate('searchApiPanels.welcomeBanner.ingestData.clientDocLink', {
defaultMessage: '{languageName} API reference',
values: { languageName: selectedLanguage.name },
}),
},
]
: []),
{
href: docLinks.integrations,
label: i18n.translate('searchApiPanels.welcomeBanner.ingestData.integrationsLink', {
defaultMessage: 'About Integrations',
}),
},
]}
links={[]}
title={i18n.translate('searchApiPanels.welcomeBanner.ingestData.title', {
defaultMessage: 'Ingest data',
})}
>
<EuiSpacer size="l" />
<EuiFormFieldset
legend={{
children: i18n.translate('searchApiPanels.welcomeBanner.ingestData.ingestLegendLabel', {
defaultMessage: 'Select an ingestion method',
}),
display: 'hidden',
}}
>
<EuiCheckableCard
hasShadow
id="ingestViaApi"
label={
<EuiTitle size="xs">
<h3>
{i18n.translate('searchApiPanels.welcomeBanner.ingestData.ingestApiLabel', {
defaultMessage: 'Ingest via API',
})}
</h3>
</EuiTitle>
}
value="ingestViaApi"
checked={selectedIngestMethod === 'ingestViaApi'}
onChange={() => setSelectedIngestMethod('ingestViaApi')}
>
<EuiText>
{i18n.translate('searchApiPanels.welcomeBanner.ingestData.ingestApiDescription', {
defaultMessage:
'The most flexible way to index data, enabling full control over your customization and optimization options.',
})}
</EuiText>
</EuiCheckableCard>
<EuiSpacer />
<EuiCheckableCard
hasShadow
id="ingestViaIntegration"
label={
<EuiTitle size="xs">
<h3>
{i18n.translate('searchApiPanels.welcomeBanner.ingestData.ingestIntegrationLabel', {
defaultMessage: 'Ingest via integration',
})}
</h3>
</EuiTitle>
}
value="ingestViaIntegration"
checked={selectedIngestMethod === 'ingestViaIntegration'}
onChange={() => setSelectedIngestMethod('ingestViaIntegration')}
>
<EuiText>
{i18n.translate(
'searchApiPanels.welcomeBanner.ingestData.ingestIntegrationDescription',
{
defaultMessage:
'Specialized ingestion tools optimized for transforming data and shipping it to Elasticsearch.',
}
)}
</EuiText>
</EuiCheckableCard>
</EuiFormFieldset>
<EuiTitle size="xs">
<h4>
{i18n.translate('searchApiPanels.welcomeBanner.ingestData.alternativeOptions', {
defaultMessage: 'Alternative ingestion options',
})}
</h4>
</EuiTitle>
<EuiSpacer size="m" />

<IngestionsPanel
assetBasePath={assetBasePath}
docLinks={docLinks}
additionalIngestionPanel={additionalIngestionPanel}
/>
</OverviewPanel>
);
};
131 changes: 131 additions & 0 deletions packages/kbn-search-api-panels/components/ingestions_panel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';

import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer, EuiText, EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { GithubLink } from './github_link';

interface IngestionPanelProps {
additionalIngestionPanel?: React.ReactNode;
docLinks: { beats: string; logstash: string };
assetBasePath: string;
}

export const IngestionsPanel: React.FC<IngestionPanelProps> = ({
additionalIngestionPanel,
docLinks,
assetBasePath,
}) => {
const panels = [
{
description: i18n.translate(
'searchApiPanels.welcomeBanner.ingestData.alternativeOptions.logstashDescription',
{
defaultMessage:
'General-purpose data processing pipeline for Elasticsearch. Use Logstash to extract and transform data from a variety of inputs and outputs.',
}
),
title: i18n.translate(
'searchApiPanels.welcomeBanner.ingestData.alternativeOptions.logstashTitle',
{
defaultMessage: 'Logstash',
}
),
links: [
{
href: docLinks.logstash,
label: i18n.translate(
'searchApiPanels.welcomeBanner.ingestData.alternativeOptions.logstashDocumentationLabel',
{
defaultMessage: 'Documentation',
}
),
},
{
href: 'https://github.com/elastic/logstash',
isGithubLink: true,
label: 'logstash',
},
],
},
{
description: i18n.translate(
'searchApiPanels.welcomeBanner.ingestData.alternativeOptions.beatsDescription',
{
defaultMessage:
'Lightweight, single-purpose data shippers for Elasticsearch. Use Beats to send operational data from your servers.',
}
),
title: i18n.translate(
'searchApiPanels.welcomeBanner.ingestData.alternativeOptions.beatsTitle',
{
defaultMessage: 'Beats',
}
),
links: [
{
href: docLinks.beats,
label: i18n.translate(
'searchApiPanels.welcomeBanner.ingestData.alternativeOptions.beatsDocumentationLabel',
{
defaultMessage: 'Documentation',
}
),
},
{
href: 'https://github.com/elastic/beats',
isGithubLink: true,
label: 'beats',
},
],
},
];
return (
<>
{additionalIngestionPanel}
{panels.map(({ title, description, links }, panelIndex) => (
<EuiFlexGroup
direction="column"
justifyContent="spaceEvenly"
gutterSize="s"
key={panelIndex}
>
<EuiFlexItem grow={false}>
<EuiTitle size="xxs">
<h6>{title}</h6>
</EuiTitle>
<EuiSpacer size="xs" />
<EuiText>
<p>{description}</p>
</EuiText>
</EuiFlexItem>
{links && links.length > 0 && (
<>
<EuiFlexGroup direction="row" justifyContent="flexStart" alignItems="center">
{links.map(({ label, href, isGithubLink }, linksIndex) => (
<EuiFlexItem grow={false} key={linksIndex}>
{isGithubLink ? (
<GithubLink assetBasePath={assetBasePath} label={label} href={href} />
) : (
<EuiLink href={href} target="_blank">
{label}
</EuiLink>
)}
</EuiFlexItem>
))}
</EuiFlexGroup>
<EuiSpacer size="m" />
</>
)}
</EuiFlexGroup>
))}
</>
);
};
Loading

0 comments on commit a8f2039

Please sign in to comment.