Skip to content

Commit

Permalink
fix(recordings): disallow whitespace in labels (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janelle Law authored Mar 18, 2022
1 parent 8176e64 commit 1915b11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/CreateRecording/EditRecordingLabels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -131,11 +131,11 @@ export const EditRecordingLabels = (props) => {
label="Labels"
fieldId="labels"
labelIcon={
<Tooltip content={<div>Alphanumeric key value pairs. Keys must be unique.'.' and '-' accepted.</div>}>
<Tooltip content={<div>Unique key-value pairs containing information about the recording.</div>}>
<HelpIcon noVerticalAlign />
</Tooltip>
}
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}
>
<Button onClick={handleAddLabelButtonClick} variant="link" icon={<PlusCircleIcon/>}>
Expand Down

0 comments on commit 1915b11

Please sign in to comment.