diff --git a/app/controllers/admin/tasks_controller.rb b/app/controllers/admin/tasks_controller.rb index aaf8521f18..c46fc9651c 100644 --- a/app/controllers/admin/tasks_controller.rb +++ b/app/controllers/admin/tasks_controller.rb @@ -17,7 +17,7 @@ def show @notes = @claim.notes.automated.by_label(params[:name]) @task_pagination = Admin::TaskPagination.new(claim: @claim, current_task_name:) - render @task.name + render task_view(@task) end def create @@ -78,4 +78,16 @@ def load_matching_claims def current_task_name @task.name end + + def task_view(task) + policy = task.claim.policy + policy_path = policy.to_s.underscore + policy_scoped_task_name = "#{policy_path}/#{task.name}" + + if lookup_context.template_exists?(policy_scoped_task_name, [params[:controller]], false) + "admin/tasks/#{policy_scoped_task_name}" + else + task.name + end + end end