From 1a4f497e6093c8d1005986467c8b752cc61c6629 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Fri, 21 Sep 2018 15:24:19 +0900 Subject: Update pipelines and stages status as well --- app/helpers/ci_status_helper.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/helpers') diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 136772e1ec3..f343607a343 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -7,6 +7,7 @@ # # See 'detailed_status?` method and `Gitlab::Ci::Status` module. # +# TODO: DO I need to update this deprecated module? module CiStatusHelper def ci_label_for_status(status) if detailed_status?(status) -- cgit v1.2.1 From ea38e832f0f197c5121504d7e193227d3d9c7867 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Thu, 27 Sep 2018 13:44:03 +0200 Subject: Allow remaining time of scheduled jobs to overflow one day --- app/helpers/time_helper.rb | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb index 94044d7b85e..737ec33b2dd 100644 --- a/app/helpers/time_helper.rb +++ b/app/helpers/time_helper.rb @@ -21,9 +21,21 @@ module TimeHelper "#{from.to_s(:short)} - #{to.to_s(:short)}" end - def duration_in_numbers(duration) - time_format = duration < 1.hour ? "%M:%S" : "%H:%M:%S" + def duration_in_numbers(duration_in_seconds, allow_overflow = false) + if allow_overflow + seconds = duration_in_seconds % 1.minute + minutes = (duration_in_seconds / 1.minute) % (1.hour / 1.minute) + hours = duration_in_seconds / 1.hour - Time.at(duration).utc.strftime(time_format) + if hours == 0 + "%02d:%02d" % [minutes, seconds] + else + "%02d:%02d:%02d" % [hours, minutes, seconds] + end + else + time_format = duration_in_seconds < 1.hour ? "%M:%S" : "%H:%M:%S" + + Time.at(duration_in_seconds).utc.strftime(time_format) + end end end -- cgit v1.2.1 From eb238ec16004d9d22c20193eb8a8ee6cf0df4c8b Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Mon, 1 Oct 2018 19:00:34 +0900 Subject: Fix scheduled icon for stages --- app/helpers/ci_status_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/helpers') diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index f343607a343..6f9e2ef78cd 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -7,7 +7,6 @@ # # See 'detailed_status?` method and `Gitlab::Ci::Status` module. # -# TODO: DO I need to update this deprecated module? module CiStatusHelper def ci_label_for_status(status) if detailed_status?(status) @@ -21,6 +20,8 @@ module CiStatusHelper 'passed with warnings' when 'manual' 'waiting for manual action' + when 'scheduled' + 'waiting for delayed job' else status end @@ -40,6 +41,8 @@ module CiStatusHelper s_('CiStatusText|passed') when 'manual' s_('CiStatusText|blocked') + when 'scheduled' + s_('CiStatusText|scheduled') else # All states are already being translated inside the detailed statuses: # :running => Gitlab::Ci::Status::Running @@ -84,6 +87,8 @@ module CiStatusHelper 'status_skipped' when 'manual' 'status_manual' + when 'scheduled' + 'status_scheduled' else 'status_canceled' end -- cgit v1.2.1 From 786ae683679d90a0e55bfe844ac694aeb7d68ce6 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Mon, 1 Oct 2018 12:55:09 +0200 Subject: Do not omit leading zeros in duration_in_numbers helper --- app/helpers/time_helper.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb index 737ec33b2dd..3e6a301b77d 100644 --- a/app/helpers/time_helper.rb +++ b/app/helpers/time_helper.rb @@ -27,11 +27,7 @@ module TimeHelper minutes = (duration_in_seconds / 1.minute) % (1.hour / 1.minute) hours = duration_in_seconds / 1.hour - if hours == 0 - "%02d:%02d" % [minutes, seconds] - else - "%02d:%02d:%02d" % [hours, minutes, seconds] - end + "%02d:%02d:%02d" % [hours, minutes, seconds] else time_format = duration_in_seconds < 1.hour ? "%M:%S" : "%H:%M:%S" -- cgit v1.2.1