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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b6981d9b
Commit
b6981d9b
authored
May 26, 2021
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow url without .git suffix for import
- Relax validation for project import Changelog: changed
parent
252e1089
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
24 deletions
+5
-24
app/views/projects/_import_project_pane.html.haml
app/views/projects/_import_project_pane.html.haml
+1
-1
app/views/shared/_import_form.html.haml
app/views/shared/_import_form.html.haml
+2
-8
ee/spec/features/projects/new_project_spec.rb
ee/spec/features/projects/new_project_spec.rb
+2
-2
locale/gitlab.pot
locale/gitlab.pot
+0
-3
spec/features/projects/new_project_spec.rb
spec/features/projects/new_project_spec.rb
+0
-10
No files found.
app/views/projects/_import_project_pane.html.haml
View file @
b6981d9b
...
...
@@ -83,7 +83,7 @@
.js-toggle-content.toggle-import-form
{
class:
(
'hide'
if
active_tab
!=
'import'
)
}
=
form_for
@project
,
html:
{
class:
'new_project
gl-show-field-errors
'
}
do
|
f
|
=
form_for
@project
,
html:
{
class:
'new_project'
}
do
|
f
|
%hr
=
render
"shared/import_form"
,
f:
f
=
render
'projects/new_project_fields'
,
f:
f
,
project_name_id:
"import-url-name"
,
hide_init_with_readme:
true
,
track_label:
track_label
app/views/shared/_import_form.html.haml
View file @
b6981d9b
...
...
@@ -6,14 +6,8 @@
=
f
.
label
:import_url
,
class:
'label-bold'
do
%span
=
_
(
'Git repository URL'
)
=
f
.
text_field
:import_url
,
value:
import_url
.
sanitized_url
,
autocomplete:
'off'
,
class:
'form-control gl-form-input'
,
placeholder:
'https://gitlab.company.com/group/project.git'
,
required:
true
,
pattern:
'(?:git|https?):\/\/.*/.*\.git$'
,
title:
_
(
'Please provide a valid URL ending with .git'
)
=
f
.
text_field
:import_url
,
value:
import_url
.
sanitized_url
,
autocomplete:
'off'
,
class:
'form-control gl-form-input'
,
placeholder:
'https://gitlab.company.com/group/project.git'
,
required:
true
.row
.form-group.col-md-6
...
...
ee/spec/features/projects/new_project_spec.rb
View file @
b6981d9b
...
...
@@ -74,7 +74,7 @@ RSpec.describe 'New project', :js do
page
.
within
'#import-project-pane'
do
first
(
'.js-import-git-toggle-button'
).
click
fill_in
'project_import_url'
,
with:
'http://foo
/bar
.git'
fill_in
'project_import_url'
,
with:
'http://foo.git'
fill_in
'project_name'
,
with:
'import-project-with-features1'
fill_in
'project_path'
,
with:
'import-project-with-features1'
choose
'project_visibility_level_20'
...
...
@@ -94,7 +94,7 @@ RSpec.describe 'New project', :js do
page
.
within
'#ci-cd-project-pane'
do
find
(
'.js-import-git-toggle-button'
).
click
fill_in
'project_import_url'
,
with:
'http://foo
/bar
.git'
fill_in
'project_import_url'
,
with:
'http://foo.git'
fill_in
'project_name'
,
with:
'CI CD Project1'
fill_in
'project_path'
,
with:
'ci-cd-project1'
choose
'project_visibility_level_20'
...
...
locale/gitlab.pot
View file @
b6981d9b
...
...
@@ -24705,9 +24705,6 @@ msgstr ""
msgid "Please provide a valid URL"
msgstr ""
msgid "Please provide a valid URL ending with .git"
msgstr ""
msgid "Please provide a valid URL."
msgstr ""
...
...
spec/features/projects/new_project_spec.rb
View file @
b6981d9b
...
...
@@ -356,16 +356,6 @@ RSpec.describe 'New project', :js do
expect
(
git_import_instructions
).
to
have_content
'Git repository URL'
end
it
'reports error if repo URL does not end with .git'
do
fill_in
'project_import_url'
,
with:
'http://foo/bar'
fill_in
'project_name'
,
with:
'import-project-without-git-suffix'
fill_in
'project_path'
,
with:
'import-project-without-git-suffix'
click_button
'Create project'
expect
(
page
).
to
have_text
(
'Please provide a valid URL ending with .git'
)
end
it
'keeps "Import project" tab open after form validation error'
do
collision_project
=
create
(
:project
,
name:
'test-name-collision'
,
namespace:
user
.
namespace
)
...
...
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