Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
af941732
Commit
af941732
authored
Nov 11, 2016
by
Vincent Composieux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ability to put emojis into repository name
Added ability to put emojis into repository name
parent
d96ec63e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
13 deletions
+30
-13
changelogs/unreleased/repository-name-emojis
changelogs/unreleased/repository-name-emojis
+4
-0
config/database.yml.mysql
config/database.yml.mysql
+6
-6
doc/gitlab-basics/create-project.md
doc/gitlab-basics/create-project.md
+2
-2
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+3
-3
spec/features/projects/project_settings_spec.rb
spec/features/projects/project_settings_spec.rb
+15
-2
No files found.
changelogs/unreleased/repository-name-emojis
0 → 100644
View file @
af941732
---
title: Added ability to put emojis into repository name
merge_request: 7420
author: Vincent Composieux
config/database.yml.mysql
View file @
af941732
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
#
#
production:
production:
adapter: mysql2
adapter: mysql2
encoding: utf8
encoding: utf8
mb4
collation: utf8_general_ci
collation: utf8
mb4
_general_ci
reconnect: false
reconnect: false
database: gitlabhq_production
database: gitlabhq_production
pool: 10
pool: 10
...
@@ -18,8 +18,8 @@ production:
...
@@ -18,8 +18,8 @@ production:
#
#
development:
development:
adapter: mysql2
adapter: mysql2
encoding: utf8
encoding: utf8
mb4
collation: utf8_general_ci
collation: utf8
mb4
_general_ci
reconnect: false
reconnect: false
database: gitlabhq_development
database: gitlabhq_development
pool: 5
pool: 5
...
@@ -32,8 +32,8 @@ development:
...
@@ -32,8 +32,8 @@ development:
# Do not set this db to the same as development or production.
# Do not set this db to the same as development or production.
test: &test
test: &test
adapter: mysql2
adapter: mysql2
encoding: utf8
encoding: utf8
mb4
collation: utf8_general_ci
collation: utf8
mb4
_general_ci
reconnect: false
reconnect: false
database: gitlabhq_test
database: gitlabhq_test
pool: 5
pool: 5
...
...
doc/gitlab-basics/create-project.md
View file @
af941732
...
@@ -14,8 +14,8 @@ There are two ways to create a new project in GitLab.
...
@@ -14,8 +14,8 @@ There are two ways to create a new project in GitLab.
1.
Fill out the information:
1.
Fill out the information:
1.
"Project name" is the name of your project (you can't use sp
aces, but you
1.
"Project name" is the name of your project (you can't use sp
ecial characters,
can use hyphens or underscore
s).
but you can use spaces, hyphens, underscores or even emoji
s).
1.
The "Project description" is optional and will be shown in your project's
1.
The "Project description" is optional and will be shown in your project's
dashboard so others can briefly understand what your project is about.
dashboard so others can briefly understand what your project is about.
1.
Select a
[
visibility level
](
../public_access/public_access.md
)
.
1.
Select a
[
visibility level
](
../public_access/public_access.md
)
.
...
...
lib/gitlab/regex.rb
View file @
af941732
...
@@ -26,12 +26,12 @@ module Gitlab
...
@@ -26,12 +26,12 @@ module Gitlab
end
end
def
project_name_regex
def
project_name_regex
@project_name_regex
||=
/\A[\p{Alnum}
_][\p{Alnum}\p{Pd
}_\. ]*\z/
.
freeze
@project_name_regex
||=
/\A[\p{Alnum}
\u{00A9}-\u{1f9c0}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9c0
}_\. ]*\z/
.
freeze
end
end
def
project_name_regex_message
def
project_name_regex_message
"can contain only letters, digits,
'_', '.', dash and
space. "
\
"can contain only letters, digits,
emojis, '_', '.', dash,
space. "
\
"It must start with letter, digit or '_'."
"It must start with letter, digit
, emoji
or '_'."
end
end
def
project_path_regex
def
project_path_regex
...
...
spec/features/projects/project_settings_spec.rb
View file @
af941732
...
@@ -18,7 +18,7 @@ describe 'Edit Project Settings', feature: true do
...
@@ -18,7 +18,7 @@ describe 'Edit Project Settings', feature: true do
click_button
'Save changes'
click_button
'Save changes'
expect
(
page
).
to
have_field
'project_name_edit'
,
with:
'foo&bar'
expect
(
page
).
to
have_field
'project_name_edit'
,
with:
'foo&bar'
expect
(
page
).
to
have_content
"Name can contain only letters, digits,
'_', '.', dash and space. It must start with letter, digit
or '_'."
expect
(
page
).
to
have_content
"Name can contain only letters, digits,
emojis, '_', '.', dash, space. It must start with letter, digit, emoji
or '_'."
expect
(
page
).
to
have_button
'Save changes'
expect
(
page
).
to
have_button
'Save changes'
end
end
end
end
...
@@ -34,8 +34,21 @@ describe 'Edit Project Settings', feature: true do
...
@@ -34,8 +34,21 @@ describe 'Edit Project Settings', feature: true do
expect
(
page
).
to
have_field
'Project name'
,
with:
'foo&bar'
expect
(
page
).
to
have_field
'Project name'
,
with:
'foo&bar'
expect
(
page
).
to
have_field
'Path'
,
with:
'foo&bar'
expect
(
page
).
to
have_field
'Path'
,
with:
'foo&bar'
expect
(
page
).
to
have_content
"Name can contain only letters, digits,
'_', '.', dash and space. It must start with letter, digit
or '_'."
expect
(
page
).
to
have_content
"Name can contain only letters, digits,
emojis, '_', '.', dash, space. It must start with letter, digit, emoji
or '_'."
expect
(
page
).
to
have_content
"Path can contain only letters, digits, '_', '-' and '.'. Cannot start with '-', end in '.git' or end in '.atom'"
expect
(
page
).
to
have_content
"Path can contain only letters, digits, '_', '-' and '.'. Cannot start with '-', end in '.git' or end in '.atom'"
end
end
end
end
describe
'Rename repository name with emojis'
do
it
'shows error for invalid project name'
do
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
fill_in
'Project name'
,
with:
'🚀 foo bar ☁️'
click_button
'Rename project'
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 '_'."
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment