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
Léo-Paul Géneau
gitlab-ce
Commits
8d22ff8c
Commit
8d22ff8c
authored
Jul 31, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing spec in ./spec/features/projects/new_project_spec.rb
parent
d2fd6d23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
app/helpers/namespaces_helper.rb
app/helpers/namespaces_helper.rb
+10
-8
No files found.
app/helpers/namespaces_helper.rb
View file @
8d22ff8c
...
@@ -9,20 +9,22 @@ module NamespacesHelper
...
@@ -9,20 +9,22 @@ module NamespacesHelper
.
includes
(
:route
)
.
includes
(
:route
)
.
order
(
'routes.path'
)
.
order
(
'routes.path'
)
users
=
[
current_user
.
namespace
]
users
=
[
current_user
.
namespace
]
selected_option
=
nil
unless
extra_group
.
nil?
||
extra_group
.
is_a?
(
Group
)
unless
extra_group
.
nil?
||
extra_group
.
is_a?
(
Group
)
extra_group
=
Group
.
find
(
extra_group
)
if
Namespace
.
find
(
extra_group
).
kind
==
'group'
extra_group
=
Group
.
find
(
extra_group
)
if
Namespace
.
find
(
extra_group
).
kind
==
'group'
end
end
if
extra_group
&&
extra_group
.
is_a?
(
Group
)
if
extra_group
&&
extra_group
.
is_a?
(
Group
)
# Avoid duplicate groups if one already exists by that name
# Many importers create a temporary Group, so use the real
existing_group
=
Group
.
find_by
(
name:
extra_group
.
name
)
# group if one exists by that name to prevent duplicates.
extra_group
=
existing_group
if
existing_group
unless
extra_group
.
persisted?
existing_group
=
Group
.
find_by
(
name:
extra_group
.
name
)
extra_group
=
existing_group
if
existing_group
end
if
Ability
.
allowed?
(
current_user
,
:read_group
,
extra_group
)
if
Ability
.
allowed?
(
current_user
,
:read_group
,
extra_group
)
selected
=
extra_group
.
id
if
selected
==
:extra_group
groups
|=
[
extra_group
]
groups
|=
[
extra_group
]
selected_option
=
extra_group
.
id
if
selected
==
:extra_group
end
end
end
end
...
@@ -32,12 +34,12 @@ module NamespacesHelper
...
@@ -32,12 +34,12 @@ module NamespacesHelper
unless
groups_only
unless
groups_only
options
<<
options_for_group
(
users
,
display_path:
display_path
,
type:
'user'
)
options
<<
options_for_group
(
users
,
display_path:
display_path
,
type:
'user'
)
if
(
selected
==
:current_user
||
selected_option
.
nil?
)
&&
current_user
.
namespace
if
selected
==
:current_user
&&
current_user
.
namespace
selected
_option
=
current_user
.
namespace
.
id
selected
=
current_user
.
namespace
.
id
end
end
end
end
grouped_options_for_select
(
options
,
selected
_option
)
grouped_options_for_select
(
options
,
selected
)
end
end
def
namespace_icon
(
namespace
,
size
=
40
)
def
namespace_icon
(
namespace
,
size
=
40
)
...
...
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