Project

General

Profile

Actions

Feature #29449

closed

Filter out issues from closed projects in My Page blocks

Added by Maxim Krušina over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
My page
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

Users see issues assigned to them on My Page, even when the project is closed.
So it's difficult because someone with rights to open/close project needs to re-open project, close affected issues (or change Assignee) and then close project again.
I think that the best solution is NOT to display issues of closed projects on the user's My Page.


Files


Related issues

Has duplicate Redmine - Feature #17006: Hide issues from closed project on my pageClosed

Actions
Has duplicate Redmine - Feature #30460: This project is closed and read-only so please hidden all issue on mypageClosed

Actions
Blocked by Redmine - Feature #20081: Filter issues and time entries by project statusClosedGo MAEDA

Actions
Actions #1

Updated by Anonymous over 5 years ago

+1 (╯ಠ_ಠ)╯︵ ┻━┻

Actions #2

Updated by zhangzhi liao over 5 years ago

+1

Actions #3

Updated by zhangzhi liao over 5 years ago

I think add project statues column on Issues can solve this issue!

Actions #4

Updated by Go MAEDA over 5 years ago

  • Has duplicate Feature #17006: Hide issues from closed project on my page added
Actions #5

Updated by Marius BĂLTEANU over 5 years ago

  • Tracker changed from Defect to Feature

zhangzhi liao wrote:

I think add project statues column on Issues can solve this issue!

Agree. If #29482 is implemented, we can add the projects status filter to Issues and then we can filter out the issues from closed projects on my page.

I'm changing the tracker to feature because is not a defect, issues from closed projects are shown also in the Issues page by default.

Actions #6

Updated by Maxim Krušina over 5 years ago

I think it's more complicated and there should be more discussion on this topic. The main question is what exactly the closing of projects means. From my point of view - when the project is closed, it's already solved, done. For that reason, the project will disappear from the project list (in the default view). And because the this "disappearing logic" it seems obvious that tickets will disappear also. Of course, there can be a filter, which is a great idea, but the default behaviour should be the same as for the project:
  • Project open = show everything
  • Project closed = hide project from project list (you can show closed project by using a filter) + hide tickets from users (tickets can be shown by using the filter)

It's not just my point of view, we take care of more Redmine installations in different companies and with the current logic, there is a lot of people fighting. Generally, the project manager will close the project and the rest of the team is complaining they still see obsolete tickets.

Actions #7

Updated by Marius BĂLTEANU over 5 years ago

Maxim Krušina wrote:

I think it's more complicated and there should be more discussion on this topic. The main question is what exactly the closing of projects means. From my point of view - when the project is closed, it's already solved, done. For that reason, the project will disappear from the project list (in the default view). And because the this "disappearing logic" it seems obvious that tickets will disappear also. Of course, there can be a filter, which is a great idea, but the default behaviour should be the same as for the project:
  • Project open = show everything
  • Project closed = hide project from project list (you can show closed project by using a filter) + hide tickets from users (tickets can be shown by using the filter)

It's not just my point of view, we take care of more Redmine installations in different companies and with the current logic, there is a lot of people fighting. Generally, the project manager will close the project and the rest of the team is complaining they still see obsolete tickets.

Maxim, I think I was not clear enough in my previous comment. What I wanted to say is that I'm totally in favour of filtering out the issues from closed projects by default in the "Issues assigned to me", "Watched issues" and "Reported issues" widgets from My Page and also, from the issues list. In order to do it without rewriting the current implementation of the widgets, we need first to have the possibility to filter issues after project status. My plan is to add these features after I finish my work on #29482.

Regarding the issues list, my main concern is related to the "Project status" filter, if we should add it by default to the issues filters (like "Status" is open) or we should just hide the issues from closed project. Somehow, I find the first solution less confusing for users even if we add an extra row to issues filters.

Actions #8

Updated by Yuichi HARADA over 5 years ago

If #29482 was not considered, I think that it will be solved by changing it as follows.

