Feature #32818

Add a system settings for default results display format of project query

Added by Sebastian Paluch 8 months ago. Updated 6 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Projects
Target version:4.2.0
Resolution:Fixed

Description

Add a system settings for default results display format ("Display results as") of project query, so that we make query results to be shown as list by default.

Related to #29482.

Environment:
  Redmine version                4.1.0.stable
  Ruby version                   2.5.7-p206 (2019-10-01) [x64-mingw32]
  Rails version                  5.2.4.1
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Subversion                     1.11.1
  Git                            2.19.1
  Filesystem                     
Redmine plugins:
  no plugin installed

setting_project_list_display_type.png (33.6 KB) Takenori TAKAKI, 2020-02-03 14:14

32818.patch Magnifier (3.15 KB) Takenori TAKAKI, 2020-02-03 14:16

0001-Add-system-setting-for-default-results-display-forma.patch Magnifier (3.51 KB) Marius BALTEANU, 2020-02-09 23:17


Related issues

Related to Redmine - Feature #29482: Query system for Projects page Closed

Associated revisions

Revision 19505
Added by Go MAEDA 7 months ago

Add system setting for default results display format of project query (#32818).

Patch by Takenori TAKAKI and Marius BALTEANU.

History

#1 Updated by Marius BALTEANU 8 months ago

#2 Updated by Takenori TAKAKI 8 months ago

I made a patch that enable to set the default 'display type' of project list.
We can select either "Boar" or "List" on the "settings?Tab=project" as shown below.

#3 Updated by Go MAEDA 8 months ago

  • Target version set to Candidate for next major release

#4 Updated by Go MAEDA 8 months ago

  • Target version changed from Candidate for next major release to 4.2.0

I think there are many users who prefer "List" style over "Board". This is a useful feature for those users.

The patch looks good to me. Setting the target version to 4.2.0.

#5 Updated by Marius BALTEANU 7 months ago

  • Assignee set to Marius BALTEANU

I would like to review this patch.

#6 Updated by Marius BALTEANU 7 months ago

Thanks Takenori TAKAKI for writing the patch.

I propose few changes in the attached patch in order to keep the existing logic, please let me know what do you think.

Tests pass: https://gitlab.com/redmine-org/redmine/pipelines/116338730

#7 Updated by Takenori TAKAKI 7 months ago

Thanks to Marius for reviewing the patch and suggesting improvements!
I think attached code is better, because the patch will be more DRY.

#8 Updated by Go MAEDA 7 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you for improving Redmine.

#9 Updated by Mike K 6 months ago

Hello, i cant apply this patch to my Redmine (4.1.0.stable). When i execute this command on home project directory i got this:

patch < 0001-Add-system-setting-for-default-results-display-forma.patch 
can't find file to patch at input line 19
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|From a6110fa9d370ca31c365b69403ecd36f92302faa Mon Sep 17 00:00:00 2001
|From: Marius BALTEANU <marius.balteanu@zitec.com>
|Date: Sun, 9 Feb 2020 19:45:53 +0200
|Subject: [PATCH] Add system setting for default results display format of
| project query
|
|---
| app/models/project_query.rb           | 4 ++++
| app/models/query.rb                   | 6 +++++-
| app/views/settings/_projects.html.erb | 7 +++++++
| config/settings.yml                   | 2 ++
| test/unit/project_query_test.rb       | 9 +++++++++
| 5 files changed, 27 insertions(+), 1 deletion(-)
|
|diff --git a/app/models/project_query.rb b/app/models/project_query.rb
|index 54c16d8e6..703e979d5 100644
|--- a/app/models/project_query.rb
|+++ b/app/models/project_query.rb

Please help me, i need this patch.

#10 Updated by Marius BALTEANU 6 months ago

Mike K wrote:

Hello, i cant apply this patch to my Redmine (4.1.0.stable). When i execute this command on home project directory i got this:
[...]
Please help me, i need this patch.

Use patch -p1 < 0001-Add-system-setting-for-default-results-display-forma.patch to apply the patch. Anyway, if still doesn't work, please use forum to request help.

Also available in: Atom PDF