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
15fe3fbe
Commit
15fe3fbe
authored
Feb 28, 2020
by
Catalin Irimie
Committed by
Phil Hughes
Feb 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes namespace_id for user with no groups import
parent
0d0f211d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
app/views/import/shared/_new_project_form.html.haml
app/views/import/shared/_new_project_form.html.haml
+1
-1
changelogs/unreleased/cat-fix-namespaceid-import-39078.yml
changelogs/unreleased/cat-fix-namespaceid-import-39078.yml
+5
-0
spec/views/import/gitlab_projects/new.html.haml_spec.rb
spec/views/import/gitlab_projects/new.html.haml_spec.rb
+4
-3
No files found.
app/views/import/shared/_new_project_form.html.haml
View file @
15fe3fbe
...
...
@@ -15,7 +15,7 @@
.input-group-prepend.static-namespace.has-tooltip
{
title:
user_url
(
current_user
.
username
)
+
'/'
}
.input-group-text.border-0
#{
user_url
(
current_user
.
username
)
}
/
=
hidden_field_tag
:namespace_id
,
value:
current_user
.
namespace_id
=
hidden_field_tag
:namespace_id
,
current_user
.
namespace_id
.form-group.col-12.col-sm-6.project-path
=
label_tag
:path
,
_
(
'Project slug'
),
class:
'label-bold'
=
text_field_tag
:path
,
@path
,
placeholder:
"my-awesome-project"
,
class:
"js-path-name form-control"
,
tabindex:
2
,
required:
true
changelogs/unreleased/cat-fix-namespaceid-import-39078.yml
0 → 100644
View file @
15fe3fbe
---
title
:
Fixes project import failures when user is not part of any groups
merge_request
:
26038
author
:
type
:
fixed
spec/views/import/gitlab_projects/new.html.haml_spec.rb
View file @
15fe3fbe
...
...
@@ -5,17 +5,18 @@ require 'spec_helper'
describe
'import/gitlab_projects/new.html.haml'
do
include
Devise
::
Test
::
ControllerHelpers
let
(
:user
)
{
build_stubbed
(
:user
,
namespace:
build_stubbed
(
:namespace
))
}
let
(
:namespace
)
{
build_stubbed
(
:namespace
)
}
let
(
:user
)
{
build_stubbed
(
:user
,
namespace:
namespace
)
}
before
do
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
end
context
'when the user has no other namespaces'
do
it
'
shows a namespace_id hidden field tag
'
do
it
'
adds a namespace_id hidden field tag with the namespace id as value
'
do
render
expect
(
rendered
).
to
have_css
(
'input[name="namespace_id"]'
,
count:
1
,
visible:
false
)
expect
(
rendered
).
to
have_css
(
"input[name='namespace_id'][value='
#{
namespace
.
id
}
']"
,
count:
1
,
visible:
false
)
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