mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Ingest Pipelines] Fix bug in reroute processor (#162872)
Fixes https://github.com/elastic/kibana/issues/162823 ## Summary This PR fixes the bug in the Reroute processor form which makes the page crash when switching from another processor type to reroute processor. **How to test:** 1. Start Es with `yarn es snapshot` and Kibana with `yarn start`. 2. Go to Stack Management > Ingest Pipeline. 3. Click **Create pipeline**, and then select **New pipeline**. 4. Click **Add a processor**. 5. In the **Configure processor** form, open the Processor dropdown, and select Reroute. 6. From the Processor dropdown, select Bytes (or any other processor type). 7. From the Processor dropdown, select Reroute. 8. Verify that the form works as expected. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9942fdcb2a
commit
190a98f487
1 changed files with 7 additions and 2 deletions
|
@ -114,7 +114,10 @@ export const Reroute: FunctionComponent = () => {
|
|||
const [{ fields }] = useFormData({ watch: ['fields.dataset', 'fields.namespace'] });
|
||||
|
||||
useEffect(() => {
|
||||
if (fields?.dataset.length > 0 || fields?.namespace.length > 0) {
|
||||
if (
|
||||
(fields?.dataset && fields.dataset.length > 0) ||
|
||||
(fields?.namespace && fields.namespace.length > 0)
|
||||
) {
|
||||
form.setFieldValue('fields.destination', '');
|
||||
}
|
||||
}, [form, fields]);
|
||||
|
@ -127,7 +130,9 @@ export const Reroute: FunctionComponent = () => {
|
|||
component={Field}
|
||||
componentProps={{
|
||||
euiFieldProps: {
|
||||
disabled: fields?.dataset.length > 0 || fields?.namespace.length > 0,
|
||||
disabled:
|
||||
(fields?.dataset && fields.dataset.length > 0) ||
|
||||
(fields?.namespace && fields.namespace.length > 0),
|
||||
},
|
||||
}}
|
||||
path="fields.destination"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue