From 2ee721c531948603c6e95eaefea66ebf8c7a9cc2 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Wed, 17 Jun 2020 16:36:59 +0200 Subject: [PATCH] rename doc button and refactor type map const name --- ...earn_more_form_button.tsx => documentation_button.tsx} | 2 +- .../map_processor_type_to_form.tsx | 8 ++++---- .../processor_settings_form/processor_settings_form.tsx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/{learn_more_form_button.tsx => documentation_button.tsx} (92%) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/learn_more_form_button.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/documentation_button.tsx similarity index 92% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/learn_more_form_button.tsx rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/documentation_button.tsx index 37aa0d714687b..b1fd9e97aa23d 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/learn_more_form_button.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/documentation_button.tsx @@ -13,7 +13,7 @@ interface Props { docLink: string; } -export const LearnMoreFormButton: FunctionComponent = ({ processorLabel, docLink }) => { +export const DocumentationButton: FunctionComponent = ({ processorLabel, docLink }) => { return ( {i18n.translate( diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/map_processor_type_to_form.tsx index 93cfe15f587f6..5993d7fb3f87a 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/map_processor_type_to_form.tsx @@ -19,7 +19,7 @@ interface FieldsFormDescriptor { label: string; } -const mapProcessorTypeToFormOrDocPath: Record = { +const mapProcessorTypeToFormDescriptor: Record = { append: { FieldsComponent: undefined, // TODO: Implement docLinkPath: '/append-processor.html', @@ -262,12 +262,12 @@ const mapProcessorTypeToFormOrDocPath: Record = { }, }; -export const types = Object.keys(mapProcessorTypeToFormOrDocPath).sort(); +export const types = Object.keys(mapProcessorTypeToFormDescriptor).sort(); -export type ProcessorType = keyof typeof mapProcessorTypeToFormOrDocPath; +export type ProcessorType = keyof typeof mapProcessorTypeToFormDescriptor; export const getProcessorFormDescriptor = ( type: ProcessorType | string ): FieldsFormDescriptor | undefined => { - return mapProcessorTypeToFormOrDocPath[type as ProcessorType]; + return mapProcessorTypeToFormDescriptor[type as ProcessorType]; }; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/processor_settings_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/processor_settings_form.tsx index f72c27429ebee..81b5731a96d5f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/processor_settings_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_settings_form/processor_settings_form.tsx @@ -22,7 +22,7 @@ import { Form, useForm, FormDataProvider } from '../../../../../shared_imports'; import { usePipelineProcessorsContext } from '../../context'; import { ProcessorInternal } from '../../types'; -import { LearnMoreFormButton } from './learn_more_form_button'; +import { DocumentationButton } from './documentation_button'; import { ProcessorSettingsFromOnSubmitArg } from './processor_settings_form.container'; import { getProcessorFormDescriptor } from './map_processor_type_to_form'; import { CommonProcessorFields, ProcessorTypeField } from './processors/common_fields'; @@ -83,7 +83,7 @@ export const ProcessorSettingsForm: FunctionComponent = memo( if (formDescriptor) { return ( -