Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(recordings): disallow whitespace in labels #392

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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