Show parent projects when filtering in the project jump box
Attached patch returns parents projects to matched projects when filtering in the project jump box (improves #23310)
It looks like this:
This solves a problem when having several projects with identical or similar names and project hierarchy is used to distinguish between them. E.g. when using one parent project as a container for business projects and another for the software development part of same project.
Also included is a related patch that marks the current project.
Updated by Go MAEDA about 5 years ago
- Status changed from New to Needs feedback
It is an interesting improvement.
I tried out the patch. But parent projects were displayed in not grey but black. And the checkmark for the current project was not displayed even after applying the patch 0002-Mark-current-project-when-filtering-project-jump-box.patch.
Could you check the patch again? My browsers are Firefox and Chrome for Mac.
Updated by Anders Thomsen about 5 years ago
- File 0003-Mark-nodes-with-matching-child-in-filtered-project-j.patch 0003-Mark-nodes-with-matching-child-in-filtered-project-j.patch added
The original patch uses on font-weight to grey out the non-matched parent nodes. This relies on the used font to provide the font-style which often it does not. Just realised this as I tested on Windows.
Supplied patch uses "color" instead.
As for not marking the currently selected project, I'm not sure what causes this. I have just copied the functionality from the existing logic that marks the current project on the first page load (i.e. not filtering). Does that work for you?
Updated by Marius BĂLTEANU about 5 years ago
I like the idea of the patch, but I'm worried about the proposed implementation that retrieves every time all the projects visible to the user (ignoring the q parameter). That means more time required to return the project searched by the user on instances with a lot of projects.
The change about I speak is the following one:
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index a43038a..9fbddf2 100644
@@ -66,10 +66,14 @@ class ProjectsController < ApplicationController
respond_to do |format|
- @projects = Project.visible.like(params[:q]).to_a
+ @projects = Project.visible.to_a
@projects = User.current.projects.to_a
Maybe is it enough to show only the parent project? If not, at least we should confirm the proposed change with Jean-Philippe.