Skip to content

Commit

Permalink
Fix UI validation for Integration and Datastream name
Browse files Browse the repository at this point in the history
  • Loading branch information
bhapas committed Dec 19, 2024
1 parent 094e4ae commit 662155b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export const InputTypeOptions: Array<EuiComboBoxOptionOption<InputType>> = [
{ 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'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 662155b

Please sign in to comment.