プロジェクト

全般

プロフィール

Vote #79484

完了

Filter out issues from closed projects in My Page blocks

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
My page_42
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
42
version_id:
99
issue_org_id:
29449
author_id:
574
assigned_to_id:
332
comments:
19
status_id:
5
tracker_id:
2
plus1:
2
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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.


journals

+1 (╯ಠ_ಠ)╯︵ ┻━┻
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
I think add project statues column on Issues can solve this issue!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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 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.

--------------------------------------------------------------------------------
If #29482 was not considered, I think that it will be solved by changing it as follows.
<pre><code class="diff">
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
</code></pre>
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

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

--------------------------------------------------------------------------------
Committed the patch posted by Marius. Thanks.
--------------------------------------------------------------------------------
Go Maeda, please apply the attached patch in order to use the @Project::STATUS_ACTIVE@ instead of harcoded 1.
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Go Maeda, please apply the attached patch in order to use the @Project::STATUS_ACTIVE@ instead of harcoded 1.

Done (r17612).

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

duplicates,Closed,17006,Hide issues from closed project on my page
duplicates,Closed,30460,This project is closed and read-only so please hidden all issue on mypage
blocks,Closed,20081,Filter issues and time entries by project status

Admin Redmine さんが3年以上前に更新

  • カテゴリMy page_42 にセット
  • 対象バージョン4.0.0_99 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0