From c6d1b136d095f10f87ea250e2d0ebe8de46577dd Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 13 Mar 2015 13:28:59 +0100 Subject: [PATCH] SONAR-6262 Fix display of links in components page --- .../WEB-INF/app/helpers/components_helper.rb | 14 +++++++------- .../main/webapp/WEB-INF/app/models/project_link.rb | 2 +- .../org/sonar/core/component/ComponentLinkDto.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/components_helper.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/components_helper.rb index 0f4c9323fd4..ec76730db50 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/components_helper.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/components_helper.rb @@ -37,7 +37,7 @@ module ComponentsHelper content = snapshot.version || '' elsif column.links_column? - links = links_by_project_id[project.id] + links = links_by_project_uuid[project.uuid] if links links.each do |link| content << link_to("", link.href, :popup => true) unless link.custom? @@ -73,15 +73,15 @@ module ComponentsHelper nil end - def links_by_project_id - @links_by_project_id ||= {} - if @links_by_project_id.empty? + def links_by_project_uuid + @links_by_project_uuid ||= {} + if @links_by_project_uuid.empty? ProjectLink.find(:all, :order => 'link_type').each do |link| - @links_by_project_id[link.project_id] ||= [] - @links_by_project_id[link.project_id]< 'uuid', :primary_key => 'component_uuid' + belongs_to :project, :foreign_key => 'component_uuid', :primary_key => 'uuid' LINK_HOMEPAGE = "homepage" LINK_CONTINUOUS_INTEGRATION = "ci" diff --git a/sonar-core/src/main/java/org/sonar/core/component/ComponentLinkDto.java b/sonar-core/src/main/java/org/sonar/core/component/ComponentLinkDto.java index c1b272546a1..e8c416b9332 100644 --- a/sonar-core/src/main/java/org/sonar/core/component/ComponentLinkDto.java +++ b/sonar-core/src/main/java/org/sonar/core/component/ComponentLinkDto.java @@ -36,7 +36,7 @@ public class ComponentLinkDto { public static final String TYPE_SOURCES = "scm"; public static final String TYPE_SOURCES_DEV = "scm_dev"; - public static List PROVIDED_TYPES = ImmutableList.of(TYPE_HOME_PAGE, TYPE_CI, TYPE_ISSUE_TRACKER, TYPE_SOURCES, TYPE_SOURCES_DEV); + public static final List PROVIDED_TYPES = ImmutableList.of(TYPE_HOME_PAGE, TYPE_CI, TYPE_ISSUE_TRACKER, TYPE_SOURCES, TYPE_SOURCES_DEV); private Long id; private String componentUuid; -- 2.39.5