diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-06-29 10:12:40 +0200 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-03 09:34:44 +0200 |
commit | 6f8ececc02b82813a4f01e6cd93f38bcabe20ff0 (patch) | |
tree | a900b913c5e2fd619ac1fa14c8dbec87550c3e04 /app/helpers/todos_helper.rb | |
parent | 7458ca8ebb093af93c01cb61dabca15fd0c995cb (diff) | |
download | gitlab-ce-6f8ececc02b82813a4f01e6cd93f38bcabe20ff0.tar.gz |
Move todo_group_options to CE
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r-- | app/helpers/todos_helper.rb | 10 |
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 |