Project

General

Profile

Feature #34798 » 0001-Show-project-tree-instead-of-subprojects-in-the-proj.patch

Marius BĂLTEANU, 2021-03-23 21:54

View differences:

app/helpers/issues_helper.rb
748 748
    if issue.parent_issue_id.present?
749 749
      issue.allowed_target_projects_for_subtask(User.current)
750 750
    elsif @project && issue.new_record? && !issue.copy?
751
      issue.allowed_target_projects(User.current, 'descendants')
751
      issue.allowed_target_projects(User.current, 'tree')
752 752
    else
753 753
      issue.allowed_target_projects(User.current)
754 754
    end
test/functional/issues_controller_test.rb
3203 3203
    get(
3204 3204
      :new,
3205 3205
      :params => {
3206
        :project_id => 1,
3206
        :project_id => 3,
3207 3207
        :tracker_id => 1
3208 3208
      }
3209 3209
    )
3210 3210
    assert_response :success
3211 3211
    assert_select 'select[name="issue[project_id]"]' do
3212 3212
      assert_select 'option', 3
3213
      assert_select 'option[selected=selected]', :text => 'eCookbook'
3213
      assert_select 'option[value=?]', '1', :text => 'eCookbook'
3214 3214
      assert_select 'option[value=?]', '5', :text => '  » Private child of eCookbook'
3215
      assert_select 'option[value=?]', '3', :text => '  » eCookbook Subproject 1'
3215
      assert_select 'option[selected=selected][value=?]', '3', :text => '  » eCookbook Subproject 1'
3216 3216

  
3217 3217
      # user_id 2 is not allowed to add issues on project_id 4 (it's not a member)
3218 3218
      assert_select 'option[value=?]', '4', 0
(1-1/3)