Project

General

Profile

Actions

Feature #20081

closed

Filter issues and time entries by project status

Feature #20081: Filter issues and time entries by project status

Added by Zer Guz over 11 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Projects
Target version:
Resolution:
Fixed

Description

When filtering (issues, spent time, etc) by project, the filter shows a list of all non-archived projects. This list becomes very long (in our case) as the closed projects are accumulating. We don't want to archive these closed projects, as we need occasionally to find data related to them.

It is good to choose whether the filter list includes only active project (default) or all (excluding archived, as it is now).

For example, currently the filter consists of two lists:
  • is, is not
  • project names
It could be changed to:
  • is (active), is, is not
  • project names
Or add additional list:
  • active, all, closed
  • is, is not
  • project names

So that if "active" is selected, only active projects are shown in the combo list. "Active" should be used by default (rather than "all") - this way it should cover the most used cases without additional effort.


Files


Related issues 5 (1 open — 4 closed)

Related to Redmine - Feature #29482: Query system for Projects pageClosedJean-Philippe LangActions
Related to Redmine - Feature #12066: Don't show issues for closed projects in all issues listNewActions
Related to Redmine - Defect #30718: Translation missing for filter by project statusClosedGo MAEDAActions
Has duplicate Redmine - Feature #22107: Add "Project status" to issues list's filtersClosedActions
Blocks Redmine - Feature #29449: Filter out issues from closed projects in My Page blocksClosedGo MAEDAActions

Updated by Go MAEDA over 9 years ago Actions #1

  • Has duplicate Feature #22107: Add "Project status" to issues list's filters added

Updated by Marius BĂLTEANU about 8 years ago Actions #2

Attached two patches that add the "Project's status" filter to issues and time entries. Beside the filter itself utility, if we add this feature, will allow us to implement #29449 and also, to discuss (I'll add another ticket) the possibility to hide the issues/time entries from closed projects by default (as the closed projects are hidden by default in Projects page).

Updated by Marius BĂLTEANU about 8 years ago Actions #3

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

  • Related to Feature #29449: Filter out issues from closed projects in My Page blocks added

Updated by Marius BĂLTEANU about 8 years ago Actions #5

  • Related to deleted (Feature #29449: Filter out issues from closed projects in My Page blocks)

Updated by Marius BĂLTEANU about 8 years ago Actions #6

  • Blocks Feature #29449: Filter out issues from closed projects in My Page blocks added

Updated by Marius BĂLTEANU about 8 years ago Actions #7

  • Related to Feature #12066: Don't show issues for closed projects in all issues list added

Updated by Go MAEDA about 8 years ago Actions #8

Marius, thank you for writing the patch.

It seems working fine but I came across the following error while running tests after applying
0001-Filter-issues-after-project-status.patch. Could you look into this?

Failure:
QueriesHelperTest#test_filters_options_for_select_should_group_associations_filters [/Users/maeda/redmines/redmine-trunk/test/helpers/queries_helper_test.rb:78]:
Expected exactly 2 elements matching "optgroup[label="Project"] > option", found 3..
Expected: 2
  Actual: 3

Updated by Marius BĂLTEANU about 8 years ago Actions #9

  • File deleted (0001-Filter-issues-after-project-status.patch)

Updated by Marius BĂLTEANU about 8 years ago Actions #10

Fixed in the attached patch.

Sorry for not catching this test fail from the beginning.

Updated by Go MAEDA about 8 years ago Actions #11

  • Subject changed from Show only active projects in the filter to Filter issues and time entries by project status
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version set to 4.0.0
  • Resolution set to Fixed

Committed. Thank you for improving Redmine.

Updated by Rang Tang almost 8 years ago Actions #12

Hi,
I came from #29449 and just applied these patches to my redmine 3.4 instance:

  • 0001-Filter-issues-after-project-status.patch
  • 0002-Filter-time-entries-after-project-status.patch
  • 0003-Filter-our-issues-from-closed-projects-in-the-follow.patch (from #29449)
  • use_status_active_constant.diff (from #29449)

Now that issues from closed project are filtered out from my page as I expected.
However, a "translation missing" error now appears in the filter on the query page:

I find it's because Project::LABEL_BY_STATUS (patch 0001) is not working as expected. (I think I18n is not loaded yet when this hash value gets evaluated)

I can fix this by putting the labels hash into query.rb instead of calling Project::LABEL_BY_STATUS. But is there a way to keep the labels inside the Project model and still be able to use the translations? I'm new to ruby and rails and looking forward to some advice.

diff --git a/app/models/query.rb b/app/models/query.rb
index dc84402..218c560 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -573,7 +573,11 @@ class Query < ActiveRecord::Base

   # Returns a scope of project statuses that are available as columns or filters
   def project_statuses_values
-    project_statuses =  Project::LABEL_BY_STATUS
+    project_statuses = {
+      1 => l(:project_status_active),
+      5 => l(:project_status_closed),
+      9 => l(:project_status_archived),
+    }
     # Remove archived status from filters
     project_statuses.delete(9)
     project_statuses.stringify_keys.invert.to_a

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

  • Related to Defect #30718: Translation missing for filter by project status added
Actions

Also available in: PDF Atom