From 0eecc9419c2a55f5e35d8e6c08820fbfd19ef178 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Fri, 25 Nov 2016 18:18:45 +0000 Subject: Merge branch '24903-allow-groups-with-special-characters' into 'master' Allow dots in group names to pass validation for Create Group and Edit Group forms ## What does this MR do? Allows dots within group names to pass form validation when creating or editing a group. ## Are there points in the code the reviewer needs to double check? Nope, pretty straight forward. ## Why was this MR needed? Although group names with dots are allowed, our frontend validation mistakenly invalidates them ## Screenshots (if relevant) #### Before: ![Screen_Shot_2016-11-23_at_4.55.03_PM](/uploads/006ee5f694de1c98e0df0b0ccd3807ee/Screen_Shot_2016-11-23_at_4.55.03_PM.png) #### After: ![Screen_Shot_2016-11-23_at_4.52.42_PM](/uploads/693f112fb309005b0df714b32c99f25e/Screen_Shot_2016-11-23_at_4.52.42_PM.png) ![Screen_Shot_2016-11-23_at_4.51.53_PM](/uploads/7bdb5fca92995d18a7f38d9150eb260c/Screen_Shot_2016-11-23_at_4.51.53_PM.png) ## Does this MR meet the acceptance criteria? - [ ] ~~[Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added~~ - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [ ] ~~API support added~~ - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Related to: #24622 Closes #24903 See merge request !7723 --- app/views/shared/_group_form.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_group_form.html.haml b/app/views/shared/_group_form.html.haml index ba25e09d638..0bc851b4256 100644 --- a/app/views/shared/_group_form.html.haml +++ b/app/views/shared/_group_form.html.haml @@ -13,8 +13,9 @@ .input-group-addon = root_url = f.text_field :path, placeholder: 'open-source', class: 'form-control', - autofocus: local_assigns[:autofocus] || false, pattern: "[a-zA-Z0-9-_]+", - required: true, title: 'Please choose a group name with no special characters.' + autofocus: local_assigns[:autofocus] || false, required: true, + pattern: Gitlab::Regex::NAMESPACE_REGEX_STR_SIMPLE, + title: 'Please choose a group name with no special characters.' - if @group.persisted? .alert.alert-warning.prepend-top-10 -- cgit v1.2.1