Browse Source

Filter after parent project (#29482).

Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@18763 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.1.0
Jean-Philippe Lang 4 years ago
parent
commit
e7d52eb0af
2 changed files with 22 additions and 0 deletions
  1. 3
    0
      app/models/project_query.rb
  2. 19
    0
      test/functional/projects_controller_test.rb

+ 3
- 0
app/models/project_query.rb View File

) )
add_available_filter "name", :type => :text add_available_filter "name", :type => :text
add_available_filter "description", :type => :text add_available_filter "description", :type => :text
add_available_filter("parent_id",
:type => :list_subprojects, :values => lambda { project_values }, :label => :field_parent
)
add_available_filter "is_public", add_available_filter "is_public",
:type => :list, :type => :list,
:values => [[l(:general_text_yes), "1"], [l(:general_text_no), "0"]] :values => [[l(:general_text_yes), "1"], [l(:general_text_no), "0"]]

+ 19
- 0
test/functional/projects_controller_test.rb View File

end end
end end


def test_index_with_subproject_filter
@request.session[:user_id] = 1

get :index, :params => {
:f => ['parent_id'],
:op => {'parent_id' => '='},
:v => {'parent_id' => ['1']}
}

assert_response :success

assert_select 'div#projects-index ul' do
assert_select 'a.project', 3
assert_select 'a', :text => 'eCookbook Subproject 1'
assert_select 'a', :text => 'eCookbook Subproject 2'
assert_select 'a', :text => 'Private child of eCookbook'
end
end

def test_autocomplete_js def test_autocomplete_js
get :autocomplete, :params => { get :autocomplete, :params => {
:format => 'js', :format => 'js',

Loading…
Cancel
Save