diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-06-01 00:01:05 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-06-01 19:31:28 +0400 |
commit | 94c39df6941f641936159e3d3bed0d2bd6120c07 (patch) | |
tree | 83252f316744ae3ecdee60b008141b47be680c00 /sonar-plugin-api | |
parent | b41cf6f330551a3ffc247249fdfda45a095fb46c (diff) | |
download | sonarqube-94c39df6941f641936159e3d3bed0d2bd6120c07.tar.gz sonarqube-94c39df6941f641936159e3d3bed0d2bd6120c07.zip |
SONAR-1922 Improve UI for profile changelog
* Removed useless version column from Quality Profiles page.
* To improve readability - version of profile displayed in a dedicated
column on Changelog page, otherwise it can be difficult to determine
version associated to a row.
* Allowed to select both versions to compare.
* CSS attribute "word-wrap" was set to "break-word" to decrease width of
table, when parameter value too huge. Tested in Chromimum 12.0.742.68
and in Firefox 3.6.17.
* Version of profile was added to widget.
* Save and show username instead of login.
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachineQuery.java | 8 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleChange.java | 43 |
2 files changed, 18 insertions, 33 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachineQuery.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachineQuery.java index 20b0ee861c0..13f8818d0bc 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachineQuery.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachineQuery.java @@ -19,8 +19,6 @@ */ package org.sonar.api.batch; -import org.apache.commons.lang.builder.EqualsBuilder; - import com.google.common.collect.Lists; import org.apache.commons.lang.builder.ToStringBuilder; import org.sonar.api.measures.Metric; @@ -233,10 +231,4 @@ public class TimeMachineQuery { .append("to", to) .toString(); } - - @Override - public boolean equals(Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); - } - } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleChange.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleChange.java index a3b95213220..e9373e73bc8 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleChange.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleChange.java @@ -19,37 +19,30 @@ */ package org.sonar.api.rules; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; import org.sonar.api.database.BaseIdentifiable; import org.sonar.api.profiles.RulesProfile; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import javax.persistence.*; + /** * A class to map a RuleChange to the hibernate model - * + * * @since 2.9 */ @Entity @Table(name = "active_rule_changes") public class ActiveRuleChange extends BaseIdentifiable { - @Column(name = "user_login", updatable = false, nullable = false) - private String modifierLogin; + @Column(name = "user_name", updatable = false, nullable = false) + private String userName; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "profile_id", updatable = false, nullable = false) @@ -80,12 +73,12 @@ public class ActiveRuleChange extends BaseIdentifiable { @Column(name = "new_severity", updatable = false, nullable = true) @Enumerated(EnumType.ORDINAL) private RulePriority newSeverity; - + @OneToMany(mappedBy = "activeRuleChange", fetch = FetchType.LAZY, cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE }) private List<ActiveRuleParamChange> activeRuleParamChanges = new ArrayList<ActiveRuleParamChange>(); - public ActiveRuleChange(String modifierLogin, RulesProfile profile, Rule rule) { - this.modifierLogin = modifierLogin; + public ActiveRuleChange(String userName, RulesProfile profile, Rule rule) { + this.userName = userName; this.rulesProfile = profile; this.profileVersion = profile.getVersion(); this.rule = rule; @@ -150,8 +143,8 @@ public class ActiveRuleChange extends BaseIdentifiable { return activeRuleParamChanges; } - public String getModifierLogin() { - return modifierLogin; + public String getUserName() { + return userName; } public ActiveRuleChange setParameterChange(String key, String oldValue, String newValue) { @@ -176,7 +169,7 @@ public class ActiveRuleChange extends BaseIdentifiable { ActiveRuleChange rhs = (ActiveRuleChange) obj; return new EqualsBuilder() .appendSuper(super.equals(obj)) - .append(modifierLogin, rhs.modifierLogin) + .append(userName, rhs.userName) .append(rulesProfile, rhs.rulesProfile) .append(rule, rhs.rule) .append(date, rhs.date) @@ -188,7 +181,7 @@ public class ActiveRuleChange extends BaseIdentifiable { @Override public int hashCode() { return new HashCodeBuilder(41, 33) - .append(modifierLogin) + .append(userName) .append(rulesProfile) .append(rule) .append(date) @@ -203,7 +196,7 @@ public class ActiveRuleChange extends BaseIdentifiable { .append("id", getId()) .append("profile", rulesProfile) .append("rule", rule) - .append("modifier", modifierLogin) + .append("modifier", userName) .append("changed at", date) .append("enabled", enabled) .append("new severity", newSeverity) |