Browse Source

SONAR-3528 Pagination is broken on reviews widgets

Fix regression introduced during fix of SONAR-3404 (see commit
c8278a1e6b): the name "limit"
used to allow loading more reviews is the same as the one used by
the widget's partial to paginate.
=> now, the partial uses "table_limit" as parameter
tags/3.1
Fabrice Bellingard 12 years ago
parent
commit
98373bb223

+ 3
- 3
sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/reviews/_reviews_list.html.erb View File

@@ -1,5 +1,5 @@
<%
limit = params[:limit] unless limit
table_limit = params[:table_limit] unless table_limit
widget_id = params[:widget_id] unless widget_id
search_options = params unless search_options
@@ -15,7 +15,7 @@

# table pagination
page_size = 20
page_size = limit.to_i
page_size = table_limit.to_i
total_number = reviews.size
if reviews.size > page_size
page_id = (params[:page_id] ? params[:page_id].to_i : 1)
@@ -52,7 +52,7 @@
link_params[:controller] = 'project_reviews'
link_params[:action] = 'widget_reviews_list'
link_params[:snapshot_id] = @snapshot.id
link_params[:limit] = limit
link_params[:table_limit] = table_limit
link_params[:widget_id] = widget_id
link_params[:period] = params[:period]
%>

+ 2
- 2
sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/reviews/_reviews_list_widget.html.erb View File

@@ -1,5 +1,5 @@
<%
limit = widget_properties["numberOfLines"]
table_limit = widget_properties["numberOfLines"]

if @dashboard_configuration.selected_period?
search_options['from'] = @dashboard_configuration.from_datetime
@@ -12,6 +12,6 @@
<div id="reviews-widget-<%= widget_id -%>">
<%= render :partial => 'project/widgets/reviews/reviews_list',
:locals => {:search_options => search_options,
:limit => limit,
:table_limit => table_limit,
:widget_id => widget_id} %>
</div>

Loading…
Cancel
Save