Skip to content

Commit

Permalink
ui: Update regex pattern helper text for validating team name (PROJQU…
Browse files Browse the repository at this point in the history
…AY-8110) (quay#3353)

* ui: update regex pattern in helpertext for team name(PROJQUAY-8110)

Signed-off-by: harishsurf <[email protected]>

* old ui: update regex pattern for validating team name

---------

Signed-off-by: harishsurf <[email protected]>
  • Loading branch information
harishsurf authored Oct 21, 2024
1 parent 8ec1bad commit 9f72e2e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion static/js/constants/name-patterns.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Regex patterns to for validating account names.
*/
export const NAME_PATTERNS: any = {
TEAM_PATTERN: '^[a-z][a-z0-9]+$',
TEAM_PATTERN: '^([a-z0-9]+(?:[._-][a-z0-9]+)*)$',
ROBOT_PATTERN: '^[a-z][a-z0-9_]{1,254}$',
USERNAME_PATTERN: '^(?=.{2,255}$)([a-z0-9]+(?:[._-][a-z0-9]+)*)$',
};
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default function CreatePermissionDrawer(
nameLabel="Provide a name for your new team:"
descriptionLabel="Provide an optional description for your new team"
helperText="Enter a description to provide extra information to your teammates about this team:"
nameHelperText="Choose a name to inform your teammates about this team. Must match ^[a-z][a-z0-9]+$."
nameHelperText="Choose a name to inform your teammates about this team. Must match ^([a-z0-9]+(?:[._-][a-z0-9]+)*)$"
isModalOpen={isTeamModalOpen}
handleModalToggle={() => setIsTeamModalOpen(!isTeamModalOpen)}
handleWizardToggle={() => setIsTeamWizardOpen(!isTeamWizardOpen)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function TeamsAndMembershipList() {
nameLabel="Provide a name for your new team:"
descriptionLabel="Provide an optional description for your new team"
helperText="Enter a description to provide extra information to your teammates about this team:"
nameHelperText="Choose a name to inform your teammates about this team. Must match ^[a-z][a-z0-9]+$."
nameHelperText="Choose a name to inform your teammates about this team. Must match ^([a-z0-9]+(?:[._-][a-z0-9]+)*)$"
isModalOpen={isTeamModalOpen}
handleModalToggle={() => {
setIsTeamModalOpen(!isTeamModalOpen);
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/RepositoryDetails/RepositoryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default function RepositoryDetails() {
nameLabel="Provide a name for your new team:"
descriptionLabel="Provide an optional description for your new team"
helperText="Enter a description to provide extra information to your teammates about this team:"
nameHelperText="Choose a name to inform your teammates about this team. Must match ^[a-z][a-z0-9]+$."
nameHelperText="Choose a name to inform your teammates about this team. Must match ^([a-z0-9]+(?:[._-][a-z0-9]+)*)$"
isModalOpen={isTeamModalOpen}
handleModalToggle={() => setIsTeamModalOpen(!isTeamModalOpen)}
validateName={validateTeamName}
Expand Down

0 comments on commit 9f72e2e

Please sign in to comment.