diff --git a/app/helpers/my_helper.rb b/app/helpers/my_helper.rb
index 8320749fc..bdda8302f 100644
--- a/app/helpers/my_helper.rb
+++ b/app/helpers/my_helper.rb
@@ -96,6 +96,8 @@ module MyHelper
   def render_issuesassignedtome_block(block, settings)
     query = IssueQuery.new(:name => l(:label_assigned_to_me_issues), :user => User.current)
     query.add_filter 'assigned_to_id', '=', ['me']
+    query.add_available_filter('project.status', :type => :integer)
+    query.add_filter 'project.status', '=', ["#{Project::STATUS_ACTIVE}"]
     query.column_names = settings[:columns].presence || ['project', 'tracker', 'status', 'subject']
     query.sort_criteria = settings[:sort].presence || [['priority', 'desc'], ['updated_on', 'desc']]
     issues = query.issues(:limit => 10)
@@ -106,6 +108,8 @@ module MyHelper
   def render_issuesreportedbyme_block(block, settings)
     query = IssueQuery.new(:name => l(:label_reported_issues), :user => User.current)
     query.add_filter 'author_id', '=', ['me']
+    query.add_available_filter('project.status', :type => :integer)
+    query.add_filter 'project.status', '=', ["#{Project::STATUS_ACTIVE}"]
     query.column_names = settings[:columns].presence || ['project', 'tracker', 'status', 'subject']
     query.sort_criteria = settings[:sort].presence || [['updated_on', 'desc']]
     issues = query.issues(:limit => 10)
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index c342dc456..2bd334bb4 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -543,6 +543,10 @@ class IssueQuery < Query
     end
   end

+  def sql_for_project_status_field(field, operator, value)
+    '(' + sql_for_field(field, operator, value, Project.table_name, "status") + ')'
+  end
+
   def sql_for_relations(field, operator, value, options={})
     relation_options = IssueRelation::TYPES[field]
     return relation_options unless relation_options

Actions #9

Updated by Marius BĂLTEANU over 5 years ago

Thanks Yuichi for working on this. Yes, it should work, but it is not enough because users will have inconsistent results between the issues returned by the widgets and the issues returned in the Issues list when they click on the widgets title (because the project status is not available in Issues filters).

I've already started to extract some code from #29482 in order to implement this ticket and the Project's Status as available filter in Issues list (#12066). I'll post them very soon.

Actions #10

Updated by Marius BĂLTEANU over 5 years ago

  • Related to Feature #20081: Filter issues and time entries by project status added
Actions #11

Updated by Marius BĂLTEANU over 5 years ago

  • Related to deleted (Feature #20081: Filter issues and time entries by project status)
Actions #12

Updated by Marius BĂLTEANU over 5 years ago

  • Blocked by Feature #20081: Filter issues and time entries by project status added
Actions #13

Updated by Marius BĂLTEANU over 5 years ago

Here is the patch that adds this change. It should be applied on top of the patches from #20081.

Actions #14

Updated by Marius BĂLTEANU over 5 years ago

  • Target version set to Candidate for next major release
Actions #15

Updated by Go MAEDA over 5 years ago

  • Subject changed from Issues from closed projects are displayed on user's My Page to Filter out issues from closed projects in My Page blocks
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from Candidate for next major release to 4.0.0
  • Resolution set to Fixed

Committed the patch posted by Marius. Thanks.

Actions #16

Updated by Marius BĂLTEANU over 5 years ago

Go Maeda, please apply the attached patch in order to use the Project::STATUS_ACTIVE instead of harcoded 1.

Actions #17

Updated by Go MAEDA over 5 years ago

  • Status changed from Reopened to Closed

Marius BALTEANU wrote:

Go Maeda, please apply the attached patch in order to use the Project::STATUS_ACTIVE instead of harcoded 1.

Done (r17612).

Actions #18

Updated by Marius BĂLTEANU over 5 years ago

Go MAEDA wrote:

Marius BALTEANU wrote:

Go Maeda, please apply the attached patch in order to use the Project::STATUS_ACTIVE instead of harcoded 1.

Done (r17612).

Thanks.

Actions #19

Updated by Go MAEDA over 5 years ago

  • Has duplicate Feature #30460: This project is closed and read-only so please hidden all issue on mypage added
Actions

Also available in: Atom PDF