]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5329 Replace id by key in /profiles/changelog
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 20 Jun 2014 13:18:05 +0000 (15:18 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 20 Jun 2014 13:21:23 +0000 (15:21 +0200)
sonar-core/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_tabs.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb

index f74268f63862d92be0052bfd6a8b95eaa83fa677..4e7bcc189575b985b68f475ef1b1743069e1b969 100644 (file)
@@ -1591,14 +1591,7 @@ quality_profiles.no_version=no version
 quality_profiles.last_version_x_with_date=last version {0} ({1})
 quality_profiles.version_x_with_date=version {0} ({1})
 quality_profiles.version_x=version {0}
-quality_profiles.profile_version=Profile version
-quality_profiles.severity_changed_from_x_to=Severity changed from {0}<b>{1}</b> to
-quality_profiles.severity_was_x=Severity was {0}<b>{1}</b>
-quality_profiles.severity_set_to_x=Severity set to {0}<b>{1}</b>
 quality_profiles.parameter_set_to_x=Parameter <b>{0}</b> set to <b>{1}</b>
-quality_profiles.parameter_was_x=Parameter <b>{0}</b> was <b>{1}</b>
-quality_profiles.parameter_reset_to_default_value_x=Parameter <b>{0}</b> reset to default value (was <b>{1}</b>)
-quality_profiles.parameter_changed_from_x_to_x=Parameter <b>{0}</b> changed from <b>{1}</b> to <b>{2}</b>
 quality_profiles.only_in_profile_x=Only in {0}
 quality_profiles.with_different_configuration=With different configuration
 quality_profiles.with_same_configuration=With same configuration
@@ -1622,11 +1615,12 @@ quality_profiles.including=including
 quality_profiles.deprecated=deprecated
 quality_profiles.manage_rules_tooltip=Manage rules of this profile
 quality_profiles.see_rules_tooltip=See rules of this profile
-quality_profiles.changelog.empty=No changes have been done.
 quality_profiles.changelog_from=Changelog from
+quality_profiles.changelog.empty=No changes have been done.
 quality_profiles.changelog.activated=Activated
 quality_profiles.changelog.deactivated=Deactivated
 quality_profiles.changelog.updated=Updated
+quality_profiles.changelog.parameter_reset_to_default_value_x=Parameter <b>{0}</b> reset to default value
 
 
 #------------------------------------------------------------------------------
index 27b70e9a7ca74515960f8bfb16369cfccc9b6572..04f4cd80389e46e06e5cbfb9a78da535fac06f6a 100644 (file)
@@ -241,11 +241,11 @@ class ProfilesController < ApplicationController
     redirect_to :action => 'inheritance', :id => params[:id]
   end
 
-  # GET /profiles/changelog?id=<profile id>
+  # GET /profiles/changelog?key=<profile key>
   def changelog
-    require_parameters 'id'
+    require_parameters 'key'
 
-    @profile = Internal.quality_profiles.profile(params[:id].to_i)
+    @profile = Internal.component(Java::OrgSonarServerQualityprofile::QProfileService.java_class).getByKey(params[:key])
     search = {'profileKeys' => @profile.key().to_s, 'since' => params[:since], 'to' => params[:to]}
     @changes = Internal.component(Java::OrgSonarServerActivity::RubyActivityService.java_class).search(search)
 
index 0e686faa0d6b8b9fabf2940db1a748391c54bd69..d11fd395eb8b64b914f79f61c0416dc0c8152a97 100644 (file)
@@ -16,7 +16,7 @@
     <a href="<%= url_for :controller => 'profiles', :action => 'inheritance', :id => @profile.id -%>" <%= "class='selected'" if selected_tab=='inheritance' -%> id="tab-inheritance"><%= message('quality_profiles.profile_inheritance') -%></a>
   </li>
   <li>
-    <a href="<%= url_for :controller => 'profiles', :action => 'changelog', :id => @profile.id -%>" <%= "class='selected'" if selected_tab=='changelog' -%> id="tab-changelog"><%= message('changelog') -%></a>
+    <a href="<%= url_for :controller => 'profiles', :action => 'changelog', :key => @profile.key() -%>" <%= "class='selected'" if selected_tab=='changelog' -%> id="tab-changelog"><%= message('changelog') -%></a>
   </li>
   <% if new_tab %>
   <li>
index 464adc6905c5b85b50992eeef244db57c1b4d416..ff8d29ff01b88726177e290c1dc2d2dd4f2da067 100644 (file)
@@ -6,7 +6,7 @@
     <%= message('quality_profiles.changelog.empty') -%>
   <% else %>
     <form class="marginbottom10" method="get" action="<%= ApplicationController.root_context %>/profiles/changelog">
-      <input name="id" type="hidden" value="<%= @profile.id %>"/>
+      <input name="key" type="hidden" value="<%= @profile.key() %>"/>
       <%= message('quality_profiles.changelog_from') -%>
       <input name="since" type="text" value="<%= params['since'] %>"/>
       <%= message('to').downcase -%>
             <br/>
           <% end %>
           <% change.parameters().each do |param_key, param_value| %>
-            <%= message('quality_profiles.parameter_set_to_x', :params => [param_key, param_value]) -%>
+            <% if !param_value.empty? %>
+              <%= message('quality_profiles.parameter_set_to_x', :params => [param_key, param_value]) -%>
+            <% else %>
+              <%= message('quality_profiles.changelog.parameter_reset_to_default_value_x', :params => [param_key]) -%>
+            <% end %>
             <br/>
           <% end %>
         </td>