Skip to content

Commit

Permalink
[8.9] ESRE landing page panels and links (elastic#159851)
Browse files Browse the repository at this point in the history
## Summary

This PR follows elastic#159809 and adds content to the expandable accordion
sections. The 1st accorion (ELSER) is open by default on page visit.

We're also adding links in the sections, which point to documentation or
to internal Kibana pages (e.g. Behavioral Analytics, Trained Models).
New entries are being added to the doc links files.


![ESRE_panels](https://github.com/elastic/kibana/assets/14224983/a50c5705-0192-4a86-8444-9d4b1a9859b2)


### 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)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 20, 2023
1 parent f233933 commit 2422c01
Show file tree
Hide file tree
Showing 13 changed files with 743 additions and 25 deletions.
12 changes: 11 additions & 1 deletion packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
const SECURITY_SOLUTION_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/`;
const APP_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/app-search/${DOC_LINK_VERSION}/`;
const ENTERPRISE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}/`;
const ESRE_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/esre/${DOC_LINK_VERSION}/`;
const WORKPLACE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/workplace-search/${DOC_LINK_VERSION}/`;
const SEARCH_UI_DOCS = `${DOCS_WEBSITE_URL}search-ui/`;
const MACHINE_LEARNING_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/`;
Expand Down Expand Up @@ -153,11 +154,17 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
crawlerOverview: `${ENTERPRISE_SEARCH_DOCS}crawler.html`,
deployTrainedModels: `${MACHINE_LEARNING_DOCS}ml-nlp-deploy-models.html`,
documentLevelSecurity: `${ELASTICSEARCH_DOCS}document-level-security.html`,
elser: `${MACHINE_LEARNING_DOCS}ml-nlp-elser.html`,
elser: `${ENTERPRISE_SEARCH_DOCS}elser-text-expansion.html`,
engines: `${ENTERPRISE_SEARCH_DOCS}engines.html`,
esre: `${ESRE_DOCS}index.html`,
esreFaq: `${ESRE_DOCS}faq.html`,
esreHelp: `${ESRE_DOCS}help.html`,
esreLearn: `${ESRE_DOCS}learn.html`,
indexApi: `${ELASTICSEARCH_DOCS}docs-index_.html`,
ingestionApis: `${ENTERPRISE_SEARCH_DOCS}ingestion-apis.html`,
ingestPipelines: `${ENTERPRISE_SEARCH_DOCS}ingest-pipelines.html`,
knnSearch: `${ELASTICSEARCH_DOCS}knn-search.html`,
knnSearchCombine: `${ELASTICSEARCH_DOCS}knn-search.html#_combine_approximate_knn_with_other_features`,
languageAnalyzers: `${ELASTICSEARCH_DOCS}analysis-lang-analyzer.html`,
languageClients: `${ENTERPRISE_SEARCH_DOCS}programming-language-clients.html`,
licenseManagement: `${ENTERPRISE_SEARCH_DOCS}license-management.html`,
Expand All @@ -168,7 +175,9 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
searchApplications: `${ENTERPRISE_SEARCH_DOCS}search-applications.html`,
searchTemplates: `${ELASTICSEARCH_DOCS}search-template.html`,
start: `${ENTERPRISE_SEARCH_DOCS}start.html`,
supportedNlpModels: `${MACHINE_LEARNING_DOCS}ml-nlp-model-ref.html`,
syncRules: `${ENTERPRISE_SEARCH_DOCS}sync-rules.html`,
trainedModels: `${MACHINE_LEARNING_DOCS}ml-trained-models.html`,
troubleshootSetup: `${ENTERPRISE_SEARCH_DOCS}troubleshoot-setup.html`,
usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`,
},
Expand Down Expand Up @@ -371,6 +380,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
remoteClusters: `${ELASTICSEARCH_DOCS}remote-clusters.html`,
remoteClustersProxy: `${ELASTICSEARCH_DOCS}remote-clusters.html#proxy-mode`,
remoteClusersProxySettings: `${ELASTICSEARCH_DOCS}remote-clusters-settings.html#remote-cluster-proxy-settings`,
rrf: `${ELASTICSEARCH_DOCS}rrf.html`,
scriptParameters: `${ELASTICSEARCH_DOCS}modules-scripting-using.html#prefer-params`,
secureCluster: `${ELASTICSEARCH_DOCS}secure-cluster.html`,
shardAllocationSettings: `${ELASTICSEARCH_DOCS}modules-cluster.html#cluster-shard-allocation-settings`,
Expand Down
8 changes: 8 additions & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,15 @@ export interface DocLinks {
readonly documentLevelSecurity: string;
readonly elser: string;
readonly engines: string;
readonly esre: string;
readonly esreFaq: string;
readonly esreHelp: string;
readonly esreLearn: string;
readonly indexApi: string;
readonly ingestionApis: string;
readonly ingestPipelines: string;
readonly knnSearch: string;
readonly knnSearchCombine: string;
readonly languageAnalyzers: string;
readonly languageClients: string;
readonly licenseManagement: string;
Expand All @@ -153,7 +159,9 @@ export interface DocLinks {
readonly searchApplications: string;
readonly searchTemplates: string;
readonly start: string;
readonly supportedNlpModels: string;
readonly syncRules: string;
readonly trainedModels: string;
readonly troubleshootSetup: string;
readonly usersAccess: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ export const OLD_SEARCH_INDEX_CRAWLER_DOMAIN_DETAIL_PATH = `${SEARCH_INDEX_PATH}

export const ML_MANAGE_TRAINED_MODELS_PATH = '/app/ml/trained_models';
export const ML_NOTIFICATIONS_PATH = '/app/ml/notifications';

export const DEV_TOOLS_CONSOLE_PATH = '/app/dev_tools#/console';
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
* 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 { generatePath } from 'react-router-dom';

import {
EuiButton,
EuiFlexGroup,
EuiFlexItem,
EuiLink,
EuiSpacer,
EuiSteps,
EuiText,
} from '@elastic/eui';
import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { ENTERPRISE_SEARCH_CONTENT_PLUGIN } from '../../../../../common/constants';
import { NEW_INDEX_PATH } from '../../../enterprise_search_content/routes';
import { docLinks } from '../../../shared/doc_links';
import { EuiLinkTo } from '../../../shared/react_router_helpers';

const steps: EuiContainedStepProps[] = [
{
title: i18n.translate('xpack.enterpriseSearch.esre.elserPanel.step1.title', {
defaultMessage: 'Create an index',
}),
children: (
<EuiLinkTo
to={generatePath(ENTERPRISE_SEARCH_CONTENT_PLUGIN.URL + NEW_INDEX_PATH)}
shouldNotCreateHref
>
<EuiButton iconType="plusInCircle">
{i18n.translate('xpack.enterpriseSearch.esre.elserPanel.step1.buttonLabel', {
defaultMessage: 'Create an index',
})}
</EuiButton>
</EuiLinkTo>
),
status: 'incomplete',
},
{
title: i18n.translate('xpack.enterpriseSearch.esre.elserPanel.step2.title', {
defaultMessage: "Navigate to index's Pipelines tab",
}),
children: (
<EuiText>
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.elserPanel.step2.description"
defaultMessage="After creating an index, select it and click the tab called {pipelinesName}."
values={{
pipelinesName: (
<strong>
&quot;
{i18n.translate(
'xpack.enterpriseSearch.esre.elserPanel.step2.description.pipelinesName',
{
defaultMessage: 'Pipelines',
}
)}
&quot;
</strong>
),
}}
/>
</p>
</EuiText>
),
status: 'incomplete',
},
{
title: i18n.translate('xpack.enterpriseSearch.esre.elserPanel.step3.title', {
defaultMessage: 'Follow the on-screen instructions to deploy ELSER',
}),
children: (
<EuiText>
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.elserPanel.step3.description"
defaultMessage="Locate the panel that allows you to one click deploy ELSER and create an inference pipeline using that model."
/>
</p>
</EuiText>
),
status: 'incomplete',
},
];

export const ElserPanel: React.FC = () => (
<>
<EuiSpacer />
<EuiFlexGroup direction="column">
<EuiFlexItem grow={false}>
<EuiText>
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.elser.description"
defaultMessage="Effortlessly deploy the {elser} for instant text semantic search capabilities in just a few clicks. This model expands your document and query text using the 'text_expansion' field, delivering seamless search out of the box."
values={{
elser: (
<EuiLink target="_blank" href={docLinks.elser} external={false}>
{i18n.translate('xpack.enterpriseSearch.esre.elser.description.elserLinkText', {
defaultMessage: 'Elastic Learned Sparse Encoder',
})}
</EuiLink>
),
}}
/>
</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSteps steps={steps} titleSize="xs" />
</EuiFlexItem>
</EuiFlexGroup>
</>
);
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

import React from 'react';

import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText, EuiTitle } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiPanel, EuiText, EuiTitle } from '@elastic/eui';

import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../shared/doc_links';

export const EsreDocsSection: React.FC = () => (
<EuiFlexGroup alignItems="center">
<EuiFlexItem grow={4}>
Expand All @@ -30,7 +33,19 @@ export const EsreDocsSection: React.FC = () => (
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.esreDocsSection.description"
defaultMessage="To learn more about how to get started with ESRE, and test these tools with concrete examples, visit the ESRE documentation."
defaultMessage="To learn more about how to get started with ESRE, and test these tools with concrete examples, visit the {esreDocumentation}."
values={{
esreDocumentation: (
<EuiLink target="_blank" href={docLinks.esre} external>
{i18n.translate(
'xpack.enterpriseSearch.esre.esreDocsSection.description.esreLinkText',
{
defaultMessage: 'ESRE documentation',
}
)}
</EuiLink>
),
}}
/>
</p>
</EuiText>
Expand All @@ -57,7 +72,19 @@ export const EsreDocsSection: React.FC = () => (
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.esreDocsSection.learn.description"
defaultMessage="These are complex topics, so we've curated some learning topics to help you get started."
defaultMessage="These are complex topics, so we've curated some {learningTopics} to help you get started."
values={{
learningTopics: (
<EuiLink target="_blank" href={docLinks.esreLearn} external={false}>
{i18n.translate(
'xpack.enterpriseSearch.esre.esreDocsSection.learn.learningTopicsLinkText',
{
defaultMessage: 'learning topics',
}
)}
</EuiLink>
),
}}
/>
</p>
</EuiText>
Expand All @@ -83,7 +110,19 @@ export const EsreDocsSection: React.FC = () => (
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.esreDocsSection.faq.description"
defaultMessage="Learn what ESRE is (and isn't) from these frequently asked questions."
defaultMessage="Learn what ESRE is (and isn't) from these {frequentlyAskedQuestions}."
values={{
frequentlyAskedQuestions: (
<EuiLink target="_blank" href={docLinks.esreFaq} external={false}>
{i18n.translate(
'xpack.enterpriseSearch.esre.esreDocsSection.learn.frequentlyAskedQuestionsLinkText',
{
defaultMessage: 'frequently asked questions',
}
)}
</EuiLink>
),
}}
/>
</p>
</EuiText>
Expand All @@ -109,7 +148,19 @@ export const EsreDocsSection: React.FC = () => (
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.esreDocsSection.help.description"
defaultMessage="Need help? Check out the ESRE discuss forum!"
defaultMessage="Need help? Check out the {discussForum}!"
values={{
discussForum: (
<EuiLink target="_blank" href={docLinks.esreHelp} external={false}>
{i18n.translate(
'xpack.enterpriseSearch.esre.esreDocsSection.learn.discussForumLinkText',
{
defaultMessage: 'ESRE discuss forum',
}
)}
</EuiLink>
),
}}
/>
</p>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* 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 { generatePath } from 'react-router-dom';

import {
EuiButton,
EuiFlexGroup,
EuiFlexItem,
EuiLink,
EuiSpacer,
EuiSteps,
EuiText,
} from '@elastic/eui';
import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { DEV_TOOLS_CONSOLE_PATH } from '../../../enterprise_search_content/routes';
import { docLinks } from '../../../shared/doc_links';
import { EuiLinkTo } from '../../../shared/react_router_helpers';

const steps: EuiContainedStepProps[] = [
{
title: i18n.translate('xpack.enterpriseSearch.esre.linearCombinationPanel.step1.title', {
defaultMessage: 'Discover how to use linear combination in _search queries',
}),
children: (
<EuiLink href={docLinks.knnSearchCombine} target="_blank" external>
{i18n.translate(
'xpack.enterpriseSearch.esre.linearCombinationPanel.step1.knnSearchCombineLinkText',
{
defaultMessage: 'Combine approximate kNN with other features',
}
)}
</EuiLink>
),
status: 'incomplete',
},
{
title: i18n.translate('xpack.enterpriseSearch.esre.linearCombinationPanel.step2.title', {
defaultMessage: 'Try it today in Console',
}),
children: (
<EuiLinkTo to={generatePath(DEV_TOOLS_CONSOLE_PATH)} shouldNotCreateHref>
<EuiButton>
{i18n.translate('xpack.enterpriseSearch.esre.linearCombinationPanel.step2.buttonLabel', {
defaultMessage: 'Open Console',
})}
</EuiButton>
</EuiLinkTo>
),
status: 'incomplete',
},
];

export const LinearCombinationPanel: React.FC = () => (
<>
<EuiSpacer />
<EuiFlexGroup direction="column">
<EuiFlexItem grow={false}>
<EuiText>
<p>
<FormattedMessage
id="xpack.enterpriseSearch.esre.linearCombinationPanel.description"
defaultMessage="Used to calculate a similarity score or distance between data points. Combines attributes or features using weights, which enables customized relevance factors."
/>
</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSteps steps={steps} titleSize="xs" />
</EuiFlexItem>
</EuiFlexGroup>
</>
);
Loading

0 comments on commit 2422c01

Please sign in to comment.