Feature #43997 » 0001-Add-setting-to-always-include-issue-authors-in-assig.patch
| app/models/issue.rb | ||
|---|---|---|
| 1030 | 1030 |
return [] if project.nil? |
| 1031 | 1031 | |
| 1032 | 1032 |
users = project.assignable_users(tracker).to_a |
| 1033 |
users << author if author && author.active? |
|
| 1033 |
if Setting.always_add_issue_author_to_assignable_users? && author&.active? |
|
| 1034 |
users << author |
|
| 1035 |
end |
|
| 1034 | 1036 |
if assigned_to_id_was.present? && assignee = Principal.find_by_id(assigned_to_id_was) |
| 1035 | 1037 |
users << assignee |
| 1036 | 1038 |
end |
| app/views/settings/_issues.html.erb | ||
|---|---|---|
| 15 | 15 | |
| 16 | 16 |
<p><%= setting_select :assignee_dropdown_display_format, assignee_dropdown_display_format_options %></p> |
| 17 | 17 | |
| 18 |
<p><%= setting_check_box :always_add_issue_author_to_assignable_users %></p> |
|
| 19 | ||
| 18 | 20 |
<p><%= setting_check_box :default_issue_start_date_to_creation_date %></p> |
| 19 | 21 | |
| 20 | 22 |
<% |
| config/locales/en.yml | ||
|---|---|---|
| 501 | 501 |
setting_gantt_months_limit: Maximum number of months displayed on the gantt chart |
| 502 | 502 |
setting_issue_group_assignment: Allow issue assignment to groups |
| 503 | 503 |
setting_assignee_dropdown_display_format: Assignee drop-down display format |
| 504 |
setting_always_add_issue_author_to_assignable_users: Always show the author in the assignee list |
|
| 504 | 505 |
setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues |
| 505 | 506 |
setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed |
| 506 | 507 |
setting_unsubscribe: Allow users to delete their own account |
| config/settings.yml | ||
|---|---|---|
| 198 | 198 |
default: 0 |
| 199 | 199 |
assignee_dropdown_display_format: |
| 200 | 200 |
default: users_then_groups |
| 201 |
always_add_issue_author_to_assignable_users: |
|
| 202 |
default: 0 |
|
| 201 | 203 |
default_issue_start_date_to_creation_date: |
| 202 | 204 |
default: 0 |
| 203 | 205 |
default_issue_due_date_offset: |
| test/unit/issue_test.rb | ||
|---|---|---|
| 2696 | 2696 |
assert_kind_of User, Issue.find(1).assignable_users.first |
| 2697 | 2697 |
end |
| 2698 | 2698 | |
| 2699 |
test "#assignable_users should include the issue author" do |
|
| 2699 |
test "#assignable_users should include the issue author when enabled by settings" do
|
|
| 2700 | 2700 |
non_project_member = User.generate! |
| 2701 | 2701 |
issue = Issue.generate!(:author => non_project_member) |
| 2702 | 2702 | |
| 2703 |
assert issue.assignable_users.include?(non_project_member) |
|
| 2703 |
with_settings :always_add_issue_author_to_assignable_users => '1' do |
|
| 2704 |
assert issue.assignable_users.include?(non_project_member) |
|
| 2705 |
end |
|
| 2706 |
end |
|
| 2707 | ||
| 2708 |
test "#assignable_users should not include non member author" do |
|
| 2709 |
non_project_member = User.generate! |
|
| 2710 |
issue = Issue.generate!(:author => non_project_member) |
|
| 2711 | ||
| 2712 |
assert_not_include non_project_member, issue.assignable_users |
|
| 2704 | 2713 |
end |
| 2705 | 2714 | |
| 2706 | 2715 |
def test_assignable_users_should_not_include_anonymous_user |
- « Previous
- 1
- 2
- Next »