summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/status/build/scheduled.rb
blob: b3452eae189ef587e770a764b6973727ca4540f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

module Gitlab
  module Ci
    module Status
      module Build
        class Scheduled < Status::Extended
          def illustration
            {
              image: 'illustrations/illustrations_scheduled-job_countdown.svg',
              size: 'svg-394',
              title: _("This is a delayed job to run in %{remainingTime}"),
              content: _("This job will automatically run after it's timer finishes. " \
                         "Often they are used for incremental roll-out deploys " \
                         "to production environments. When unscheduled it converts " \
                         "into a manual action.")
            }
          end

          def status_tooltip
            "delayed manual action (%{remainingTime})"
          end

          def self.matches?(build, user)
            build.scheduled? && build.scheduled_at
          end
        end
      end
    end
  end
end