Patch for #791 (Search for all projects issues)
#2 Updated by W Snyder about 10 years ago
- File 311_search_all_projects_default.patch added
This updates the patch to work with revision #1249, and also makes all_projects be the default when inside a project.
IMHO having a single search dialog that always works the same is far more intuitive (people expect Google behavior), and so I'm going to modify it slightly so the outside-a-project search also searches all projects. But, that seems beyond the intent of the original patch, so this is not included in my mod.
#3 Updated by Jean-Philippe Lang about 10 years ago
- Category set to Search engine
- Target version set to 0.8
This is definitely a must-have feature.
But with this patch, the number of queries will grow with the total number of projects. I would prefer a solution where a single query is executed for each kind of object (as it's done for the cross-project activity view). I'll work on it.
By the way, there's a small bug in the
object_types_and_scope method: the @project instance variable is used instead of the argument.
#4 Updated by Peter Van den Bosch about 10 years ago
- File search_all_projects.png added
- File search_all_projects_from_home.png added
- File search_all_projects_one_query.patch added
Hi, I wrote a patch which does it in a single query per object while limiting the scope to only projects for which the user has the necessary permissions.
Included some screenies too.
The behavior of the patch is as follows:When not inside a project:
- searches all projects including project names
- only checkboxes for categories where a user has a right to in some project are rendered
- the automatic redirect to a project if only one result has been removed
- defaults to search inside the project only
- a checkbox is present to search in all projects (maybe this should be the default?)
- does not search in project names (maybe should be present as a greyed out option when 'search all projects' is unchecked)
Could you give feedback on this patch? I'd like to make it ready for inclusion.
btw, it still has some problems with anonymous users and non-members when searching all projects. This is because User.allowed_to? returns false for :global instead of checking anonymous and non-member roles.
#5 Updated by Jean-Philippe Lang about 10 years ago
- Status changed from New to Closed
Functionality added in r1435.
Peter: your patch looks to work fine but I used a different approach that should be a bit more efficient when there are many public projects. Thanks.
Also, I added the ability to search 'My projects' only.
#6 Updated by José Campos almost 10 years ago
Please, help me understand this: Is it a desired feature that a user can see issues from projects he does not belongs to?
When I search outside a project, I can see in the search results issues belonging to projects that are supposed to be restricted to me...