-
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.
- Update form schema and form schema types - simplify the save handler - refactor processors_title to processors_header
- Loading branch information
1 parent
1284555
commit c0c4524
Showing
8 changed files
with
58 additions
and
161 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
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], | ||
}, | ||
}; |
138 changes: 0 additions & 138 deletions
138
x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx
This file was deleted.
Oops, something went wrong.
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