From 8af3be80ecbf2936d050a5360cd95603fa81fda0 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 29 Nov 2012 17:13:35 +0100 Subject: [PATCH] SONAR-2342 Find the right location for resource icon => It can be provided by a plugin (like DevCockpit), so the Java API must be used for that purpose. --- .../WEB-INF/app/views/layouts/_user_panel.html.erb | 2 +- .../src/main/webapp/javascripts/recent-history.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_user_panel.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_user_panel.html.erb index 705fe5158b2..c4c2635f0c6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_user_panel.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_user_panel.html.erb @@ -45,6 +45,6 @@ } else { sonarRecentHistory.add('<%= @resource ? @resource.key : "" -%>', '<%= @resource ? @resource.name(true) : "" -%>', - '<%= @resource ? @resource.qualifier : "" -%>'); + '<%= @resource ? Java::OrgSonarServerUi::JRubyFacade.getInstance().getResourceType(@resource.qualifier).getIconPath() : "" -%>'); } \ No newline at end of file diff --git a/sonar-server/src/main/webapp/javascripts/recent-history.js b/sonar-server/src/main/webapp/javascripts/recent-history.js index 9368502d870..1bb4aed9c10 100644 --- a/sonar-server/src/main/webapp/javascripts/recent-history.js +++ b/sonar-server/src/main/webapp/javascripts/recent-history.js @@ -23,11 +23,11 @@ Sonar.RecentHistory.prototype.clear = function () { localStorage.clear(); }; -Sonar.RecentHistory.prototype.add = function (resourceKey, resourceName, resourceQualifier) { +Sonar.RecentHistory.prototype.add = function (resourceKey, resourceName, iconPath) { var sonarHistory = this.getRecentHistory(); if (resourceKey != '') { - var newEntry = {'key': resourceKey, 'name': resourceName, 'qualifier': resourceQualifier}; + var newEntry = {'key': resourceKey, 'name': resourceName, 'iconPath': iconPath}; // removes the element of the array if it exists for (i = 0; i < sonarHistory.length; i++) { var item = sonarHistory[i]; @@ -56,9 +56,8 @@ Sonar.RecentHistory.prototype.populateRecentHistoryPanel = function () { recentHistory.forEach(function (resource) { historyLinksList.append('