diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-03-13 13:28:59 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-03-13 13:28:59 +0100 |
commit | c6d1b136d095f10f87ea250e2d0ebe8de46577dd (patch) | |
tree | 651eef851a768cd850533eecb4d5e91a5661dad6 /server/sonar-web | |
parent | 2e14b831a981ca87265e0a1ff30547fccacf7107 (diff) | |
download | sonarqube-c6d1b136d095f10f87ea250e2d0ebe8de46577dd.tar.gz sonarqube-c6d1b136d095f10f87ea250e2d0ebe8de46577dd.zip |
SONAR-6262 Fix display of links in components page
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/helpers/components_helper.rb | 14 | ||||
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/models/project_link.rb | 2 |
2 files changed, 8 insertions, 8 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("<i class='icon-#{link.link_type}' alt='#{link.name}'></i>", 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]<<link + @links_by_project_uuid[link.component_uuid] ||= [] + @links_by_project_uuid[link.component_uuid]<<link end end - @links_by_project_id + @links_by_project_uuid end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_link.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_link.rb index 66bd78f004c..1a11f230c4b 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_link.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_link.rb @@ -18,7 +18,7 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # class ProjectLink < ActiveRecord::Base - belongs_to :project, :foreign_key => 'uuid', :primary_key => 'component_uuid' + belongs_to :project, :foreign_key => 'component_uuid', :primary_key => 'uuid' LINK_HOMEPAGE = "homepage" LINK_CONTINUOUS_INTEGRATION = "ci" |