forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ingest pipelines] Test pipeline enhancements (elastic#74964)
- Loading branch information
1 parent
eeba9c7
commit c62d4c3
Showing
40 changed files
with
1,291 additions
and
393 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
8 changes: 8 additions & 0 deletions
8
...k/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.scss
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
.pipelineProcessorsEditor { | ||
margin-bottom: $euiSizeXL; | ||
|
||
&__container { | ||
background-color: $euiColorLightestShade; | ||
} | ||
|
||
&__onFailureTitle { | ||
padding-left: $euiSizeS; | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
...mponents/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.scss
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,3 @@ | ||
.documentsDropdown__selectContainer { | ||
max-width: 200px; | ||
} |
69 changes: 69 additions & 0 deletions
69
...omponents/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.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,69 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import React, { FunctionComponent } from 'react'; | ||
import { EuiSelect, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; | ||
|
||
import { Document } from '../../types'; | ||
|
||
import './documents_dropdown.scss'; | ||
|
||
const i18nTexts = { | ||
ariaLabel: i18n.translate( | ||
'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsDropdownAriaLabel', | ||
{ | ||
defaultMessage: 'Select documents', | ||
} | ||
), | ||
dropdownLabel: i18n.translate( | ||
'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsdropdownLabel', | ||
{ | ||
defaultMessage: 'Documents:', | ||
} | ||
), | ||
buttonLabel: i18n.translate('xpack.ingestPipelines.pipelineEditor.testPipeline.buttonLabel', { | ||
defaultMessage: 'Add documents', | ||
}), | ||
}; | ||
|
||
const getDocumentOptions = (documents: Document[]) => | ||
documents.map((doc, index) => ({ | ||
value: index, | ||
text: doc._id, | ||
})); | ||
|
||
interface Props { | ||
documents: Document[]; | ||
selectedDocumentIndex: number; | ||
updateSelectedDocument: (index: number) => void; | ||
} | ||
|
||
export const DocumentsDropdown: FunctionComponent<Props> = ({ | ||
documents, | ||
selectedDocumentIndex, | ||
updateSelectedDocument, | ||
}) => { | ||
return ( | ||
<EuiFlexGroup alignItems="baseline" gutterSize="s" className="documentsDropdown"> | ||
<EuiFlexItem grow={false}> | ||
<EuiText> | ||
<span>{i18nTexts.dropdownLabel}</span> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false} className="documentsDropdown__selectContainer"> | ||
<EuiSelect | ||
compressed | ||
options={getDocumentOptions(documents)} | ||
value={selectedDocumentIndex} | ||
onChange={(e) => { | ||
updateSelectedDocument(Number(e.target.value)); | ||
}} | ||
aria-label={i18nTexts.ariaLabel} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; |
7 changes: 7 additions & 0 deletions
7
.../application/components/pipeline_processors_editor/components/documents_dropdown/index.ts
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,7 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { DocumentsDropdown } from './documents_dropdown'; |
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.