* 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.
%>
<tr>
<td>Profile:</td>
- <td id="resource_profile"><%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%></td>
+ <td id="resource_profile"><%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%> (version <%= format_measure('profile_version', :default => '1') -%>)</td>
</tr>
<% end %>
<% if Project::SCOPE_SET==@project.scope %>
*/
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;
.append("to", to)
.toString();
}
-
- @Override
- public boolean equals(Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj);
- }
-
}
*/
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)
@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;
return activeRuleParamChanges;
}
- public String getModifierLogin() {
- return modifierLogin;
+ public String getUserName() {
+ return userName;
}
public ActiveRuleChange setParameterChange(String key, String oldValue, String newValue) {
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)
@Override
public int hashCode() {
return new HashCodeBuilder(41, 33)
- .append(modifierLogin)
+ .append(userName)
.append(rulesProfile)
.append(rule)
.append(date)
.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)
*/
package org.sonar.server.configuration;
+import org.apache.commons.lang.ObjectUtils;
import org.codehaus.plexus.util.StringUtils;
import org.sonar.api.database.DatabaseSession;
import org.sonar.api.database.model.ResourceModel;
// Managing inheritance of profiles
- public ValidationMessages changeParentProfile(Integer profileId, String parentName, String userLogin) {
+ public ValidationMessages changeParentProfile(Integer profileId, String parentName, String userName) {
ValidationMessages messages = ValidationMessages.create();
RulesProfile profile = getSession().getEntity(RulesProfile.class, profileId);
if (profile != null && !profile.getProvided()) {
// Deactivate all inherited rules
if (oldParent != null) {
for (ActiveRule activeRule : oldParent.getActiveRules()) {
- deactivate(profile, activeRule.getRule(), userLogin);
+ deactivate(profile, activeRule.getRule(), userName);
}
}
// Activate all inherited rules
if (newParent != null) {
for (ActiveRule activeRule : newParent.getActiveRules()) {
- activateOrChange(profile, activeRule, userLogin);
+ activateOrChange(profile, activeRule, userName);
}
}
profile.setParentName(newParent == null ? null : newParent.getName());
/**
* Rule was activated
*/
- public void activated(int profileId, int activeRuleId, String userLogin) {
+ public void activated(int profileId, int activeRuleId, String userName) {
ActiveRule activeRule = getSession().getEntity(ActiveRule.class, activeRuleId);
RulesProfile profile = getSession().getEntity(RulesProfile.class, profileId);
- ruleEnabled(profile, activeRule, userLogin);
+ ruleEnabled(profile, activeRule, userName);
// Notify child profiles
- activatedOrChanged(profileId, activeRuleId, userLogin);
+ activatedOrChanged(profileId, activeRuleId, userName);
}
/**
* Rule param was changed
*/
- public void ruleParamChanged(int profileId, int activeRuleId, String paramKey, String oldValue, String newValue, String userLogin) {
+ public void ruleParamChanged(int profileId, int activeRuleId, String paramKey, String oldValue, String newValue, String userName) {
ActiveRule activeRule = getSession().getEntity(ActiveRule.class, activeRuleId);
RulesProfile profile = getSession().getEntity(RulesProfile.class, profileId);
- ruleParamChanged(profile, activeRule.getRule(), paramKey, oldValue, newValue, userLogin);
+ ruleParamChanged(profile, activeRule.getRule(), paramKey, oldValue, newValue, userName);
// Notify child profiles
- activatedOrChanged(profileId, activeRuleId, userLogin);
+ activatedOrChanged(profileId, activeRuleId, userName);
}
/**
* Rule severity was changed
*/
- public void ruleSeverityChanged(int profileId, int activeRuleId, RulePriority oldSeverity, RulePriority newSeverity, String userLogin) {
+ public void ruleSeverityChanged(int profileId, int activeRuleId, RulePriority oldSeverity, RulePriority newSeverity, String userName) {
ActiveRule activeRule = getSession().getEntity(ActiveRule.class, activeRuleId);
RulesProfile profile = getSession().getEntity(RulesProfile.class, profileId);
- ruleSeverityChanged(profile, activeRule.getRule(), oldSeverity, newSeverity, userLogin);
+ ruleSeverityChanged(profile, activeRule.getRule(), oldSeverity, newSeverity, userName);
// Notify child profiles
- activatedOrChanged(profileId, activeRuleId, userLogin);
+ activatedOrChanged(profileId, activeRuleId, userName);
}
/**
* Rule was activated/changed in parent profile.
*/
- private void activatedOrChanged(int parentProfileId, int activeRuleId, String userLogin) {
+ private void activatedOrChanged(int parentProfileId, int activeRuleId, String userName) {
ActiveRule parentActiveRule = getSession().getEntity(ActiveRule.class, activeRuleId);
if (parentActiveRule.isInherited()) {
parentActiveRule.setInheritance(ActiveRule.OVERRIDES);
getSession().saveWithoutFlush(parentActiveRule);
}
for (RulesProfile child : getChildren(parentProfileId)) {
- activateOrChange(child, parentActiveRule, userLogin);
+ activateOrChange(child, parentActiveRule, userName);
}
getSession().commit();
}
/**
* Rule was deactivated in parent profile.
*/
- public void deactivated(int parentProfileId, int deactivatedRuleId, String userLogin) {
+ public void deactivated(int parentProfileId, int deactivatedRuleId, String userName) {
ActiveRule parentActiveRule = getSession().getEntity(ActiveRule.class, deactivatedRuleId);
RulesProfile profile = getSession().getEntity(RulesProfile.class, parentProfileId);
- ruleDisabled(profile, parentActiveRule, userLogin);
+ ruleDisabled(profile, parentActiveRule, userName);
for (RulesProfile child : getChildren(parentProfileId)) {
- deactivate(child, parentActiveRule.getRule(), userLogin);
+ deactivate(child, parentActiveRule.getRule(), userName);
}
getSession().commit();
}
return false;
}
- public void revert(int profileId, int activeRuleId, String userLogin) {
+ public void revert(int profileId, int activeRuleId, String userName) {
RulesProfile profile = getSession().getEntity(RulesProfile.class, profileId);
ActiveRule oldActiveRule = getSession().getEntity(ActiveRule.class, activeRuleId);
if (oldActiveRule != null && oldActiveRule.doesOverride()) {
getSession().saveWithoutFlush(newActiveRule);
// Compute change
- ruleChanged(profile, oldActiveRule, newActiveRule, userLogin);
+ ruleChanged(profile, oldActiveRule, newActiveRule, userName);
for (RulesProfile child : getChildren(profile)) {
- activateOrChange(child, newActiveRule, userLogin);
+ activateOrChange(child, newActiveRule, userName);
}
getSession().commit();
/**
* Deal with creation of ActiveRuleChange item when a rule param is changed on a profile
*/
- private void ruleParamChanged(RulesProfile profile, Rule rule, String paramKey, String oldValue, String newValue, String userLogin) {
+ private void ruleParamChanged(RulesProfile profile, Rule rule, String paramKey, String oldValue, String newValue, String userName) {
incrementProfileVersionIfNeeded(profile);
- ActiveRuleChange rc = new ActiveRuleChange(userLogin, profile, rule);
+ ActiveRuleChange rc = new ActiveRuleChange(userName, profile, rule);
if (!StringUtils.equals(oldValue, newValue)) {
rc.setParameterChange(paramKey, oldValue, newValue);
getSession().saveWithoutFlush(rc);
/**
* Deal with creation of ActiveRuleChange item when a rule severity is changed on a profile
*/
- private void ruleSeverityChanged(RulesProfile profile, Rule rule, RulePriority oldSeverity, RulePriority newSeverity, String userLogin) {
+ private void ruleSeverityChanged(RulesProfile profile, Rule rule, RulePriority oldSeverity, RulePriority newSeverity, String userName) {
incrementProfileVersionIfNeeded(profile);
- ActiveRuleChange rc = new ActiveRuleChange(userLogin, profile, rule);
- if (oldSeverity != newSeverity) {
+ ActiveRuleChange rc = new ActiveRuleChange(userName, profile, rule);
+ if (!ObjectUtils.equals(oldSeverity, newSeverity)) {
rc.setOldSeverity(oldSeverity);
rc.setNewSeverity(newSeverity);
getSession().saveWithoutFlush(rc);
/**
* Deal with creation of ActiveRuleChange item when a rule is changed (severity and/or param(s)) on a profile
*/
- private void ruleChanged(RulesProfile profile, ActiveRule oldActiveRule, ActiveRule newActiveRule, String userLogin) {
+ private void ruleChanged(RulesProfile profile, ActiveRule oldActiveRule, ActiveRule newActiveRule, String userName) {
incrementProfileVersionIfNeeded(profile);
- ActiveRuleChange rc = new ActiveRuleChange(userLogin, profile, newActiveRule.getRule());
+ ActiveRuleChange rc = new ActiveRuleChange(userName, profile, newActiveRule.getRule());
if (oldActiveRule.getSeverity() != newActiveRule.getSeverity()) {
rc.setOldSeverity(oldActiveRule.getSeverity());
/**
* Deal with creation of ActiveRuleChange item when a rule is enabled on a profile
*/
- private void ruleEnabled(RulesProfile profile, ActiveRule newActiveRule, String userLogin) {
+ private void ruleEnabled(RulesProfile profile, ActiveRule newActiveRule, String userName) {
incrementProfileVersionIfNeeded(profile);
- ActiveRuleChange rc = new ActiveRuleChange(userLogin, profile, newActiveRule.getRule());
+ ActiveRuleChange rc = new ActiveRuleChange(userName, profile, newActiveRule.getRule());
rc.setEnabled(true);
rc.setNewSeverity(newActiveRule.getSeverity());
if (newActiveRule.getRule().getParams() != null) {
/**
* Deal with creation of ActiveRuleChange item when a rule is disabled on a profile
*/
- private void ruleDisabled(RulesProfile profile, ActiveRule disabledRule, String userLogin) {
+ private void ruleDisabled(RulesProfile profile, ActiveRule disabledRule, String userName) {
incrementProfileVersionIfNeeded(profile);
- ActiveRuleChange rc = new ActiveRuleChange(userLogin, profile, disabledRule.getRule());
+ ActiveRuleChange rc = new ActiveRuleChange(userName, profile, disabledRule.getRule());
rc.setEnabled(false);
rc.setOldSeverity(disabledRule.getSeverity());
if (disabledRule.getRule().getParams() != null) {
getSession().saveWithoutFlush(rc);
}
- private void activateOrChange(RulesProfile profile, ActiveRule parentActiveRule, String userLogin) {
+ private void activateOrChange(RulesProfile profile, ActiveRule parentActiveRule, String userName) {
ActiveRule oldActiveRule = profile.getActiveRule(parentActiveRule.getRule());
if (oldActiveRule != null) {
if (oldActiveRule.isInherited()) {
getSession().saveWithoutFlush(newActiveRule);
if (oldActiveRule != null) {
- ruleChanged(profile, oldActiveRule, newActiveRule, userLogin);
+ ruleChanged(profile, oldActiveRule, newActiveRule, userName);
} else {
- ruleEnabled(profile, newActiveRule, userLogin);
+ ruleEnabled(profile, newActiveRule, userName);
}
for (RulesProfile child : getChildren(profile)) {
- activateOrChange(child, newActiveRule, userLogin);
+ activateOrChange(child, newActiveRule, userName);
}
}
- private void deactivate(RulesProfile profile, Rule rule, String userLogin) {
+ private void deactivate(RulesProfile profile, Rule rule, String userName) {
ActiveRule activeRule = profile.getActiveRule(rule);
if (activeRule != null) {
if (activeRule.isInherited()) {
- ruleDisabled(profile, activeRule, userLogin);
+ ruleDisabled(profile, activeRule, userName);
removeActiveRule(profile, activeRule);
} else {
activeRule.setInheritance(null);
}
for (RulesProfile child : getChildren(profile)) {
- deactivate(child, rule, userLogin);
+ deactivate(child, rule, userName);
}
}
}
getProfilesManager().deleteProfile((int) profileId);
}
- public ValidationMessages changeParentProfile(int profileId, String parentName, String userLogin) {
- return getProfilesManager().changeParentProfile(profileId, parentName, userLogin);
+ public ValidationMessages changeParentProfile(int profileId, String parentName, String userName) {
+ return getProfilesManager().changeParentProfile(profileId, parentName, userName);
}
- public void ruleActivated(int parentProfileId, int activeRuleId, String userLogin) {
- getProfilesManager().activated(parentProfileId, activeRuleId, userLogin);
+ public void ruleActivated(int parentProfileId, int activeRuleId, String userName) {
+ getProfilesManager().activated(parentProfileId, activeRuleId, userName);
}
- public void ruleParamChanged(int parentProfileId, int activeRuleId, String paramKey, String oldValue, String newValue, String userLogin) {
- getProfilesManager().ruleParamChanged(parentProfileId, activeRuleId, paramKey, oldValue, newValue, userLogin);
+ public void ruleParamChanged(int parentProfileId, int activeRuleId, String paramKey, String oldValue, String newValue, String userName) {
+ getProfilesManager().ruleParamChanged(parentProfileId, activeRuleId, paramKey, oldValue, newValue, userName);
}
- public void ruleSeverityChanged(int parentProfileId, int activeRuleId, int oldSeverityId, int newSeverityId, String userLogin) {
+ public void ruleSeverityChanged(int parentProfileId, int activeRuleId, int oldSeverityId, int newSeverityId, String userName) {
getProfilesManager().ruleSeverityChanged(parentProfileId, activeRuleId, RulePriority.values()[oldSeverityId],
- RulePriority.values()[newSeverityId], userLogin);
+ RulePriority.values()[newSeverityId], userName);
}
- public void ruleDeactivated(int parentProfileId, int deactivatedRuleId, String userLogin) {
- getProfilesManager().deactivated(parentProfileId, deactivatedRuleId, userLogin);
+ public void ruleDeactivated(int parentProfileId, int deactivatedRuleId, String userName) {
+ getProfilesManager().deactivated(parentProfileId, deactivatedRuleId, userName);
}
- public void revertRule(int profileId, int activeRuleId, String userLogin) {
- getProfilesManager().revert(profileId, activeRuleId, userLogin);
+ public void revertRule(int profileId, int activeRuleId, String userName) {
+ getProfilesManager().revert(profileId, activeRuleId, userName);
}
public List<Footer> getWebFooters() {
def changelog
@profile = Profile.find(params[:id])
- @versions = ActiveRuleChange.find(:all, :select => 'profile_version, MAX(change_date) AS change_date', :conditions => ['profile_id=?', @profile.id], :group => 'profile_version')
- @versions.sort! { |a,b| b.profile_version <=> a.profile_version }
+ versions = ActiveRuleChange.find(:all, :select => 'profile_version, MAX(change_date) AS change_date', :conditions => ['profile_id=?', @profile.id], :group => 'profile_version')
+ versions.sort! { |a,b| b.profile_version <=> a.profile_version }
- if @versions.empty?
- @last_version = 1
- else
- @last_version = @versions[0].profile_version
- @past_versions = @versions[1, @versions.length]
+ if !versions.empty?
+ last_version = versions[0].profile_version
if params[:since].blank?
- @since_version = @last_version - 1
+ @since_version = last_version - 1
else
@since_version = params[:since].to_i
end
- @changes = ActiveRuleChange.find(:all, :conditions => ['profile_id=? and profile_version>?', @profile.id, @since_version], :order => 'id desc')
+ if params[:to].blank?
+ @to_version = last_version
+ else
+ @to_version = params[:to].to_i
+ end
+ if @since_version > @to_version
+ @since_version, @to_version = @to_version, @since_version
+ end
+ @changes = ActiveRuleChange.find(:all, :conditions => ['profile_id=? and ?<profile_version and profile_version<=?', @profile.id, @since_version, @to_version], :order => 'id desc')
+
+ @select_versions = versions.map {|u| ["version " + u.profile_version.to_s + " (" + u.change_date.strftime("%Y/%m/%d %H:%M:%S") + ")", u.profile_version]} | [["no version", 0]];
end
end
id = params[:id].to_i
parent_name = params[:parent_name]
if parent_name.blank?
- messages = java_facade.changeParentProfile(id, nil, current_user.login)
+ messages = java_facade.changeParentProfile(id, nil, current_user.name)
else
- messages = java_facade.changeParentProfile(id, parent_name, current_user.login)
+ messages = java_facade.changeParentProfile(id, parent_name, current_user.name)
end
flash_validation_messages(messages)
redirect_to :action => 'inheritance', :id => id
def revert_rule
id = params[:id].to_i
rule_id = params[:active_rule_id].to_i
- java_facade.revertRule(id, rule_id, current_user.login)
+ java_facade.revertRule(id, rule_id, current_user.name)
redirect_to request.query_parameters.merge({:action => 'index', :id => params[:id], :commit => nil})
end
if priority.blank?
# deactivate the rule
if active_rule
- java_facade.ruleDeactivated(profile.id, active_rule.id, current_user.login)
+ java_facade.ruleDeactivated(profile.id, active_rule.id, current_user.name)
active_rule.destroy
active_rule=nil
end
active_rule.failure_level=Sonar::RulePriority.id(priority)
active_rule.save!
if activated
- java_facade.ruleActivated(profile.id, active_rule.id, current_user.login)
+ java_facade.ruleActivated(profile.id, active_rule.id, current_user.name)
else
- java_facade.ruleSeverityChanged(profile.id, active_rule.id, old_severity, active_rule.failure_level, current_user.login)
+ java_facade.ruleSeverityChanged(profile.id, active_rule.id, old_severity, active_rule.failure_level, current_user.name)
end
end
if active_rule
active_param.save
active_param.valid?
active_param.reload
- java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, value, current_user.login)
+ java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, value, current_user.name)
elsif !active_param.nil?
old_value = active_param.value
active_param.destroy
active_param = nil
- java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, nil, current_user.login)
+ java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, nil, current_user.name)
end
end
render :partial => 'rule_param', :object => nil,
count = rules_to_activate.size
rules_to_activate.each do |rule|
active_rule = profile.active_rules.create(:rule => rule, :failure_level => rule.priority)
- java_facade.ruleActivated(profile.id, active_rule.id, current_user.login)
+ java_facade.ruleActivated(profile.id, active_rule.id, current_user.name)
end
end
count
count=0
profile.active_rules.each do |ar|
if rule_ids.include?(ar.rule_id) && !ar.inheritance.present?
- java_facade.ruleDeactivated(profile.id, ar.id, current_user.login)
+ java_facade.ruleDeactivated(profile.id, ar.id, current_user.name)
ar.destroy
count+=1
end
<%= render :partial => 'profiles/tabs', :locals => {:selected_tab=>'changelog'} %>
<div class="tabs-panel marginbottom10">
- <% if @versions.empty? %>
+ <% if @select_versions.nil? %>
No changes has been done on this quality profile.
<% else %>
- <% if !@past_versions.empty? %>
- <% form_tag({:action => 'changelog'}, {:method => 'post'}) do %>
- <%= hidden_field_tag "id", @profile.id %>
- Changelog between last version (<%= @versions[0].change_date.strftime("%Y/%m/%d %H:%M:%S") %>) and
- <%= select_tag "since", options_for_select(@past_versions.map {|u| ["version " + u.profile_version.to_s + " (" + u.change_date.strftime("%Y/%m/%d %H:%M:%S") + ")", u.profile_version]}, @since_version) %>
- <%= submit_tag "Load", :id => 'submit_since'%>
- <% end %>
+ <% form_tag({:action => 'changelog'}, {:method => 'post'}) do %>
+ <%= hidden_field_tag "id", @profile.id %>
+ Cahngelog between
+ <%= select_tag "since", options_for_select(@select_versions, @since_version) %>
+ and
+ <%= select_tag "to", options_for_select(@select_versions, @to_version) %>
+ <%= submit_tag "Load", :id => 'submit'%>
<% end %>
- <table class="data width100">
+ <table class="data width100" style="word-wrap:break-word; table-layout: fixed;">
<thead>
<tr>
+ <th>Profile version</th>
<th>Date</th>
<th>User</th>
<th>Action</th>
<th>Parameters</th>
</tr>
</thead>
- <% current_version = -1
+ <%
@changes.each do |change|
%>
- <% if current_version != change.profile_version %>
- <tr>
- <td align="left" colspan="5">
- <div class="line-block">
- <h2>Version <%=change.profile_version%></h2>
- </div>
- </td>
- </tr>
- <% current_version = change.profile_version
- end
- %>
- <tr class="<%= cycle 'even', 'odd', :name => change.profile_version -%>">
+ <tr class="<%= cycle('even', 'odd') -%>">
+ <td valign="top"><%= change.profile_version - 1 %> -> <%= change.profile_version %></td>
<td valign="top"><%=change.change_date.strftime("%Y-%m-%d %H:%M:%S")%></td>
- <td valign="top"><%=change.user_login%></td>
+ <td valign="top"><%=change.user_name%></td>
<td valign="top"><%=change.action_text%></td>
<td valign="top"><%=change.rule.name%></td>
<td valign="top">
<thead>
<tr>
<th class="left">Name</th>
- <th align="left">Version</th>
<th class="right">Rules</th>
<th class="right">Alerts</th>
<th class="right">Projects</th>
<tr class="<%= cycle 'even', 'odd', :name => language.getKey() -%>" id="<%= u profile.key %>">
<td><a href="<%= url_for :controller => 'rules_configuration', :action => 'index', :id => profile.id -%>" id="rules-<%= language.getKey() -%>-<%= u(profile.name) -%>"><%= h profile.name %></a></td>
- <td align="left"><span id="version_<%= u profile.key -%>"><%= profile.version -%></span></td>
-
<td align="right">
<span id="activated_rules_<%= u profile.key -%>"><%= profile.count_active_rules -%></span>
</td>
def self.up
create_table :active_rule_changes do |t|
- t.column :user_login, :string, :limit => 40, :null => false
+ t.column :user_name, :string, :limit => 200, :null => false
t.column :profile_id, :integer, :null => false
t.column :profile_version, :integer, :null => false
t.column :rule_id, :integer, :null => false
<dataset>
- <active_rule_changes id="1" user_login="admin" profile_id="2" profile_version="2" rule_id="1" enabled="true" old_severity="[null]" new_severity="2"/>
+ <active_rule_changes id="1" user_name="admin" profile_id="2" profile_version="2" rule_id="1" enabled="true" old_severity="[null]" new_severity="2"/>
</dataset>
<dataset>
- <active_rule_changes id="1" user_login="admin" profile_id="2" profile_version="2" rule_id="2" enabled="true" old_severity="[null]" new_severity="2"/>
+ <active_rule_changes id="1" user_name="admin" profile_id="2" profile_version="2" rule_id="2" enabled="true" old_severity="[null]" new_severity="2"/>
</dataset>
<dataset>
- <active_rule_changes id="1" user_login="admin" profile_id="2" profile_version="2" rule_id="2" enabled="false" old_severity="2" new_severity="[null]"/>
+ <active_rule_changes id="1" user_name="admin" profile_id="2" profile_version="2" rule_id="2" enabled="false" old_severity="2" new_severity="[null]"/>
<active_rule_param_changes id="1" active_rule_change_id="1" rules_parameter_id="13" old_value="30" new_value="[null]"/>
<dataset>
- <active_rule_changes id="1" user_login="admin" profile_id="2" profile_version="2" rule_id="2" enabled="[null]" old_severity="[null]" new_severity="[null]"/>
+ <active_rule_changes id="1" user_name="admin" profile_id="2" profile_version="2" rule_id="2" enabled="[null]" old_severity="[null]" new_severity="[null]"/>
<active_rule_param_changes id="1" active_rule_change_id="1" rules_parameter_id="13" old_value="20" new_value="30"/>
<dataset>
- <active_rule_changes id="1" user_login="admin" profile_id="2" profile_version="2" rule_id="2" enabled="[null]" old_severity="3" new_severity="2"/>
+ <active_rule_changes id="1" user_name="admin" profile_id="2" profile_version="2" rule_id="2" enabled="[null]" old_severity="3" new_severity="2"/>
<active_rule_param_changes id="1" active_rule_change_id="1" rules_parameter_id="13" old_value="30" new_value="[null]"/>
<active_rule_param_changes id="2" active_rule_change_id="1" rules_parameter_id="14" old_value="100" new_value="50"/>
<dataset>
- <active_rule_changes id="1" user_login="admin" profile_id="2" profile_version="2" rule_id="2" enabled="[null]" old_severity="4" new_severity="3"/>
+ <active_rule_changes id="1" user_name="admin" profile_id="2" profile_version="2" rule_id="2" enabled="[null]" old_severity="4" new_severity="3"/>
</dataset>
create table ACTIVE_RULE_CHANGES (
ID INTEGER not null,
- USER_LOGIN VARCHAR(40) not null,
+ USER_NAME VARCHAR(200) not null,
PROFILE_ID INTEGER not null,
PROFILE_VERSION INTEGER not null,
RULE_ID INTEGER not null,