Feature #16904
closedAdd anonymous user to users list in query filters
0%
Description
The author of an issue might be "Anonymous", either because issue creation is allowed for users that are not logged in, or because a user has been deleted. There's currently no way to filter by that user, the only way to achieve this is to filter for issues with an author that "is not all users".
Files
Updated by Felix Schäfer over 10 years ago
This adds the option to search for issues with the author "Anonymous" everywhere.
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index bf90f56..1b9bf1e 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -171,6 +171,7 @@ class IssueQuery < Query
author_values = []
author_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
author_values += users.collect{|s| [s.name, s.id.to_s] }
+ author_values << [l(:label_user_anonymous), User.anonymous.id.to_s]
add_available_filter("author_id",
:type => :list, :values => author_values
) unless author_values.empty?
Updated by Deoren Moor about 10 years ago
+1
This would be useful to have. In addition (probably a separate issue), being able to filter on locked accounts would be nice to have as well.
Updated by Yuichi HARADA about 6 years ago
- File 16904-issuequery-filters-add-anonymous-user.patch 16904-issuequery-filters-add-anonymous-user.patch added
I added an Anonymous user to the issues filter for "Author" and "Updated by" and "Last updated by".
Updated by Go MAEDA about 6 years ago
- Target version set to Candidate for next major release
Updated by Go MAEDA almost 6 years ago
- File 16904-issuequery-filters-add-anonymous-user-v2.patch 16904-issuequery-filters-add-anonymous-user-v2.patch added
Thank you for writing the patch.
But I think that not only IssuesQuery but also TimeEntryQuery should have an anonymous user in the author list because the User value of time entries can be an anonymous user.
Updated by Go MAEDA almost 5 years ago
- Target version changed from Candidate for next major release to 4.1.0
Setting the target version to 4.1.0.
Updated by Jean-Philippe Lang almost 5 years ago
- Subject changed from Add anonymous user to author list in issue query to Add anonymous user to users list in query filters
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
Committed, thanks.
Updated by Marius BĂLTEANU almost 5 years ago
- File 16904.patch 16904.patch added
- Status changed from Closed to Reopened
A test is failling:
root@df2fd1389bf4:/work# ruby test/functional/queries_controller_test.rb -n test_user_filter_should_return_active_and_locked_users_grouped_by_status
Run options: -n test_user_filter_should_return_active_and_locked_users_grouped_by_status --seed 49890
# Running:
F
Failure:
QueriesControllerTest#test_user_filter_should_return_active_and_locked_users_grouped_by_status [test/functional/queries_controller_test.rb:778]:
Expected: 6
Actual: 7
and a new Rubocop offense:
root@df2fd1389bf4:/work# bundle exec rubocop test/functional/queries_controller_test.rb
Inspecting 1 file
C
Offenses:
test/functional/queries_controller_test.rb:764:34: C: Style/RedundantInterpolation: Prefer to_s over string interpolation.
assert_include ["Anonymous", "#{User.anonymous.id}"], json
^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 1 offense detected
The attach patch fixes both issues.
Updated by Go MAEDA almost 5 years ago
- Status changed from Reopened to Closed
Committed the fix 16904.patch. Thank you.
Updated by Toshi MARUYAMA almost 5 years ago
- Status changed from Closed to Reopened
Tests fail on PostgreSQL.
http://www.redmine.org/builds/logs/build_trunk_postgresql_ruby-2.6_795.html
Updated by Marius BĂLTEANU almost 5 years ago
- Status changed from Reopened to Closed
Toshi MARUYAMA wrote:
Tests fail on PostgreSQL.
http://www.redmine.org/builds/logs/build_trunk_postgresql_ruby-2.6_795.html
It is a known issue, please see #32436.