From 662155b93f4f4e990196729b60d920ca9c1685d0 Mon Sep 17 00:00:00 2001 From: Bharat Pasupula Date: Thu, 19 Dec 2024 14:25:49 +0100 Subject: [PATCH] Fix UI validation for Integration and Datastream name --- .../steps/data_stream_step/data_stream_step.tsx | 4 ++-- .../steps/data_stream_step/translations.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx b/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx index 1bd7b92b2e0cb..802ae67ce912d 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx +++ b/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx @@ -43,8 +43,8 @@ export const InputTypeOptions: Array> = [ { value: 'udp', label: 'UDP' }, ]; -const isValidName = (name: string) => /^[a-z0-9_]+$/.test(name); -const getNameFromTitle = (title: string) => title.toLowerCase().replaceAll(/[^a-z0-9]/g, '_'); +const isValidName = (name: string) => /^[a-z_]+$/.test(name); +const getNameFromTitle = (title: string) => title.toLowerCase().replaceAll(/[^a-z]/g, '_'); interface DataStreamStepProps { integrationSettings: State['integrationSettings']; diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/translations.ts b/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/translations.ts index cbabd8aa0d62b..f391b9d167a55 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/translations.ts +++ b/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/translations.ts @@ -45,7 +45,7 @@ export const INTEGRATION_NAME_LABEL = i18n.translate( export const NO_SPACES_HELP = i18n.translate( 'xpack.integrationAssistant.step.dataStream.noSpacesHelpText', { - defaultMessage: 'Name can only contain lowercase letters, numbers, and underscore (_)', + defaultMessage: 'Name can only contain lowercase letters and underscore (_)', } ); export const PACKAGE_NAMES_FETCH_ERROR = i18n.translate(