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:
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