diff options
Diffstat (limited to 'app/views/instance_statistics/dev_ops_score')
5 files changed, 92 insertions, 0 deletions
diff --git a/app/views/instance_statistics/dev_ops_score/_callout.html.haml b/app/views/instance_statistics/dev_ops_score/_callout.html.haml new file mode 100644 index 00000000000..64eb72c0d8d --- /dev/null +++ b/app/views/instance_statistics/dev_ops_score/_callout.html.haml @@ -0,0 +1,13 @@ +.prepend-top-default +.user-callout{ data: { uid: 'dev_ops_score_intro_callout_dismissed' } } + .bordered-box.landing.content-block + %button.btn.btn-default.close.js-close-callout{ type: 'button', + 'aria-label' => _('Dismiss DevOps Score introduction') } + = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') + .user-callout-copy + %h4 + = _('Introducing Your DevOps Score') + %p + = _('Your DevOps Score gives an overview of how you are using GitLab from a feature perspective. View how you compare with other organizations, discover features you are not using, and learn best practices through blog posts and white papers.') + .svg-container.devops + = custom_icon('dev_ops_score_overview') diff --git a/app/views/instance_statistics/dev_ops_score/_card.html.haml b/app/views/instance_statistics/dev_ops_score/_card.html.haml new file mode 100644 index 00000000000..c63bd96a175 --- /dev/null +++ b/app/views/instance_statistics/dev_ops_score/_card.html.haml @@ -0,0 +1,25 @@ +.devops-card-wrapper + .devops-card{ class: "devops-card-#{score_level(card.percentage_score)}" } + .devops-card-title + %h3 + = card.title + .light-text + = card.description + .board-card-scores + .board-card-score + .board-card-score-value + = format_score(card.instance_score) + .board-card-score-name= _('You') + .board-card-score + .board-card-score-value + = format_score(card.leader_score) + .board-card-score-name= _('Lead') + .board-card-score-big + = number_to_percentage(card.percentage_score, precision: 1) + .board-card-buttons + - if card.blog + %a{ href: card.blog } + = icon('info-circle', 'aria-hidden' => 'true') + - if card.docs + %a{ href: card.docs } + = icon('question-circle', 'aria-hidden' => 'true') diff --git a/app/views/instance_statistics/dev_ops_score/_disabled.html.haml b/app/views/instance_statistics/dev_ops_score/_disabled.html.haml new file mode 100644 index 00000000000..da27ea17b61 --- /dev/null +++ b/app/views/instance_statistics/dev_ops_score/_disabled.html.haml @@ -0,0 +1,14 @@ +.container.devops-empty + .col-sm-12.justify-content-center.text-center + = custom_icon('dev_ops_score_no_index') + %h4= _('Usage ping is not enabled') + - if !current_user.admin? + %p + - usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping') + - usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: usage_ping_path } + = s_('In order to enable instance-level analytics, please ask an admin to enable %{usage_ping_link_start}usage ping%{usage_ping_link_end}.').html_safe % { usage_ping_link_start: usage_ping_link_start, usage_ping_link_end: '</a>'.html_safe } + - if current_user.admin? + %p + = _('Enable usage ping to get an overview of how you are using GitLab from a feature perspective.') + - if current_user.admin? + = link_to _('Enable usage ping'), metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), class: 'btn btn-primary' diff --git a/app/views/instance_statistics/dev_ops_score/_no_data.html.haml b/app/views/instance_statistics/dev_ops_score/_no_data.html.haml new file mode 100644 index 00000000000..54598244039 --- /dev/null +++ b/app/views/instance_statistics/dev_ops_score/_no_data.html.haml @@ -0,0 +1,7 @@ +.container.devops-empty + .col-sm-12.justify-content-center.text-center + = custom_icon('dev_ops_score_no_data') + %h4= _('Data is still calculating...') + %p + = _('In order to gather accurate feature usage data, it can take 1 to 2 weeks to see your index.') + = link_to _('Learn more'), help_page_path('user/instance_statistics/dev_ops_score'), target: '_blank' diff --git a/app/views/instance_statistics/dev_ops_score/index.html.haml b/app/views/instance_statistics/dev_ops_score/index.html.haml new file mode 100644 index 00000000000..44c6e9664db --- /dev/null +++ b/app/views/instance_statistics/dev_ops_score/index.html.haml @@ -0,0 +1,33 @@ +- page_title _('DevOps Score') +- usage_ping_enabled = Gitlab::CurrentSettings.usage_ping_enabled + +.container + - if usage_ping_enabled && show_callout?('dev_ops_score_intro_callout_dismissed') + = render 'callout' + + .prepend-top-default + - if !usage_ping_enabled + = render 'disabled' + - elsif @metric.blank? + = render 'no_data' + - else + .devops + .devops-header + %h2.devops-header-title{ class: "devops-#{score_level(@metric.average_percentage_score)}-score" } + = number_to_percentage(@metric.average_percentage_score, precision: 1) + .devops-header-subtitle + = _('index') + %br + = _('score') + = link_to icon('question-circle', 'aria-hidden' => 'true'), help_page_path('user/instance_statistics/dev_ops_score') + + .devops-cards.board-card-container + - @metric.cards.each do |card| + = render 'card', card: card + + .devops-steps.d-none.d-lg-block.d-xl-block + - @metric.idea_to_production_steps.each_with_index do |step, index| + .devops-step{ class: "devops-#{score_level(step.percentage_score)}-score" } + = custom_icon("i2p_step_#{index + 1}") + %h4.devops-step-title + = step.title |