Project

General

Profile

Actions

Feature #35797

open

Don't show issues without spent time on the issues list with 0.00/0:00 spent time values

Added by Mischa The Evil about 5 years ago. Updated 15 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues list
Target version:
Resolution:

Description

Currently issues without spent time are rendered on the issues list with 0.00/0:00 spent time values.
I think it would make more sense to completely omit showing any spent time values for such issues instead. Such would tidy up the issue list some more, rendering only actually set values.


Files


Related issues

Related to Redmine - Patch #35674: Several improvements (with fixes of inconsistencies) for the issues show viewNewActions
Actions #1

Updated by Mischa The Evil about 5 years ago

  • Related to Patch #35674: Several improvements (with fixes of inconsistencies) for the issues show view added
Actions #2

Updated by Marius BĂLTEANU about 5 years ago

  • Target version set to Candidate for next major release

The easiest and safest way to achieve this is to render the column content only when the spent time or total spent time is > 0:

diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 9b223f84a..401b8d776 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -268,9 +268,13 @@ module QueriesHelper
       when :hours, :estimated_hours, :total_estimated_hours
         format_hours(value)
       when :spent_hours
-        link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}"))
+        if value > 0
+          link_to(format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}"))
+        end
       when :total_spent_hours
-        link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "~#{item.id}"))
+        if value > 0
+          link_to(format_hours(value), project_time_entries_path(item.project, :issue_id => "~#{item.id}"))
+        end
       when :attachments
         value.to_a.map {|a| format_object(a)}.join(" ").html_safe

The current issue where an issue with spent time added with 0 hours cannot be distinguish from an issue with no spent times will remain.

I'm in favour of this change because the view will be cleaner and consistent with estimated time columns.

Actions #3

Updated by Go MAEDA 15 days ago

Here is a patch based on the one Marius posted in #note-2, with only minor changes.

Changes from the original code:

  • Changed the column value to an empty string instead of nil when the value is 0, to be consistent with the other branches in the same case statement. The rendered output is the same.
  • Updated the tests to verify that "0:00" is no longer displayed in the Spent time and Total spent time columns.

As Marius noted, an issue that has only 0-hour time entries cannot be distinguished from one with no time entries. I think this is acceptable because the issue page already shows the "Spent time" row only when the total is greater than 0, and such entries require the "Accept time logs with 0 hours" setting.

Actions

Also available in: Atom PDF