summaryrefslogtreecommitdiff
path: root/app/helpers/selects_helper.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 11:33:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 11:33:21 +0000
commit7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch)
tree5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/helpers/selects_helper.rb
parent185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff)
downloadgitlab-ce-7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0.tar.gz
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/helpers/selects_helper.rb')
-rw-r--r--app/helpers/selects_helper.rb40
1 files changed, 0 insertions, 40 deletions
diff --git a/app/helpers/selects_helper.rb b/app/helpers/selects_helper.rb
index 14ee6007a43..99da9a7af6c 100644
--- a/app/helpers/selects_helper.rb
+++ b/app/helpers/selects_helper.rb
@@ -1,30 +1,6 @@
# frozen_string_literal: true
module SelectsHelper
- def users_select_tag(id, opts = {})
- css_class = ["ajax-users-select"]
- css_class << "multiselect" if opts[:multiple]
- css_class << "skip_ldap" if opts[:skip_ldap]
- css_class << (opts[:class] || '')
- value = opts[:selected] || ''
- html = {
- class: css_class.join(' '),
- data: users_select_data_attributes(opts)
- }
-
- unless opts[:scope] == :all
- project = opts[:project] || @project
-
- if project
- html['data-project-id'] = project.id
- elsif @group
- html['data-group-id'] = @group.id
- end
- end
-
- hidden_field_tag(id, value, html)
- end
-
def groups_select_tag(id, opts = {})
classes = Array.wrap(opts[:class])
classes << 'ajax-groups-select'
@@ -68,22 +44,6 @@ module SelectsHelper
hidden_field_tag(id, value, opts)
end
-
- private
-
- def users_select_data_attributes(opts)
- {
- placeholder: opts[:placeholder] || 'Search for a user',
- null_user: opts[:null_user] || false,
- any_user: opts[:any_user] || false,
- email_user: opts[:email_user] || false,
- first_user: opts[:first_user] && current_user ? current_user.username : false,
- current_user: opts[:current_user] || false,
- author_id: opts[:author_id] || '',
- skip_users: opts[:skip_users] ? opts[:skip_users].map(&:id) : nil,
- qa_selector: opts[:qa_selector] || ''
- }
- end
end
SelectsHelper.prepend_mod_with('SelectsHelper')