Patch #23954
openShows the date of the last activity on Projects administration.
0%
Description
On Administration > Projects, it shows the date of the last activity on each project. Helps the admin to decide when to close or archive stale projects.
Files
Related issues
Updated by Go MAEDA over 6 years ago
- File screenshot-23954.png screenshot-23954.png added
This is a screenshot of the feature.
But it should be considered that processing when event
variable is nil in the following code. It causes undefined method `[]' for nil:NilClass
error at the next line.
def last_activity(project)
event = Redmine::Activity::Fetcher.new(User.current, :project => project).events(nil, nil, :limit => 1)[0]
byebug
event[:updated_on].nil? ? event[:created_on] : event[:updated_on]
end
Updated by Frederico Camara about 6 years ago
- File last_activity-1.patch last_activity-1.patch added
Go Maeda,
Thank you for your reply. I had already patched production (https://github.com/fredsdc/redmine/tree/3.2-patched), and I forgot I had posted the patch to Redmine.org. Fixed it again today to call last_activity function only once.
It now returns the project creation date if there is no activity in the project.
Updated by Go MAEDA about 6 years ago
- Target version set to Candidate for next major release
Thank you for updating the patch. It works fine, looks good to me.
Updated by Go MAEDA about 6 years ago
- Related to Patch #13696: Projects admin, show issues count added
Updated by Go MAEDA about 6 years ago
- Target version changed from Candidate for next major release to 3.4.0
Although Jean-Phillipe Lang wrote on #13696#note-7 as follows, last activity is very useful to maintenance projects.
We'll add this as an optional column when the project list will be made configurable (like the issue list).
In my opinion, "Last activity" is far more useful information than "Created".
Could this be a part of 3.4.0?
Updated by Robert Schneider about 6 years ago
Go MAEDA wrote:
In my opinion, "Last activity" is far more useful information than "Created".
That's true!
+1
Updated by Jean-Philippe Lang about 6 years ago
- Target version changed from 3.4.0 to Candidate for next major release
Go MAEDA wrote:
In my opinion, "Last activity" is far more useful information than "Created".
I'm not saying that this information is not usefull. It generates dozens of SQL queries and can make the project list really slow. We'll make this information available once the project list can be configured, but we can't add it by default now.
Updated by Frederico Camara about 6 years ago
Jean-Philippe Lang wrote:
I'm not saying that this information is not usefull. It generates dozens of SQL queries and can make the project list really slow. We'll make this information available once the project list can be configured, but we can't add it by default now.
My thoughts exactly. I got it in production here and if you have dozens of projects, it generates lots and lots of queries. I kept it because it is just so useful, but with 400 projects and near 2000 issues, opening the admin projects page takes near 22 seconds.
I'm studying how to better query the database. Redmine::Activity::Fetcher only uses projects as filters. I would need to construct a table with each project id and its last activity using just a few SQL queries.
Updated by Frederico Camara about 5 years ago
- File last_activity-2.r3.3.patch last_activity-2.r3.3.patch added
- File last_activity-2.r3.4.patch last_activity-2.r3.4.patch added
I have a new patch. I added a new option to the fetcher library, if set, the result is a hash { project_id -> last_activity }, that I use in the view.
Summarizing I reduced the queries to one per event type, which takes now a fraction of a second to complete.
Updated by Frederico Camara about 5 years ago
- File last_activity-3.r3.3.patch last_activity-3.r3.3.patch added
- File last_activity-3.r3.4.patch last_activity-3.r3.4.patch added
I fixed a bug, and moved some code from the helpers to the controllers. I also had an idea how to always show some activity as Feature #3099.
Updated by Marius BALTEANU over 4 years ago
- Related to Feature #29482: Query system for Projects page added
Updated by Yuuki NARA over 3 years ago
- File 23954-trunk-note11.png 23954-trunk-note11.png added
It worked on Redmine trunk with the same changes. note-11
Attach a screen copy of my environment.
Last activity is not displayed for projects with 0 tickets.
However, as it can be seen from the Created column, I think that it is enough as it is.
Updated by Marius BALTEANU over 3 years ago
I think we should add this column on top of #29482.
Updated by Marius BALTEANU over 3 years ago
- File 0001-Adds-last-activity-column-to-projects-list.patch added
Based on Frederico Camara work, I've created a patch that adds the "Last activity" column to the projects list.
Sorting by this column is not possible for now because I'm not sure how to implement it easily (the last activity date is calculated based on multiple tables). Any suggestion is welcome.
Updated by Marius BALTEANU over 3 years ago
- File deleted (
0001-Adds-last-activity-column-to-projects-list.patch)
Updated by Marius BALTEANU over 3 years ago
- File 0001-Adds-last-activity-column-to-projects-list.patch added
Slightly improved the patch in order to avoid some unnecessary joins when counting the number of results.
Updated by Marius BALTEANU over 3 years ago
- File deleted (
0001-Adds-last-activity-column-to-projects-list.patch)
Updated by Marius BALTEANU over 3 years ago
- File 0001-Adds-last-activity-column-to-projects-list.patch added
Updated by Marius BALTEANU over 3 years ago
- Related to Feature #805: Allow projects view to be sorted by activity added
Updated by Marius BALTEANU about 3 years ago
- File deleted (
0001-Adds-last-activity-column-to-projects-list.patch)
Updated by Marius BALTEANU about 3 years ago
- File 0001-Adds-last-activity-column-to-projects-list.patch added
- Category changed from Administration to Projects
- Assignee set to Jean-Philippe Lang
- Target version changed from Candidate for next major release to 4.2.0
Updated the patch for current trunk.
@Jean-Philippe, I'm assigning to you in order to:- review the changes proposed by Frederico Camara to activity fetcher
- check for any solution to enable projects sorting by last activity date
Updated by Toshi MARUYAMA about 3 years ago
- Related to Feature #3099: Last activity time window. added
Updated by Marius BALTEANU almost 3 years ago
- File deleted (
0001-Adds-last-activity-column-to-projects-list.patch)
Updated by Marius BALTEANU almost 3 years ago
- File 0001-Adds-last-activity-column-to-projects-list.patch 0001-Adds-last-activity-column-to-projects-list.patch added
Updated the patch to apply cleanly on the current trunk.
Updated by Marius BALTEANU about 2 years ago
- Target version changed from 4.2.0 to 5.0.0
Updated by zumo de vidrio almost 2 years ago
Can you please share the SQL query or API request in order to get the last activity date of every project ?
Updated by Frederico Camara almost 2 years ago
zumo de vidrio wrote:
Can you please share the SQL query or API request in order to get the last activity date of every project ?
As a hash:
Redmine::Activity::Fetcher.new(User.current).events(nil, nil, :last_by_project => true).to_h
Updated by Marius BALTEANU about 1 year ago
- Target version changed from 5.0.0 to Candidate for next major release