debian-mirror-gitlab/lib/gitlab/cycle_analytics/summary/issue.rb

34 lines
714 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
module Gitlab
module CycleAnalytics
module Summary
class Issue < Base
2019-12-21 20:55:43 +05:30
def initialize(project:, from:, to: nil, current_user:)
2017-08-17 22:00:37 +05:30
@project = project
@from = from
2019-12-21 20:55:43 +05:30
@to = to
2017-08-17 22:00:37 +05:30
@current_user = current_user
end
def title
n_('New Issue', 'New Issues', value)
end
def value
2020-05-24 23:13:21 +05:30
@value ||= Value::PrettyNumeric.new(issues_count)
end
private
def issues_count
IssuesFinder
.new(@current_user, project_id: @project.id, created_after: @from, created_before: @to)
.execute
.count
2017-08-17 22:00:37 +05:30
end
end
end
end
end