-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ingest pipelines] Implement empty prompt for processors editor (#77655…
…) (#78284)
- Loading branch information
1 parent
db591a8
commit fb80e69
Showing
17 changed files
with
232 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
.../application/components/pipeline_processors_editor/components/processors_empty_prompt.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { FunctionComponent } from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiEmptyPrompt, EuiSpacer, EuiLink } from '@elastic/eui'; | ||
import { useKibana } from '../../../../shared_imports'; | ||
import { usePipelineProcessorsContext } from '../context'; | ||
import { AddProcessorButton } from './add_processor_button'; | ||
import { OnDoneLoadJsonHandler, LoadFromJsonButton } from './load_from_json'; | ||
|
||
const i18nTexts = { | ||
emptyPromptTitle: i18n.translate('xpack.ingestPipelines.pipelineEditor.emptyPrompt.title', { | ||
defaultMessage: 'Add your first processor', | ||
}), | ||
}; | ||
|
||
export interface Props { | ||
onLoadJson: OnDoneLoadJsonHandler; | ||
} | ||
|
||
export const ProcessorsEmptyPrompt: FunctionComponent<Props> = ({ onLoadJson }) => { | ||
const { onTreeAction } = usePipelineProcessorsContext(); | ||
const { services } = useKibana(); | ||
|
||
return ( | ||
<EuiEmptyPrompt | ||
title={<h2>{i18nTexts.emptyPromptTitle}</h2>} | ||
data-test-subj="processorsEmptyPrompt" | ||
body={ | ||
<p> | ||
<FormattedMessage | ||
id="xpack.ingestPipelines.pipelineEditor.emptyPrompt.description" | ||
defaultMessage="Processors are used to pre-process documents before indexing. {learnMoreLink}" | ||
values={{ | ||
learnMoreLink: ( | ||
<EuiLink | ||
href={services.documentation.getEsDocsBasePath() + '/ingest-processors.html'} | ||
target="_blank" | ||
external | ||
> | ||
{i18n.translate( | ||
'xpack.ingestPipelines.pipelineEditor.processorsDocumentationLink', | ||
{ | ||
defaultMessage: 'Learn more.', | ||
} | ||
)} | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
</p> | ||
} | ||
actions={ | ||
<> | ||
<AddProcessorButton | ||
onClick={() => { | ||
onTreeAction({ type: 'addProcessor', payload: { target: ['processors'] } }); | ||
}} | ||
/> | ||
|
||
<EuiSpacer size="m" /> | ||
|
||
<LoadFromJsonButton onDone={onLoadJson} /> | ||
</> | ||
} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.