From d8462638e1b6faefe49c87c84ed819d525781a84 Mon Sep 17 00:00:00 2001 From: George Andrinopoulos Date: Thu, 2 Nov 2017 22:03:50 +0200 Subject: [PATCH] Fix collapsed sidebar messages and icon --- app/models/global_milestone.rb | 2 +- app/models/milestone.rb | 2 +- app/views/shared/icons/_icon_hourglass.svg | 1 + app/views/shared/milestones/_sidebar.html.haml | 14 ++++++++++---- .../39335-add-time-spend-to-milestones.yml | 5 +++++ 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 app/views/shared/icons/_icon_hourglass.svg create mode 100644 changelogs/unreleased/39335-add-time-spend-to-milestones.yml 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 @@ + 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