CE port of "List groups with developer maintainer access on project creation"
This commit is contained in:
parent
b211f7c253
commit
b06eb8c85d
4 changed files with 17 additions and 7 deletions
|
@ -3,11 +3,10 @@ module NamespacesHelper
|
|||
params.dig(:project, :namespace_id) || params[:namespace_id]
|
||||
end
|
||||
|
||||
def namespaces_options(selected = :current_user, display_path: false, extra_group: nil, groups_only: false)
|
||||
groups = current_user.manageable_groups
|
||||
.joins(:route)
|
||||
.includes(:route)
|
||||
.order('routes.path')
|
||||
def namespaces_options(selected = :current_user, display_path: false, groups: nil, extra_group: nil, groups_only: false)
|
||||
groups ||= current_user.manageable_groups
|
||||
.eager_load(:route)
|
||||
.order('routes.path')
|
||||
users = [current_user.namespace]
|
||||
selected_id = selected
|
||||
|
||||
|
|
|
@ -12,7 +12,13 @@
|
|||
.input-group-prepend.has-tooltip{ title: root_url }
|
||||
.input-group-text
|
||||
= root_url
|
||||
= f.select :namespace_id, namespaces_options(namespace_id_from(params) || :current_user, display_path: true, extra_group: namespace_id_from(params)), {}, { class: 'select2 js-select-namespace qa-project-namespace-select', tabindex: 1}
|
||||
- namespace_id = namespace_id_from(params)
|
||||
= f.select(:namespace_id,
|
||||
namespaces_options(namespace_id || :current_user,
|
||||
display_path: true,
|
||||
extra_group: namespace_id),
|
||||
{},
|
||||
{ class: 'select2 js-select-namespace qa-project-namespace-select', tabindex: 1})
|
||||
|
||||
- else
|
||||
.input-group-prepend.static-namespace.has-tooltip{ title: user_url(current_user.username) + '/' }
|
||||
|
|
5
changelogs/unreleased/ce-5666-backport.yml
Normal file
5
changelogs/unreleased/ce-5666-backport.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: CE port of "List groups with developer maintainer access on project creation"
|
||||
merge_request: 21051
|
||||
author:
|
||||
type: other
|
|
@ -10,7 +10,7 @@ module QA
|
|||
|
||||
view 'app/views/projects/_new_project_fields.html.haml' do
|
||||
element :project_namespace_select
|
||||
element :project_namespace_field, /select :namespace_id.*class: 'select2/
|
||||
element :project_namespace_field, 'namespaces_options'
|
||||
element :project_path, 'text_field :path'
|
||||
element :project_description, 'text_area :description'
|
||||
element :project_create_button, "submit 'Create project'"
|
||||
|
|
Loading…
Reference in a new issue