GitLab steht Mittwoch, den 23. September, zwischen 10:00 und 12:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit 790d893e authored by jplang's avatar jplang

Allow issues grouping by start and due dates (#13803).

git-svn-id: https://svn.redmine.org/redmine/trunk@17723 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 18b5ed60
......@@ -33,8 +33,8 @@ class IssueQuery < Query
QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default_order => 'desc'),
QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name", :groupable => true),
QueryColumn.new(:fixed_version, :sortable => lambda {Version.fields_for_order_statement}, :groupable => true),
QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"),
QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"),
QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date", :groupable => true),
QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date", :groupable => true),
QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours", :totalable => true),
QueryColumn.new(:total_estimated_hours,
:sortable => "COALESCE((SELECT SUM(estimated_hours) FROM #{Issue.table_name} subtasks" +
......
......@@ -333,6 +333,25 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select 'tr.group span.count'
end
def test_index_grouped_by_due_date
Issue.destroy_all
Issue.generate!(:due_date => '2018-08-10')
Issue.generate!(:due_date => '2018-08-10')
Issue.generate!
get :index, :params => {
:set_filter => 1,
:group_by => "due_date"
}
assert_response :success
assert_select 'tr.group span.name', :value => '2018-08-10' do
assert_select '~ span.count', value:'2'
end
assert_select 'tr.group span.name', :value => '(blank)' do
assert_select '~ span.count', value:'1'
end
end
def test_index_with_query_grouped_by_list_custom_field
get :index, :params => {
:project_id => 1,
......
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