measure.setValue(manualMeasure.getValue(), 5);
measure.setData(manualMeasure.getTextValue());
measure.setDescription(manualMeasure.getDescription());
- measure.setUrl(manualMeasure.getUrl());
return measure;
}
enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
- <manual_measures id="1" metric_id="2" resource_id="30" value="3.14" text_value="pi" created_at="[null]" updated_at="[null]" description="this is pi" url="http://pi" user_login="me"/>
- <manual_measures id="2" metric_id="2" resource_id="40" value="6" text_value="six" created_at="[null]" updated_at="[null]" description="this is six" url="http://six" user_login="me"/>
+ <manual_measures id="1" metric_id="2" resource_id="30" value="3.14" text_value="pi" created_at="[null]" updated_at="[null]" description="this is pi" user_login="me"/>
+ <manual_measures id="2" metric_id="2" resource_id="40" value="6" text_value="six" created_at="[null]" updated_at="[null]" description="this is six" user_login="me"/>
</dataset>
\ No newline at end of file
@Column(name = "description", updatable = true, nullable = true, length = MAX_TEXT_SIZE)
private String description;
- @Column(name = "url", updatable = true, nullable = true, length = MAX_TEXT_SIZE)
- private String url;
-
@Column(name = "created_at", updatable = true, nullable = true)
private Date createdAt;
return description;
}
- public String getUrl() {
- return url;
- }
-
public Integer getMetricId() {
return metricId;
}
measure.value = value
measure.text_value = params[:text]
measure.description = params[:desc]
- measure.url = params[:url]
measure.save!
respond_to do |format|
hash[:val]=manual_measure.value if manual_measure.value
hash[:text]=manual_measure.text_value if manual_measure.text_value
hash[:desc]=manual_measure.description if manual_measure.description
- hash[:url]=manual_measure.url if manual_measure.url
hash[:created_at]=format_datetime(manual_measure.created_at)
hash[:updated_at]=format_datetime(manual_measure.updated_at) if manual_measure.updated_at
if manual_measure.user
belongs_to :resource, :class_name => 'Project'
validates_uniqueness_of :metric_id, :scope => :resource_id
validates_length_of :text_value, :maximum => 4000, :allow_nil => true, :allow_blank => true
- validates_length_of :url, :maximum => 4000, :allow_nil => true, :allow_blank => true
validates_length_of :description, :maximum => 4000, :allow_nil => true, :allow_blank => true
validate :validate_metric
default_string = read_attribute(:short_name)
return default_string unless translate
- metric_name = read_attribute(:name)
- return nil if metric_name.nil?
+ metric_key = read_attribute(:name)
+ return nil if metric_key.nil?
- localeMap = Metric.i18n_short_name_cache[metric_name]
+ localeMap = Metric.i18n_short_name_cache[metric_key]
locale = I18n.locale
- return localeMap[locale] if not localeMap.nil? and localeMap.has_key?(locale)
+ return localeMap[locale] if localeMap && localeMap.has_key?(locale)
- i18n_key = 'metric.' + metric_name + '.name'
+ i18n_key = 'metric.' + metric_key + '.name'
result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, i18n_key, default_string, [].to_java)
- localeMap[locale] = result if not localeMap.nil?
+ localeMap[locale] = result if localeMap
result
end
#manualMeasures td.pendingMeasure {
background-color: orange;
- width: 4px;
- padding: 0;
cursor: help;
+ padding: 3px;
+ width: 0;
}
</style>
<div class="line-block marginbottom10">
<table class="width100 data sortable" id="manualMeasures">
<thead>
<tr>
- <th style="padding: 0; margin: 0; width: 4px" class="nosort"></th>
+ <th style="padding: 0; margin: 0" class="nosort"></th>
<th class="thin nowrap sortfirstasc">Domain</th>
<th class="thin nowrap">Metric</th>
<th class="thin nowrap" style="text-align: right">Value</th>
<% if measure.pending?(@snapshot) %>
<td class="pendingMeasure" title="Pending. New value will be available during next project analysis."></td>
<% else %>
- <td></td>
+ <td style="padding: 0"></td>
<% end %>
<td class="thin nowrap"><%= measure.metric.domain -%></td>
<td class="thin nowrap"><%= measure.metric.short_name -%></td>
t.column 'text_value', :string, :null => true, :limit => 4000
t.column 'user_login', :string, :null => true, :limit => 40
t.column 'description', :string, :null => true, :limit => 4000
- t.column 'url', :string, :null => true, :limit => 4000
t.timestamps
end
alter_to_big_primary_key('manual_measures')