Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-08-07 19:24:45 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2018-08-07 19:24:45 +0300
commit4ccecb8f898f5ef3f4e0fe5aee8319996cbb3252 (patch)
treef230e3d9f097a0d669e5faf92cae7a699dfd865b
parentbe1c45f7d0067a465a448cb4392330ea0c37d5ae (diff)
parentb06eb8c85d4fa00f5f530b5d74b3284c390ee99a (diff)
Merge branch 'ce-5666-backport' into 'master'
CE port of "List groups with developer maintainer access on project creation" See merge request gitlab-org/gitlab-ce!21051
-rw-r--r--app/helpers/namespaces_helper.rb9
-rw-r--r--app/views/projects/_new_project_fields.html.haml8
-rw-r--r--changelogs/unreleased/ce-5666-backport.yml5
-rw-r--r--qa/qa/page/project/new.rb2
4 files changed, 17 insertions, 7 deletions
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index 66aaf055cf2..30585cb403d 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -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
diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml
index c78baa5dfe4..ad8c7911fad 100644
--- a/app/views/projects/_new_project_fields.html.haml
+++ b/app/views/projects/_new_project_fields.html.haml
@@ -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) + '/' }
diff --git a/changelogs/unreleased/ce-5666-backport.yml b/changelogs/unreleased/ce-5666-backport.yml
new file mode 100644
index 00000000000..344f1a1983f
--- /dev/null
+++ b/changelogs/unreleased/ce-5666-backport.yml
@@ -0,0 +1,5 @@
+---
+title: CE port of "List groups with developer maintainer access on project creation"
+merge_request: 21051
+author:
+type: other
diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb
index 9e812fa7c74..1fb569b0f29 100644
--- a/qa/qa/page/project/new.rb
+++ b/qa/qa/page/project/new.rb
@@ -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'"