diff --git a/frontend/src/concepts/k8s/NameDescriptionField.tsx b/frontend/src/concepts/k8s/NameDescriptionField.tsx index 3f5f3b5a10..df983f1cd2 100644 --- a/frontend/src/concepts/k8s/NameDescriptionField.tsx +++ b/frontend/src/concepts/k8s/NameDescriptionField.tsx @@ -22,6 +22,7 @@ type NameDescriptionFieldProps = { autoFocusName?: boolean; showK8sName?: boolean; disableK8sName?: boolean; + maxLength?: number; }; const NameDescriptionField: React.FC = ({ @@ -32,6 +33,7 @@ const NameDescriptionField: React.FC = ({ autoFocusName, showK8sName, disableK8sName, + maxLength, }) => { const autoSelectNameRef = React.useRef(null); @@ -61,7 +63,13 @@ const NameDescriptionField: React.FC = ({ name={nameFieldId} value={data.name} onChange={(e, name) => setData({ ...data, name })} + maxLength={maxLength} /> + {maxLength && ( + + {`Cannot exceed ${maxLength} characters`} + + )} {showK8sName && ( diff --git a/frontend/src/concepts/pipelines/content/createRun/RunForm.tsx b/frontend/src/concepts/pipelines/content/createRun/RunForm.tsx index bacab2c7db..14d015eef5 100644 --- a/frontend/src/concepts/pipelines/content/createRun/RunForm.tsx +++ b/frontend/src/concepts/pipelines/content/createRun/RunForm.tsx @@ -12,7 +12,7 @@ import { PipelineRunType } from '~/pages/pipelines/global/runs'; import ProjectAndExperimentSection from '~/concepts/pipelines/content/createRun/contentSections/ProjectAndExperimentSection'; import PipelineSection from './contentSections/PipelineSection'; import { RunTypeSection } from './contentSections/RunTypeSection'; -import { CreateRunPageSections, runPageSectionTitles } from './const'; +import { CreateRunPageSections, RUN_NAME_CHARACTER_LIMIT, runPageSectionTitles } from './const'; import { getInputDefinitionParams } from './utils'; type RunFormProps = { @@ -73,6 +73,7 @@ const RunForm: React.FC = ({ data, runType, onValueChange }) => { descriptionFieldId="run-description" data={data.nameDesc} setData={(nameDesc) => onValueChange('nameDesc', nameDesc)} + maxLength={RUN_NAME_CHARACTER_LIMIT} /> {isSchedule && data.runType.type === RunTypeOption.SCHEDULED && ( diff --git a/frontend/src/concepts/pipelines/content/createRun/const.ts b/frontend/src/concepts/pipelines/content/createRun/const.ts index 5f693fe1c6..e71af08f42 100644 --- a/frontend/src/concepts/pipelines/content/createRun/const.ts +++ b/frontend/src/concepts/pipelines/content/createRun/const.ts @@ -34,3 +34,5 @@ export const runPageSectionTitles: Record = { [CreateRunPageSections.PIPELINE]: 'Pipeline', [CreateRunPageSections.PARAMS]: 'Parameters', }; + +export const RUN_NAME_CHARACTER_LIMIT = 255;