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:
authorJan Provaznik <jprovaznik@gitlab.com>2018-06-29 11:12:40 +0300
committerJarka Kadlecová <jarka@gitlab.com>2018-07-03 10:34:44 +0300
commit6f8ececc02b82813a4f01e6cd93f38bcabe20ff0 (patch)
treea900b913c5e2fd619ac1fa14c8dbec87550c3e04 /app/helpers/todos_helper.rb
parent7458ca8ebb093af93c01cb61dabca15fd0c995cb (diff)
Move todo_group_options to CE
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r--app/helpers/todos_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index 7d78ceb1f9a..2a097f1a0d3 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -167,4 +167,14 @@ module TodosHelper
def show_todo_state?(todo)
(todo.target.is_a?(MergeRequest) || todo.target.is_a?(Issue)) && %w(closed merged).include?(todo.target.state)
end
+
+ def todo_group_options
+ groups = current_user.authorized_groups
+
+ groups = groups.map do |group|
+ { id: group.id, text: group.full_name }
+ end
+
+ groups.unshift({ id: '', text: 'Any Group' }).to_json
+ end
end