Skip to content

Commit

Permalink
Fix some input patterns in modals (#3828)
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
cynthia-sg authored May 20, 2024
1 parent 6ae18db commit 00ee235
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion web/src/layout/controlPanel/organizations/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const OrganizationForm = forwardRef<HTMLFormElement, Props>((props, ref) => {
resourceKind: ResourceKind.organizationName,
excluded: props.organization ? [props.organization.name] : [],
}}
pattern="[a-z0-9-]+"
pattern="[a-z0-9\-]+"
autoComplete="off"
required
/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions web/src/layout/controlPanel/repositories/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -645,11 +645,11 @@ const RepositoryModal = (props: Props) => {
case RepositoryKind.Helm:
return undefined;
case RepositoryKind.OLM:
return `(^(https://([A-Za-z0-9_.-]+)/|${OCI_PREFIX})[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)/?(.*)$`;
return `^((https?://)|${OCI_PREFIX}).*`;
case RepositoryKind.Container:
return `^(${OCI_PREFIX})[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)/?(.*)$`;
return `^${OCI_PREFIX}.*`;
default:
return '^(https://([A-Za-z0-9_.-]+)/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)/?(.*)$';
return `^https?://.*`;
}
};

Expand Down Expand Up @@ -880,7 +880,7 @@ const RepositoryModal = (props: Props) => {
resourceKind: ResourceKind.repositoryName,
excluded: !isUndefined(props.repository) ? [props.repository.name] : [],
}}
pattern="[a-z][a-z0-9-]*"
pattern="[a-z][a-z0-9\-]*"
autoComplete="off"
disabled={!isUndefined(props.repository)}
additionalInfo={
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00ee235

Please sign in to comment.