diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-04-23 11:27:05 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-04-23 11:27:11 +0200 |
commit | 2ce25079bcbcffec9e7647c56d3fc151e7469aad (patch) | |
tree | 4398b9407fe77d79ea9840a0033a33e458cf36e8 | |
parent | 00760dd30863e7d113bc7885bc61faf40df8a68e (diff) | |
download | sonarqube-2ce25079bcbcffec9e7647c56d3fc151e7469aad.tar.gz sonarqube-2ce25079bcbcffec9e7647c56d3fc151e7469aad.zip |
SONAR-5157 Add a link to the Quality Gate in the Description widget
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb | 22 | ||||
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/l10n/core.properties | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb index 329f301139a..2032027f451 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb @@ -24,6 +24,26 @@ <td><span id="resource_profile"><%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%></span> (<%= message('widget.description.profile_version_x', :params => format_measure('profile_version', :default => '1')) -%>)</td> </tr> <% end %> + <% + using_default=false + quality_gate=Property.value('sonar.qualitygate', @resource && @resource.id, nil) + unless quality_gate + quality_gate=Property.value('sonar.qualitygate', nil, nil) + using_default=false || quality_gate + end + if quality_gate + qgate = Internal.quality_gates.get(quality_gate.to_i) + %> + <tr> + <td><%= message('widget.description.qualitygate') -%>:</td> + <td><span id="resource_qgate"><%= link_to qgate.getName(), (url_for :controller => '/quality_gates') + '#show/' + quality_gate, :id => 'qgate_link' -%> + <% if using_default %> + <span class="subtitle">(<%= message('default') -%>)</span> + <% end %> + </span> + </td> + </tr> + <% end %> <% unless @project.project_links.empty? %> <tr> <td valign="top"><%= message('widget.description.links') -%>: </td> @@ -44,4 +64,4 @@ <% end %> </tbody> </table> -</div>
\ No newline at end of file +</div> diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index c9a1ae7140a..fc43b1470e4 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -1053,6 +1053,7 @@ widget.description.key=Key widget.description.language=Language widget.description.profile=Profile widget.description.profile_version_x=version {0} +widget.description.qualitygate=Quality Gate widget.description.alerts=Displays a summary of the project's quality gate status. widget.description.alerts_rss_feed=RSS Feed widget.description.links=Links |