From 8e1a0999d2ffba50c269488828e4c72edbba37cb Mon Sep 17 00:00:00 2001 From: spandev <143828642+Spandan-Mishra@users.noreply.github.com> Date: Sat, 22 Nov 2025 21:19:28 +0530 Subject: [PATCH] fix: added pattern checking for urls while creating a team (#24777) * fix: added pattern checking for urls while creating a team * update: used slugify and replace logic * update * Fix formatting of rules in CreateANewTeamForm --------- Co-authored-by: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com> Co-authored-by: Anik Dhabal Babu Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> --- apps/web/public/static/locales/en/common.json | 1 + packages/features/ee/teams/components/CreateANewTeamForm.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 34643b62a3..5d7c54f44a 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -2022,6 +2022,7 @@ "must_enter_team_name": "Must enter a team name", "team_url_required": "Must enter a team URL", "url_taken": "This URL is already taken", + "url_alphanumeric_invalid": "Url can only have alphanumeric characters(a-z, 0-9) and hyphen(-) symbol.", "problem_registering_domain": "There was a problem with registering the subdomain, please try again or contact an administrator", "team_publish": "Publish team", "number_text_notifications": "Phone number (Text notifications)", diff --git a/packages/features/ee/teams/components/CreateANewTeamForm.tsx b/packages/features/ee/teams/components/CreateANewTeamForm.tsx index 690583a0bf..3b09801555 100644 --- a/packages/features/ee/teams/components/CreateANewTeamForm.tsx +++ b/packages/features/ee/teams/components/CreateANewTeamForm.tsx @@ -147,7 +147,7 @@ export const CreateANewTeamForm = (props: CreateANewTeamFormProps) => { value={value} defaultValue={value} onChange={(e) => { - newTeamFormMethods.setValue("slug", slugify(e?.target.value, true), { + newTeamFormMethods.setValue("slug", slugify(e?.target.value, true).replace(/\./g, ""), { shouldTouch: true, }); newTeamFormMethods.clearErrors("slug");