summaryrefslogtreecommitdiff
path: root/app/helpers/todos_helper.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /app/helpers/todos_helper.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r--app/helpers/todos_helper.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index 0211a22a8c4..41f39c7e798 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -53,6 +53,8 @@ module TodosHelper
end
def todo_target_type_name(todo)
+ return _('design') if todo.for_design?
+
todo.target_type.titleize.downcase
end
@@ -63,6 +65,8 @@ module TodosHelper
if todo.for_commit?
project_commit_path(todo.project, todo.target, path_options)
+ elsif todo.for_design?
+ todos_design_path(todo, path_options)
else
path = [todo.resource_parent, todo.target]
@@ -151,7 +155,8 @@ module TodosHelper
[
{ id: '', text: 'Any Type' },
{ id: 'Issue', text: 'Issue' },
- { id: 'MergeRequest', text: 'Merge Request' }
+ { id: 'MergeRequest', text: 'Merge Request' },
+ { id: 'DesignManagement::Design', text: 'Design' }
]
end
@@ -188,6 +193,18 @@ module TodosHelper
private
+ def todos_design_path(todo, path_options)
+ design = todo.target
+
+ designs_project_issue_path(
+ todo.resource_parent,
+ design.issue,
+ path_options.merge(
+ vueroute: design.filename
+ )
+ )
+ end
+
def todo_action_subject(todo)
todo.self_added? ? 'yourself' : 'you'
end