diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-11 15:09:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-11 15:09:43 +0300 |
commit | 54f170b69972d46a5bab2a0231510a41e610da31 (patch) | |
tree | 6943aba13e4bdf28045136d0c1a1f26c4d3fb94f /app/presenters | |
parent | 8c59925bbbc05315565cd9eb54c897be69072d65 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/analytics/cycle_analytics/stage_presenter.rb | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/app/presenters/analytics/cycle_analytics/stage_presenter.rb b/app/presenters/analytics/cycle_analytics/stage_presenter.rb new file mode 100644 index 00000000000..7b295b814bc --- /dev/null +++ b/app/presenters/analytics/cycle_analytics/stage_presenter.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Analytics + module CycleAnalytics + class StagePresenter < Gitlab::View::Presenter::Delegated + def title + extract_default_stage_attribute(:title) || name + end + + def description + extract_default_stage_attribute(:description) || '' + end + + def legend + '' + end + + private + + def extract_default_stage_attribute(attribute) + default_stage_attributes.dig(name.to_sym, attribute.to_sym) + end + + def default_stage_attributes + @default_stage_attributes ||= { + issue: { + title: s_('CycleAnalyticsStage|Issue'), + description: _('Time before an issue gets scheduled') + }, + plan: { + title: s_('CycleAnalyticsStage|Plan'), + description: _('Time before an issue starts implementation') + }, + code: { + title: s_('CycleAnalyticsStage|Code'), + description: _('Time until first merge request') + }, + test: { + title: s_('CycleAnalyticsStage|Test'), + description: _('Total test time for all commits/merges') + }, + review: { + title: s_('CycleAnalyticsStage|Review'), + description: _('Time between merge request creation and merge/close') + }, + staging: { + title: s_('CycleAnalyticsStage|Staging'), + description: _('From merge request merge until deploy to production') + }, + production: { + title: s_('CycleAnalyticsStage|Total'), + description: _('From issue creation until deploy to production') + } + }.freeze + end + end + end +end |