Commit 5567b773 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'update-project-regex' into 'master'

Allow broader set of emojis in project names

Closes #196160

See merge request gitlab-org/gitlab!22776
parents eca77e31 ba09f86e
---
title: Allow Unicode 11 emojis in project names
merge_request: 22776
author: Harm Berntsen
type: changed
...@@ -5,7 +5,7 @@ module Gitlab ...@@ -5,7 +5,7 @@ module Gitlab
extend self extend self
def project_name_regex def project_name_regex
@project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9c0}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9c0}_\. ]*\z/.freeze @project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_\. ]*\z/.freeze
end end
def project_name_regex_message def project_name_regex_message
......
...@@ -59,8 +59,8 @@ describe 'Projects > Settings > User renames a project' do ...@@ -59,8 +59,8 @@ describe 'Projects > Settings > User renames a project' do
context 'with emojis' do context 'with emojis' do
it 'shows error for invalid project name' do it 'shows error for invalid project name' do
change_name(project, '🚀 foo bar ☁️') change_name(project, '🧮 foo bar ☁️')
expect(page).to have_field 'Project name', with: '🚀 foo bar ☁️' expect(page).to have_field 'Project name', with: '🧮 foo bar ☁️'
expect(page).not_to have_content "Name can contain only letters, digits, emojis '_', '.', dash and space. It must start with letter, digit, emoji or '_'." expect(page).not_to have_content "Name can contain only letters, digits, emojis '_', '.', dash and space. It must start with letter, digit, emoji or '_'."
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment