Merge pull request #1667 from mlorb/ml-sci-3304

Fix links in activity message for protocols in repository [SCI-3304]
This commit is contained in:
mlorb 2019-04-15 11:55:08 +02:00 committed by GitHub
commit 1e3d0e901a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -72,8 +72,12 @@ module GlobalActivitiesHelper
end
end
when Protocol
if obj.in_repository?
path = protocols_path
if obj.in_repository_public?
path = protocols_path(type: :public)
elsif obj.in_repository_private?
path = protocols_path(type: :private)
elsif obj.in_repository_archived?
path = protocols_path(type: :archive)
elsif obj.my_module.navigable?
path = protocols_my_module_path(obj.my_module)
else

View file

@ -7,9 +7,12 @@
<% end %>
<% if subject %>
<% if subject.in_repository? %>
<% type = :public if subject.in_repository_public? %>
<% type = :private if subject.in_repository_private? %>
<% type = :archive if subject.in_repository_archived? %>
<div class="ga-breadcrumb">
<span class="fas fa-edit"></span>
<%= route_to_other_team protocols_path(team: subject.team),
<%= route_to_other_team protocols_path(team: subject.team, type: type),
team,
subject.name&.truncate(Constants::NAME_TRUNCATION_LENGTH),
title: subject.name %>