aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java2
-rw-r--r--sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb27
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb15
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_header.html.erb11
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb35
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb81
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations.html.erb45
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations_ajax.html.erb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/_sidebar.html.erb20
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb49
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb3
17 files changed, 205 insertions, 137 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java b/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java
index a36d69709ad..8a57fa291b7 100644
--- a/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java
+++ b/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java
@@ -96,6 +96,7 @@ public class DefaultIssueFinder implements IssueFinder {
@Override
public IssueQueryResult find(IssueQuery query) {
LOG.debug("IssueQuery : {}", query);
+ long start = System.currentTimeMillis();
SqlSession sqlSession = myBatis.openSession();
try {
// 1. Select the authorized ids of all the issues that match the query
@@ -153,6 +154,7 @@ public class DefaultIssueFinder implements IssueFinder {
.setPaging(paging);
} finally {
MyBatis.closeQuietly(sqlSession);
+ LOG.debug("IssueQuery execution time : {} ms", System.currentTimeMillis() - start);
}
}
diff --git a/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java b/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java
index 71c72db08a1..ec0558f85a8 100644
--- a/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java
+++ b/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java
@@ -60,6 +60,7 @@ public class IssueBulkChangeService {
public IssueBulkChangeResult execute(IssueBulkChangeQuery issueBulkChangeQuery, UserSession userSession) {
LOG.debug("BulkChangeQuery : {}", issueBulkChangeQuery);
+ long start = System.currentTimeMillis();
userSession.checkLoggedIn();
IssueBulkChangeResult result = new IssueBulkChangeResult();
@@ -95,6 +96,7 @@ public class IssueBulkChangeService {
issueNotifications.sendChanges((DefaultIssue) issue, issueChangeContext, issueQueryResult);
}
}
+ LOG.debug("BulkChange execution time : {} ms", System.currentTimeMillis() - start);
return result;
}
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
index d7abcab3b66..77138bdef19 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
@@ -20,7 +20,7 @@
class DrilldownController < ApplicationController
before_filter :init_resource_for_user_role
- helper ProjectHelper, DashboardHelper
+ helper ProjectHelper, DashboardHelper, IssuesHelper
SECTION=Navigation::SECTION_RESOURCE
@@ -134,8 +134,6 @@ class DrilldownController < ApplicationController
]
@rule_measures = @snapshot.rule_measures(metrics)
end
-
- @display_viewers=display_issue_viewers?(@drilldown.highlighted_snapshot || @snapshot)
end
# Deprecated in 3.6. Kept for backward-compatibility, for example with SQALE (http://jira.sonarsource.com/browse/SQALE-185)
@@ -190,12 +188,6 @@ class DrilldownController < ApplicationController
snapshot.violations.size>0
end
- def display_issue_viewers?(snapshot)
- return true if snapshot.file?
- issues = Api.issues.find({'components' => snapshot.project.key}).issues
- issues.size>0
- end
-
def guess_rule_severity(snapshot, rule, metric_prefix)
Severity::KEYS.each do |severity|
if snapshot.rule_measure(Metric.by_key("#{metric_prefix}#{severity.downcase}_violations"), rule)
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
index 41bd55e2458..d14d11f2003 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
@@ -36,11 +36,16 @@ class IssuesController < ApplicationController
if params[:id]
@filter = find_filter(params[:id].to_i)
end
- @first_search = criteria_params_sanitized.empty?
- @criteria_params = criteria_params
- issue_filter_result = Internal.issues.execute(@criteria_params)
- @issue_query = issue_filter_result.query
+ @first_search = issues_query_params_sanitized.empty?
+ @issues_query_params = criteria_params
+ issue_filter_result = Internal.issues.execute(@issues_query_params)
+ @issues_query = issue_filter_result.query
@issues_result = issue_filter_result.result
+
+ if request.xhr?
+ @ajax_mode = true
+ render :partial => 'search_ajax'
+ end
end
# Load existing filter
@@ -53,9 +58,9 @@ class IssuesController < ApplicationController
issue_filter_result = Internal.issues.execute(params[:id].to_i, params)
@filter = find_filter(params[:id].to_i)
- @criteria_params = criteria_params_from_filter(@filter)
- @criteria_params[:id] = @filter.id
- @issue_query = issue_filter_result.query
+ @issues_query_params = issues_query_params_from_filter(@filter)
+ @issues_query_params[:id] = @filter.id
+ @issues_query = issue_filter_result.query
@issues_result = issue_filter_result.result
render :action => 'search'
@@ -63,7 +68,7 @@ class IssuesController < ApplicationController
# GET /issues/manage
def manage
- @issue_query = Internal.issues.emptyIssueQuery()
+ @issues_query = Internal.issues.emptyIssueQuery()
@filters = Internal.issues.findIssueFiltersForCurrentUser()
@shared_filters = Internal.issues.findSharedFiltersForCurrentUser()
@favourite_filter_ids = @favourite_filters.map { |filter| filter.id }
@@ -177,17 +182,17 @@ class IssuesController < ApplicationController
end
def criteria_params
- params['pageSize'] = PAGE_SIZE
+ params['pageSize'] = PAGE_SIZE unless request.xhr?
params.delete('controller')
params.delete('action')
params
end
- def criteria_params_sanitized
+ def issues_query_params_sanitized
Internal.issues.sanitizeFilterQuery(params).to_hash
end
- def criteria_params_from_filter(filter)
+ def issues_query_params_from_filter(filter)
Internal.issues.deserializeFilterQuery(filter).to_hash
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
index b645f80b042..6861d7c4748 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
@@ -294,7 +294,7 @@ class ResourceController < ApplicationController
@expandable = (@lines != nil)
@filtered = !@expanded
rule_param = params[:rule]
- options = {'components' => @resource.key, 'resolved' => 'false'}
+ @issues_query_params = {'components' => @resource.key, 'resolved' => 'false'}
if rule_param.blank? && params[:metric]
metric = Metric.by_id(params[:metric])
@@ -308,26 +308,26 @@ class ResourceController < ApplicationController
if !rule_param.blank? && rule_param != 'all'
if rule_param=='false_positive_issues'
- options['resolutions'] = 'FALSE-POSITIVE'
- options['resolved'] = 'true'
+ @issues_query_params['resolutions'] = 'FALSE-POSITIVE'
+ @issues_query_params['resolved'] = 'true'
elsif Sonar::RulePriority.id(rule_param)
- options['severities'] = rule_param
+ @issues_query_params['severities'] = rule_param
else
rule = Rule.by_key_or_id(rule_param)
- options['rules'] = rule.key
+ @issues_query_params['rules'] = rule.key
end
end
if @period && @period != 0
date = @snapshot.period_datetime(@period)
if date
- options['createdAfter'] = Api::Utils.format_datetime(date)
+ @issues_query_params['createdAfter'] = Api::Utils.format_datetime(date)
end
end
- @issue_results = Api.issues.find(options)
+ @issue_results = Api.issues.find(@issues_query_params)
@issue_results.issues.each do |issue|
# sorted by severity => from blocker to info
if @lines && issue.line && issue.line>0 && issue.line<=@lines.size
@@ -336,7 +336,6 @@ class ResourceController < ApplicationController
@global_issues<<issue
end
end
- @issues_params = options
if !@expanded && @lines
filter_lines { |line| line.issues? }
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb
index f1087df6b4e..33f74db2482 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb
@@ -130,17 +130,17 @@ class DrilldownColumn
conditions += ' AND project_measures.person_id IS NULL'
end
- @measures=ProjectMeasure.find(:all,
- :select => "project_measures.id,project_measures.metric_id,project_measures.#{value_column},project_measures.text_value,project_measures.alert_status,project_measures.alert_text,project_measures.snapshot_id",
- :joins => :snapshot,
- :conditions => [conditions, condition_values],
- :order => order,
- :limit => 200)
+ @measures=ProjectMeasure.all(
+ :select => "project_measures.id,project_measures.metric_id,project_measures.#{value_column},project_measures.text_value,project_measures.alert_status,project_measures.alert_text,project_measures.snapshot_id",
+ :joins => :snapshot,
+ :conditions => [conditions, condition_values],
+ :order => order,
+ :limit => 200)
@resource_per_sid={}
sids=@measures.map { |m| m.snapshot_id }.compact.uniq
unless sids.empty?
- Snapshot.find(:all, :include => :project, :conditions => {'snapshots.id' => sids}).each do |snapshot|
+ Snapshot.all(:include => :project, :conditions => {'snapshots.id' => sids}).each do |snapshot|
@resource_per_sid[snapshot.id]=snapshot.project
if @drilldown.selected_resource_ids.include?(snapshot.project_id)
@selected_snapshot=snapshot
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb
index cbd8542835a..06013f03d41 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb
@@ -12,11 +12,6 @@
anchor = stripped_url[1];
}
- // refresh page after issues bulk change
- function onBulkIssues(issues_query_params){
- window.location.reload();
- }
-
openAccordionItem('<%= url_for(params.merge({:controller => 'resource', :action => :index, :id => @file.id, :display_title => 'false', :popup => 'false'})) -%>', this, false)
.done(function () {
if (anchor != null) {
@@ -24,4 +19,9 @@
}
});
+ // refresh page after issues bulk change
+ function onBulkIssues(issues_query_params){
+ window.location.reload();
+ }
+
</script>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_header.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_header.html.erb
index cd7ccad3ee4..c23ff415c89 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_header.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_header.html.erb
@@ -7,14 +7,19 @@
if (display_title == undefined) {
display_title = true;
}
- var url = '<%= ApplicationController.root_context -%>/resource/index/' + resourceId + '?metric=<%= @metric.id if @metric -%>&rule=<%= @rule ? @rule.id : @severity -%>&period=<%= @period -%>&project=<%= @resource.id -%>&display_title=' + display_title;
+ var url = '<%= ApplicationController.root_context -%>/resource/index/' + resourceId + '?metric=<%= @metric.id if @metric -%>' +
+ '&rule=<%= @rule ? @rule.id : @severity -%>&period=<%= @period -%>&project=<%= @resource.id -%>&display_title=' + display_title;
openAccordionItem(url, this);
return false;
}
// refresh page after issues bulk change
function onBulkIssues(issues_query_params){
- d(issues_query_params['components']);
- closeModalWindow();
+ if (issues_query_params['components'] != null) {
+ d(issues_query_params['components']);
+ closeModalWindow();
+ } else {
+ window.location.reload();
+ }
}
</script>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb
index b553ca101f6..2b3c0f72e0e 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb
@@ -91,9 +91,12 @@
<img src="<%= ApplicationController.root_context -%>/images/priority/<%= rule_measure.rule_priority -%>.png"/>
</td>
<td>
- <%= link_to(h(rule.name), {:controller => :drilldown, :action => :issues, :id => @resource.id, :rule => (selected ? nil : rule.key),
+ <%= link_to(h(rule.name),
+ {:controller => :drilldown, :action => :issues, :id => @resource.id, :rule => (selected ? nil : rule.key),
:rule_sev => (selected ? nil : rule_measure.severity), :sid => nil, :severity => @severity, :period => @period,
- :rids => (selected ? nil : @selected_rids)}, :title => "#{rule.plugin_name}: #{rule.plugin_rule_key}") -%>
+ :rids => (selected ? nil : @selected_rids)},
+ :title => "#{rule.plugin_name}: #{rule.plugin_rule_key}"
+ ) -%>
</td>
<td class="right" nowrap="nowrap">
<span><%= @period ? format_variation(rule_measure, :period => @period, :style => 'light') : rule_measure.formatted_value -%></span>
@@ -182,6 +185,34 @@
item.scrollIntoView(true);
});
<% end %>
+
+ function displayIssues(){
+ var params = {
+ pageSize: '10',
+ <% if rids.empty? %>
+ componentRoots: '<%= @snapshot.project.key %>',
+ <% else %>
+ componentRoots: '<%= Project.by_key(rids.last).key %>',
+ <% end %>
+ <% if @rule %>
+ rules: '<%= @rule.plugin_name + ':' + @rule.plugin_rule_key %>',
+ <% end %>
+ <% if @rule_severity %>
+ severities: '<%= @rule_severity %>',
+ <% end %>
+ <% if @period && @period != 0 %>
+ createdAfter: '<%= Api::Utils.format_datetime(@snapshot.period_datetime(@period)) %>'
+ <% end %>
+ };
+
+ var url = '<%= ApplicationController.root_context -%>/issues/search?' + jQuery.param(params);
+ openAccordionItem(url, this, false);
+ return false;
+ }
+
+ $j(document).ready(function() {
+ displayIssues();
+ });
</script>
<div id="accordion-panel"/>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb
index 7592ea29500..5f83ac2ece2 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb
@@ -1,35 +1,19 @@
-<% content_for :script do %>
- <script>
- var filterCriteria = <%= @criteria_params.to_json -%>;
-
- function refreshList(sort, asc, page) {
- $j('#issue-filter-foot_pages').hide();
- $j('#issue-filter-foot_loading').show();
-
- filterCriteria['sort']=sort;
- filterCriteria['asc']=asc;
- filterCriteria['pageIndex']=page;
- var url=baseUrl + '/issues/search?' + $j.param(filterCriteria);
-
- window.location = url;
- return false;
- }
- </script>
-<% end %>
-
<%
if @issues_result.issues && !@issues_result.issues.empty?
colspan = 9
%>
+ <% if @issues_result && @issues_result.maxResultsReached() %>
+ <p class="notes"><%= message('issue_filter.max_results_reached', :params => @issues_result.paging.total()) -%></p>
+ <% end %>
<div id="issues-list">
<table class="data width100">
<thead>
<tr>
<th width="1%" nowrap class="column-severity">
- <%= column_html(@issue_query, @issues_result, message('severity_abbreviated'), message('severity'), 'SEVERITY') %>
+ <%= column_html(@issues_query, @issues_result, message('severity_abbreviated'), message('severity'), 'SEVERITY') %>
</th>
<th width="1%" nowrap class="column-status">
- <%= column_html(@issue_query, @issues_result, message('status'), message('status'), 'STATUS') %>
+ <%= column_html(@issues_query, @issues_result, message('status'), message('status'), 'STATUS') %>
</th>
<th width="1%" nowrap>
<%= message('issue_filter.header.resolution') -%>
@@ -44,16 +28,16 @@
<%= message('component') -%>
</th>
<th class="column-assignee">
- <%= column_html(@issue_query, @issues_result, message('issue_filter.header.assignee'), message('issue_filter.header.assignee'), 'ASSIGNEE') %>
+ <%= column_html(@issues_query, @issues_result, message('issue_filter.header.assignee'), message('issue_filter.header.assignee'), 'ASSIGNEE') %>
</th>
<th width="1%" nowrap>
<%= message('issue_filter.header.action_plan') -%>
</th>
<th width="1%" nowrap class="column-creation-date">
- <%= column_html(@issue_query, @issues_result, message('issue_filter.header.creation_date'), message('issue_filter.header.creation_date'), 'CREATION_DATE') %>
+ <%= column_html(@issues_query, @issues_result, message('issue_filter.header.creation_date'), message('issue_filter.header.creation_date'), 'CREATION_DATE') %>
</th>
<th width="1%" nowrap class="column-update-date">
- <%= column_html(@issue_query, @issues_result, message('issue_filter.header.update_date'), message('issue_filter.header.update_date'), 'UPDATE_DATE') %>
+ <%= column_html(@issues_query, @issues_result, message('issue_filter.header.update_date'), message('issue_filter.header.update_date'), 'UPDATE_DATE') %>
</th>
</tr>
</thead>
@@ -102,23 +86,54 @@
<%
end
%>
- <% if @issues_result.issues.empty? %>
- <tr class="even">
- <td colspan="<%= colspan -%>"><%= message 'no_data' -%></td>
- </tr>
- <% end %>
</tbody>
-
<%= paginate_java(@issues_result.paging, :colspan => colspan, :id => 'issue-filter-foot', :include_loading_icon => true) { |label, page_id|
- link_to(label, params.merge({:pageIndex => page_id}))
+ if @ajax_mode
+ link_to_function label, "refreshList('#{@issues_query.sort}', #{@issues_query.asc}, #{page_id})"
+ else
+ link_to(label, params.merge({:pageIndex => page_id}))
+ end
} -%>
-
</table>
</div>
<%
else
%>
- <p><%= message('issue_filter.no_result') -%></p>
+ <p style="padding: 5px;"><%= message('issue_filter.no_result') -%></p>
<%
end
%>
+
+<script type="text/javascript">
+ var filterCriteria = <%= @issues_query_params.to_json -%>;
+
+ function refreshList(sort, asc, page) {
+ $j('#issue-filter-foot_pages').hide();
+ $j('#issue-filter-foot_loading').show();
+
+ filterCriteria['sort']=sort;
+ filterCriteria['asc']=asc;
+ filterCriteria['pageIndex']=page;
+ var url = baseUrl + '/issues/search?' + $j.param(filterCriteria);
+
+ <% if @ajax_mode %>
+ $j('.issues-content').load(url, function () {
+ // As issues will be loaded after open-modal has been processed by jQuery, we have to process manually modal classes
+ processModal();
+ });
+ <% else %>
+ window.location = url;
+ <% end %>
+ return false;
+ }
+
+ function processModal(){
+ $j('.issues-content .open-modal').modal();
+ }
+
+ <% if @ajax_mode %>
+ $j(document).ready(function() {
+ processModal();
+ });
+ <% end %>
+</script>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations.html.erb
new file mode 100644
index 00000000000..14d5fbdb12f
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations.html.erb
@@ -0,0 +1,45 @@
+<% if logged_in? && !@first_search %>
+ <div id="issue-filters-operations" class="line-block marginbottom10">
+ <ul class="operations">
+ <% if @filter && @filter.id %>
+ <li><a id="copy" href="<%= url_for :action => 'copy_form', :id => @filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a></li>
+ <% end %>
+ <% if !defined?(@unchanged) && @filter && @filter.id && @filter.user == current_user.login %>
+ <li>
+ <%= link_to message('save'), params.merge({:action => 'save', :id => @filter.id}), :class => 'link-action', :id => 'save', :method => :post -%>
+ </li>
+ <% end %>
+ <% unless @filter %>
+ <li>
+ <a id="save-as" href="<%= url_for params.merge({:action => 'save_as_form'}) -%>" class="link-action open-modal"><%= message('save_as') -%></a>
+ </li>
+ <% end %>
+ <% if @issues_result.issues && !@issues_result.issues.empty? %>
+ <li>
+ <a id="bulk-change" href="<%= url_for params.merge({:action => 'bulk_change_form'}) -%>"
+ class="link-action open-modal"><%= message('bulk_change') -%></a>
+ </li>
+ <% end %>
+ </ul>
+
+ <% if @filter && @filter.id && @filter.name.present? %>
+ <div class="page_title" id="filter-title">
+ <p>
+ <span class="h3"><%= h @filter.name -%></span>
+ <span class="note">
+ <% if !@filter.shared %>
+ [<%= message 'issue_filter.private' -%>]
+ <% elsif @filter.user==current_user.login %>
+ [<%= message 'issue_filter.shared_with_all_users' -%>]
+ <% elsif @filter.user %>
+ [<%= message 'shared_by' -%> <%= Api.users.findByLogin(@filter.user).name -%>]
+ <% end %>
+ </span>
+ <% if @filter.user == current_user.login %>
+ &nbsp;<a href="<%= url_for :action => 'edit_form', :id => @filter.id -%>" class="open-modal" id="edit-filter"><%= image_tag 'pencil-small.png', :alt => message('edit') -%></a>
+ <% end %>
+ </p>
+ </div>
+ <% end %>
+ </div>
+<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations_ajax.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations_ajax.html.erb
new file mode 100644
index 00000000000..a88664d2cad
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations_ajax.html.erb
@@ -0,0 +1,10 @@
+<% if logged_in? && @issues_result.issues && !@issues_result.issues.empty? %>
+ <div id="issue-filters-operations" class="line-block marginbottom10">
+ <ul class="operations">
+ <li>
+ <a id="bulk-change" href="<%= url_for params.merge({:controller => 'issues', :action => 'bulk_change_form'}) -%>"
+ class="link-action open-modal"><%= message('bulk_change') -%></a>
+ </li>
+ </ul>
+ </div>
+<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search.html.erb
new file mode 100644
index 00000000000..f9d6b02a759
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search.html.erb
@@ -0,0 +1,4 @@
+<div class="issues-content">
+ <%= render :partial => 'operations' -%>
+ <%= render :partial => 'list' -%>
+</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb
new file mode 100644
index 00000000000..c8bfae9ab89
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb
@@ -0,0 +1,4 @@
+<div class="issues-content">
+ <%= render :partial => 'operations_ajax' -%>
+ <%= render :partial => 'list' -%>
+</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_sidebar.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_sidebar.html.erb
index b0d62e46830..c400c02e72e 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_sidebar.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_sidebar.html.erb
@@ -6,15 +6,15 @@
<% if @filter && @filter.id %>
<input type="hidden" name="id" value="<%= @filter.id.to_s -%>">
<% end %>
- <input type="hidden" name="sort" value="<%= @issue_query.sort -%>"/>
- <input type="hidden" name="asc" value="<%= @issue_query.asc -%>"/>
+ <input type="hidden" name="sort" value="<%= @issues_query.sort -%>"/>
+ <input type="hidden" name="asc" value="<%= @issues_query.asc -%>"/>
<li class="sidebar-title">
<%= message('issue_filter.new_search') -%>
</li>
<li id="criteria-project" class="marginbottom5">
<%= message 'issue_filter.criteria.project' -%>:
- <% selected_componentRoot = Internal.component_api.findByKey(@issue_query.componentRoots.to_a.first) if @issue_query.componentRoots and @issue_query.componentRoots.size == 1 %>
+ <% selected_componentRoot = Internal.component_api.findByKey(@issues_query.componentRoots.to_a.first) if @issues_query.componentRoots and @issues_query.componentRoots.size == 1 %>
<%= component_select_tag 'componentRoots', :resource_type_property => 'supportsGlobalDashboards', :width => '100%',
:selected_resource => selected_componentRoot,
:display_key => true,
@@ -25,40 +25,40 @@
</li>
<li id="criteria-severity" class="marginbottom5">
<%= message 'issue_filter.criteria.severity' -%>:
- <%= dropdown_tag 'severities[]', options_for_select(RulesConfigurationController::RULE_PRIORITIES, @issue_query.severities),
+ <%= dropdown_tag 'severities[]', options_for_select(RulesConfigurationController::RULE_PRIORITIES, @issues_query.severities),
{:width => '100%', :placeholder => message('issue_filter.criteria.severity')},
{:id => 'select-severities', :multiple => true}-%>
</li>
<li id="criteria-status" class="marginbottom5">
<%= message 'issue_filter.criteria.status' -%>:
- <%= dropdown_tag 'statuses[]', options_for_select(@options_for_statuses, @issue_query.statuses),
+ <%= dropdown_tag 'statuses[]', options_for_select(@options_for_statuses, @issues_query.statuses),
{:width => '100%', :placeholder => message('issue_filter.criteria.status')},
{:id => 'select-status', :multiple => true}-%>
</li>
<li id="criteria-resolution" class="marginbottom5">
<%= message 'issue_filter.criteria.resolution' -%>:
- <%= dropdown_tag 'resolutions[]', options_for_select(@options_for_resolutions, @issue_query.resolutions),
+ <%= dropdown_tag 'resolutions[]', options_for_select(@options_for_resolutions, @issues_query.resolutions),
{:width => '100%', :placeholder => message('issue_filter.criteria.resolution')},
{:id => 'select-resolution', :multiple => true}-%>
</li>
<li id="criteria-assignee" class="marginbottom5">
<%= message 'issue_filter.criteria.assignee' -%>:
- <% selected_assignee = Api.users.findByLogin(@issue_query.assignees.to_a.first) if @issue_query.assignees && @issue_query.assignees.size == 1 %>
+ <% selected_assignee = Api.users.findByLogin(@issues_query.assignees.to_a.first) if @issues_query.assignees && @issues_query.assignees.size == 1 %>
<%= user_select_tag('assignees', {:selected_user => selected_assignee, :width => '100%', :placeholder => message('issue_filter.criteria.assignee'),
:html_id => 'select-assignee', :open => false, :allow_clear => true}) -%>
</li>
<li id="criteria-reporter" class="marginbottom5">
<%= message 'issue_filter.criteria.reporter' -%>:
- <% selected_reporter = Api.users.findByLogin(@issue_query.reporters.to_a.first) if @issue_query.reporters && @issue_query.reporters.size == 1 %>
+ <% selected_reporter = Api.users.findByLogin(@issues_query.reporters.to_a.first) if @issues_query.reporters && @issues_query.reporters.size == 1 %>
<%= user_select_tag('reporters', {:selected_user => selected_reporter, :width => '100%', :placeholder => message('issue_filter.criteria.reporter'),
:html_id => 'select-reporter', :open => false, :allow_clear => true}) -%>
</li>
<li id="criteria-created" class="marginbottom5">
<%= message('issue_filter.criteria.created_after') -%>:<br>
- <input type="text" id="select-created-after" name="createdAfter" value="<%= Api::Utils.format_date(@issue_query.createdAfter) -%>" size="10" maxlength="10" class="marginbottom5">
+ <input type="text" id="select-created-after" name="createdAfter" value="<%= Api::Utils.format_date(@issues_query.createdAfter) -%>" size="10" maxlength="10" class="marginbottom5">
<br>
<%= message 'issue_filter.criteria.created_before' -%>:<br>
- <input type="text" id="select-created-before" name="createdBefore" value="<%= Api::Utils.format_date(@issue_query.createdBefore) -%>" size="10" maxlength="10"><br>
+ <input type="text" id="select-created-before" name="createdBefore" value="<%= Api::Utils.format_date(@issues_query.createdBefore) -%>" size="10" maxlength="10"><br>
<span class="small gray"><%= message 'issue_filter.criteria.date_format' -%></span>
</li>
<li>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
index 371258b449d..18b1d26fc11 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
@@ -5,54 +5,7 @@
<div class="page-split-right">
<div id="content">
- <div id="issue-filters-operations" class="line-block marginbottom10">
- <% if logged_in? && !@first_search %>
- <ul class="operations">
- <% if @filter && @filter.id %>
- <li><a id="copy" href="<%= url_for :action => 'copy_form', :id => @filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a></li>
- <% end %>
- <% if !defined?(@unchanged) && @filter && @filter.id && @filter.user == current_user.login %>
- <li>
- <%= link_to message('save'), params.merge({:action => 'save', :id => @filter.id}), :class => 'link-action', :id => 'save', :method => :post -%>
- </li>
- <% end %>
- <% unless @filter %>
- <li>
- <a id="save-as" href="<%= url_for params.merge({:action => 'save_as_form'}) -%>" class="link-action open-modal"><%= message('save_as') -%></a>
- </li>
- <% end %>
- <li>
- <a id="bulk-change" href="<%= url_for params.merge({:action => 'bulk_change_form'}) -%>"
- class="link-action open-modal"><%= message('bulk_change') -%></a>
- </li>
- </ul>
-
- <div class="page_title" id="filter-title">
- <% if @filter && @filter.id && @filter.name.present? %>
- <p>
- <span class="h3"><%= h @filter.name -%></span>
- <span class="note">
- <% if !@filter.shared %>
- [<%= message 'issue_filter.private' -%>]
- <% elsif @filter.user==current_user.login %>
- [<%= message 'issue_filter.shared_with_all_users' -%>]
- <% elsif @filter.user %>
- [<%= message 'shared_by' -%> <%= Api.users.findByLogin(@filter.user).name -%>]
- <% end %>
- </span>
- <% if @filter.user == current_user.login %>
- &nbsp;<a href="<%= url_for :action => 'edit_form', :id => @filter.id -%>" class="open-modal" id="edit-filter"><%= image_tag 'pencil-small.png', :alt => message('edit') -%></a>
- <% end %>
- </p>
- <% end %>
- </div>
- <% end %>
- </div>
-
- <% if @issues_result && @issues_result.maxResultsReached() %>
- <p class="notes"><%= message('issue_filter.max_results_reached', :params => @issues_result.paging.total()) -%></p>
- <% end %>
- <%= render :partial => 'list' -%>
+ <%= render :partial => 'search' -%>
</div>
</div>
</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
index a30c805539e..81a9424363b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
@@ -24,7 +24,7 @@
<% first=true %>
<% if logged_in? && @display_issues %>
<li class="<%= 'first' if first -%>">
- <a href="<%= url_for @issues_params.merge({:controller => 'issues', :action => 'bulk_change_form', 'componentRoots' => @resource.root ? @resource.root.key : nil}) -%>"
+ <a href="<%= url_for @issues_query_params.merge({:controller => 'issues', :action => 'bulk_change_form', 'componentRoots' => @resource.root ? @resource.root.key : nil}) -%>"
class="bulk-change-link open-modal"><%= message('bulk_change') -%></a>
</li>
<% first=false
@@ -57,4 +57,5 @@
</ul>
</div>
+
<% end %>