diff options
-rw-r--r-- | app/models/global_milestone.rb | 2 | ||||
-rw-r--r-- | app/models/milestone.rb | 2 | ||||
-rw-r--r-- | app/views/shared/icons/_icon_hourglass.svg | 1 | ||||
-rw-r--r-- | app/views/shared/milestones/_sidebar.html.haml | 14 | ||||
-rw-r--r-- | changelogs/unreleased/39335-add-time-spend-to-milestones.yml | 5 |
5 files changed, 18 insertions, 6 deletions
diff --git a/app/models/global_milestone.rb b/app/models/global_milestone.rb index af4780f78d0..18af3c41d61 100644 --- a/app/models/global_milestone.rb +++ b/app/models/global_milestone.rb @@ -158,6 +158,6 @@ class GlobalMilestone end def human_total_time_spent - Gitlab::TimeTrackingFormatter.output(total_time_spent) || 0 + Gitlab::TimeTrackingFormatter.output(total_time_spent) end end diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 5e174a15c91..fa2dfcb694b 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -218,7 +218,7 @@ class Milestone < ActiveRecord::Base end def human_total_time_spent - Gitlab::TimeTrackingFormatter.output(total_time_spent) || 0 + Gitlab::TimeTrackingFormatter.output(total_time_spent) end private diff --git a/app/views/shared/icons/_icon_hourglass.svg b/app/views/shared/icons/_icon_hourglass.svg new file mode 100644 index 00000000000..fe7e497ce13 --- /dev/null +++ b/app/views/shared/icons/_icon_hourglass.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M10.331 4.889A2.988 2.988 0 0 0 11 3V2H5v1c0 .362.064.709.182 1.03l5.15.859zM3 14v-1c0-1.78.93-3.342 2.33-4.228.447-.327.67-.582.67-.764 0-.19-.242-.46-.725-.815A4.996 4.996 0 0 1 3 3V2H2a1 1 0 1 1 0-2h12a1 1 0 0 1 0 2h-1v1a4.997 4.997 0 0 1-2.39 4.266c-.407.3-.61.545-.61.734 0 .19.203.434.61.734A4.997 4.997 0 0 1 13 13v1h1a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2h1zm8 0v-1a3 3 0 0 0-6 0v1h6z"/></svg> diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index 6267151f460..65e70f13055 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -87,13 +87,19 @@ .block.time_spent .sidebar-collapsed-icon - %strong - = custom_icon('icon_clock_o') - %span= milestone.human_total_time_spent + = custom_icon('icon_hourglass') + %span.collapsed-milestone-total-time-spent + - if milestone.human_total_time_spent + = milestone.human_total_time_spent + - else + None .title.hide-collapsed Total time spent .value.hide-collapsed - = milestone.human_total_time_spent + - if milestone.human_total_time_spent + %span.bold= milestone.human_total_time_spent + -else + %span.no-value No time spent .block.merge-requests .sidebar-collapsed-icon diff --git a/changelogs/unreleased/39335-add-time-spend-to-milestones.yml b/changelogs/unreleased/39335-add-time-spend-to-milestones.yml new file mode 100644 index 00000000000..41a43418cbf --- /dev/null +++ b/changelogs/unreleased/39335-add-time-spend-to-milestones.yml @@ -0,0 +1,5 @@ +--- +title: Add total time spent to milestones +merge_request: 15116 +author: George Andrinopoulos +type: added |