From 1915b117ba050ee8309abf1ee4a3e1426372a7cf Mon Sep 17 00:00:00 2001 From: Janelle Law Date: Fri, 18 Mar 2022 10:56:41 -0400 Subject: [PATCH] fix(recordings): disallow whitespace in labels (#392) --- src/app/CreateRecording/EditRecordingLabels.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/CreateRecording/EditRecordingLabels.tsx b/src/app/CreateRecording/EditRecordingLabels.tsx index 8f9dc654f..bee447436 100644 --- a/src/app/CreateRecording/EditRecordingLabels.tsx +++ b/src/app/CreateRecording/EditRecordingLabels.tsx @@ -62,7 +62,7 @@ export interface EditRecordingLabelsProps { onPatchCancel?: () => void; } -export const LabelPattern = /^[a-zA-Z0-9.-]+$/; +export const LabelPattern = /^\S+$/; export const EditRecordingLabels = (props) => { const [validKeys, setValidKeys] = React.useState(Array(props.labels.size).fill(ValidatedOptions.default)); @@ -131,11 +131,11 @@ export const EditRecordingLabels = (props) => { label="Labels" fieldId="labels" labelIcon={ - Alphanumeric key value pairs. Keys must be unique.'.' and '-' accepted.}> + Unique key-value pairs containing information about the recording.}> } - helperTextInvalid={"Enter a valid label. Letters, numbers, '.' and '-' accepted. Keys must be unique."} + helperTextInvalid={"Enter a valid label. Keys must be unique. Labels should not contain whitespace."} validated={patchFormValid} >