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] Load from json (elastic#70297) (elastic#70751)
* 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 <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
829d378
commit 169d06c
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.