Project

General

Profile

Actions

Patch #30071

open

Show parent projects when filtering in the project jump box

Patch #30071: Show parent projects when filtering in the project jump box

Added by Anders Thomsen almost 8 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI

Description

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.


Files

Updated by Go MAEDA almost 8 years ago Actions #1

  • 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 almost 8 years ago Actions #2

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 Go MAEDA almost 8 years ago Actions #3

  • Status changed from Needs feedback to New
  • Target version set to 4.1.0

LGTM. Setting the target version to 4.1.0.

Updated by Marius BĂLTEANU almost 8 years ago Actions #4

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
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -66,10 +66,14 @@ class ProjectsController < ApplicationController
     respond_to do |format|
       format.js {
         if params[:q].present?
-          @projects = Project.visible.like(params[:q]).to_a
+          @projects = Project.visible.to_a
         else
           @projects = User.current.projects.to_a
         end

Maybe is it enough to show only the parent project? If not, at least we should confirm the proposed change with Jean-Philippe.

Updated by Jean-Philippe Lang over 7 years ago Actions #5

  • Target version changed from 4.1.0 to Candidate for next major release
Actions

Also available in: PDF Atom