[Enterprise Search] pipelines copy tweaks (#142406) (#142535)

Updated copy on the pipelines tab and modal when using an API-based
index to explicitly call-out required actions in API requests to run the
ingest pipeline.

(cherry picked from commit 9a8008b00b)

Co-authored-by: Rodney Norris <rodney.norris@elastic.co>
This commit is contained in:
Kibana Machine 2022-10-03 17:04:09 -06:00 committed by GitHub
parent 6329ddbbde
commit 269444493c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 83 additions and 29 deletions

View file

@ -25,6 +25,7 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { DEFAULT_PIPELINE_NAME } from '../../../../../../common/constants';
@ -91,21 +92,43 @@ export const IngestPipelineModal: React.FC<IngestPipelineModalProps> = ({
<EuiFlexGroup direction="column" gutterSize="none">
<EuiFlexItem>
<EuiText color="subdued" size="s">
{displayOnly
? i18n.translate(
'xpack.enterpriseSearch.content.index.pipelines.ingestModal.modalBodyAPIText',
{
defaultMessage:
'This pipeline runs automatically on all Crawler and Connector indices created through Enterprise Search. To use this configuration on API-based indices you can use the sample cURL request below.',
}
)
: i18n.translate(
'xpack.enterpriseSearch.content.index.pipelines.ingestModal.modalBodyConnectorText',
{
defaultMessage:
'This pipeline runs automatically on all Crawler and Connector indices created through Enterprise Search.',
}
)}
{displayOnly ? (
<>
<p>
<FormattedMessage
id="xpack.enterpriseSearch.content.index.pipelines.ingestModal.modalBodyAPIText"
defaultMessage="{apiIndex} Changes made to the settings below are for reference only. These settings will not be persisted to your index or pipeline."
values={{
apiIndex: (
<strong>
{i18n.translate(
'xpack.enterpriseSearch.content.index.pipelines.ingestModal.apiIndex',
{ defaultMessage: 'This is an API-based index.' }
)}
</strong>
),
}}
/>
</p>
<p>
{i18n.translate(
'xpack.enterpriseSearch.content.index.pipelines.ingestModal.modalBodyAPITextCont',
{
defaultMessage:
"In order to use this pipeline on your API-based indices you'll need to explicitly reference it in your API requests.",
}
)}
</p>
</>
) : (
i18n.translate(
'xpack.enterpriseSearch.content.index.pipelines.ingestModal.modalBodyConnectorText',
{
defaultMessage:
'This pipeline runs automatically on all Crawler and Connector indices created through Enterprise Search.',
}
)
)}
</EuiText>
</EuiFlexItem>
<EuiSpacer />

View file

@ -15,6 +15,7 @@ import { i18n } from '@kbn/i18n';
import { DataPanel } from '../../../../shared/data_panel/data_panel';
import { docLinks } from '../../../../shared/doc_links';
import { isApiIndex } from '../../../utils/indices';
import { IngestPipelinesCard } from './ingest_pipelines_card';
import { AddMLInferencePipelineButton } from './ml_inference/add_ml_inference_button';
@ -23,9 +24,15 @@ import { MlInferencePipelineProcessorsCard } from './ml_inference_pipeline_proce
import { PipelinesLogic } from './pipelines_logic';
export const SearchIndexPipelines: React.FC = () => {
const { showAddMlInferencePipelineModal } = useValues(PipelinesLogic);
const {
showAddMlInferencePipelineModal,
hasIndexIngestionPipeline,
index,
pipelineState: { name: pipelineName },
} = useValues(PipelinesLogic);
const { closeAddMlInferencePipelineModal, openAddMlInferencePipelineModal } =
useActions(PipelinesLogic);
const apiIndex = isApiIndex(index);
return (
<>
@ -54,12 +61,23 @@ export const SearchIndexPipelines: React.FC = () => {
)}
</h2>
}
subtitle={i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.ingestionPipeline.subtitle',
{
defaultMessage: 'Ingest pipelines optimize your index for search applications',
}
)}
subtitle={
apiIndex
? i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.ingestionPipeline.apiIndexSubtitle',
{
defaultMessage:
"Ingest pipelines optimize your index for search applications. If you'd like to use these pipelines in your API-based index, you'll need to reference them explicitly in your API requests.",
}
)
: i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.ingestionPipeline.subtitle',
{
defaultMessage:
'Ingest pipelines optimize your index for search applications',
}
)
}
iconType="logstashInput"
>
<IngestPipelinesCard />
@ -88,13 +106,26 @@ export const SearchIndexPipelines: React.FC = () => {
)}
</h2>
}
subtitle={i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.mlInferencePipelines.subtitle',
{
defaultMessage:
'Inference pipelines will be run as processors from the Enterprise Search Ingest Pipeline',
}
)}
subtitle={
apiIndex && hasIndexIngestionPipeline
? i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.mlInferencePipelines.subtitleAPIindex',
{
defaultMessage:
"Inference pipelines will be run as processors from the Enterprise Search Ingest Pipeline. In order to use these pipeline on API-based indices you'll need to reference the {pipelineName} pipeline in your API requests.",
values: {
pipelineName,
},
}
)
: i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.mlInferencePipelines.subtitle',
{
defaultMessage:
'Inference pipelines will be run as processors from the Enterprise Search Ingest Pipeline',
}
)
}
iconType="compute"
action={
<AddMLInferencePipelineButton onClick={() => openAddMlInferencePipelineModal()} />