GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 6c514f4e authored by jplang's avatar jplang

DOn't show time entries when query is invalid (#23912).

git-svn-id: https://svn.redmine.org/redmine/trunk@16635 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 68721114
......@@ -10,6 +10,7 @@
<%= render :partial => 'date_range' %>
<% end %>
<% if @query.valid? %>
<% if @entries.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
......@@ -37,6 +38,7 @@
<% end %>
</div>
<% end %>
<% end %>
<% content_for :sidebar do %>
<%= render_sidebar_queries(TimeEntryQuery, @project) %>
......
......@@ -26,6 +26,7 @@
<%= link_to l(:button_clear), {:params => request.query_parameters.merge(:criteria => nil)}, :class => 'icon icon-reload' %></p>
<% end %>
<% if @query.valid? %>
<% unless @report.criteria.empty? %>
<% if @report.hours.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
......@@ -65,6 +66,7 @@
<% end %>
<% end %>
<% end %>
<% end %>
<% content_for :sidebar do %>
<%= render_sidebar_queries(TimeEntryQuery, @project) %>
......
......@@ -989,6 +989,14 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_equal 3, values.size
end
def test_index_with_invalid_date_filter_should_not_validate
@request.session[:user_id] = 2
get :index, :params => {:set_filter => '1', :f => ['spent_on'], :op => {'spent_on' => '='}, :v => {'spent_on' => ['2016-09-010']}}
assert_select_error 'Date is invalid'
assert_select 'table.time-entries', 0
end
def test_index_with_query
query = TimeEntryQuery.new(:project_id => 1, :name => 'Time Entry Query', :visibility => 2)
query.save!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment