diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-11 11:19:03 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-11 11:19:03 +0100 |
commit | 5d5ccf52dcbd3968a5addbe8551efcfcfa673b47 (patch) | |
tree | cc3ba11c2e8b6cea73d80a254111586d4313180f /sonar-server | |
parent | ae07700eab2ff9d072380aca5b607d4c47300802 (diff) | |
download | sonarqube-5d5ccf52dcbd3968a5addbe8551efcfcfa673b47.tar.gz sonarqube-5d5ccf52dcbd3968a5addbe8551efcfcfa673b47.zip |
SONAR-3825 use abbreviations of period labels
Diffstat (limited to 'sonar-server')
3 files changed, 16 insertions, 6 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java b/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java index fbeb700e60e..ef7c50933ca 100644 --- a/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java +++ b/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java @@ -320,7 +320,7 @@ public final class JRubyFacade { public void ruleSeverityChanged(int parentProfileId, int activeRuleId, int oldSeverityId, int newSeverityId, String userName) { getProfilesManager().ruleSeverityChanged(parentProfileId, activeRuleId, RulePriority.values()[oldSeverityId], - RulePriority.values()[newSeverityId], userName); + RulePriority.values()[newSeverityId], userName); } public void ruleDeactivated(int parentProfileId, int deactivatedRuleId, String userName) { @@ -516,10 +516,10 @@ public final class JRubyFacade { // notifier is null when creating the administrator in the migration script 011. if (notifier != null) { notifier.onNewUser(NewUserHandler.Context.builder() - .setLogin(fields.get("login")) - .setName(fields.get("name")) - .setEmail(fields.get("email")) - .build()); + .setLogin(fields.get("login")) + .setName(fields.get("name")) + .setEmail(fields.get("email")) + .build()); } } @@ -534,4 +534,8 @@ public final class JRubyFacade { public String getPeriodLabel(String mode, String param, Date date) { return get(Periods.class).label(mode, param, date); } + + public String getPeriodAbbreviation(int periodIndex) { + return get(Periods.class).abbreviation(periodIndex); + } } diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb index 20a93929340..7e79a383ce3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb @@ -26,7 +26,7 @@ module MeasuresHelper html=h(column.title_label) end if column.period - html += "<br><span class='note'>#{Api::Utils.period_label(column.period)}</small>" + html += "<br><span class='note'>#{Api::Utils.period_abbreviation(column.period)}</small>" end if filter.sort_key==column.key html << (filter.sort_asc? ? image_tag("asc12.png") : image_tag("desc12.png")) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb index 35adebd944c..5a96b151aa3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb @@ -185,4 +185,10 @@ class Api::Utils def self.period_label(index) java_facade.getPeriodLabel(index) end + + # Abbreviated label of global periods + # index is in [1..3] + def self.period_abbreviation(index) + java_facade.getPeriodAbbreviation(index) + end end |