diff --git a/x-pack/legacy/plugins/ml/common/constants/validation.ts b/x-pack/legacy/plugins/ml/common/constants/validation.ts index 6ac63310d5d17c..e971baf769c1a4 100644 --- a/x-pack/legacy/plugins/ml/common/constants/validation.ts +++ b/x-pack/legacy/plugins/ml/common/constants/validation.ts @@ -21,4 +21,4 @@ export const JOB_ID_MAX_LENGTH = 64; * Job ID must contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores. * It must also start and end with an alphanumeric character. */ -export const JOB_ID_PATTERN = /^(?![\-_])[a-z0-9\-_]*(? = ({ jobs, jobPrefix, isSaving }) = - + ); }; diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/page.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/page.tsx index 2fb4f1a852693b..f3714516db4f0e 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/page.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/page.tsx @@ -143,7 +143,7 @@ export const Page: FC = ({ moduleId, existingGroupIds }) => { }, []); const jobPrefixValidator = composeValidators( - patternValidator(/^(?![\-_])[a-z0-9\-_]*/), + patternValidator(/^([a-z0-9]+[a-z0-9\-_]*)?$/), maxLengthValidator(JOB_ID_MAX_LENGTH - Math.max(...jobs.map(({ id }) => id.length))) ); const groupValidator = composeValidators( @@ -259,8 +259,8 @@ export const Page: FC = ({ moduleId, existingGroupIds }) => { )} - - + +

@@ -442,7 +442,7 @@ export const Page: FC = ({ moduleId, existingGroupIds }) => { /> - + = ({ moduleId, existingGroupIds }) => { isSaving={saveState === SAVE_STATE.SAVING} /> - - - {Object.keys(kibanaObjects).map((objectType, i) => ( - - + + + {Object.keys(kibanaObjects).map((objectType, i) => ( + - - {i < Object.keys(kibanaObjects).length - 1 && } - - ))} + {i < Object.keys(kibanaObjects).length - 1 && } + + ))} +