-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ingest Pipelines] Load from json (#70297)
* WiP load from json modal ready, need to refactor more stuff * First iteration of load from JSON functionality - refactored the pipeline processsors editor components for portability - added CIT for load from json component * added comment * update deserialize with tests and make it more fault tolerant * use flyout footer * remove console.error and make the json editor a lot shorter * address PR feedback - Update form schema and form schema types - simplify the save handler - refactor processors_title to processors_header * remove unused translations Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
f1888cd
commit 5159635
Showing
37 changed files
with
931 additions
and
594 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
File renamed without changes.
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
44 changes: 44 additions & 0 deletions
44
x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.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,44 @@ | ||
/* | ||
* 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 { FormSchema, FIELD_TYPES, fieldValidators, fieldFormatters } from '../../../shared_imports'; | ||
|
||
import { PipelineForm } from './types'; | ||
|
||
const { emptyField } = fieldValidators; | ||
const { toInt } = fieldFormatters; | ||
|
||
export const pipelineFormSchema: FormSchema<PipelineForm> = { | ||
name: { | ||
type: FIELD_TYPES.TEXT, | ||
label: i18n.translate('xpack.ingestPipelines.form.nameFieldLabel', { | ||
defaultMessage: 'Name', | ||
}), | ||
validations: [ | ||
{ | ||
validator: emptyField( | ||
i18n.translate('xpack.ingestPipelines.form.pipelineNameRequiredError', { | ||
defaultMessage: 'Name is required.', | ||
}) | ||
), | ||
}, | ||
], | ||
}, | ||
description: { | ||
type: FIELD_TYPES.TEXTAREA, | ||
label: i18n.translate('xpack.ingestPipelines.form.descriptionFieldLabel', { | ||
defaultMessage: 'Description (optional)', | ||
}), | ||
}, | ||
version: { | ||
type: FIELD_TYPES.NUMBER, | ||
label: i18n.translate('xpack.ingestPipelines.form.versionFieldLabel', { | ||
defaultMessage: 'Version (optional)', | ||
}), | ||
formatters: [toInt], | ||
}, | ||
}; |
Oops, something went wrong.