Commit 094cac3a authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'ag-rename-convdev-routing' into 'master'

[Routes, Controller] Rename ConvDev Index to DevOps Score

See merge request gitlab-org/gitlab!20797
parents 6beaeb9c 6a13187d
# frozen_string_literal: true
class InstanceStatistics::ConversationalDevelopmentIndexController < InstanceStatistics::ApplicationController
class InstanceStatistics::DevOpsScoreController < InstanceStatistics::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def index
@metric = DevOpsScore::Metric.order(:created_at).last&.present
......
.prepend-top-default
.user-callout{ data: { uid: 'convdev_intro_callout_dismissed' } }
.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 ConvDev introduction') }
......
......@@ -4,4 +4,4 @@
%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/convdev'), target: '_blank'
= link_to _('Learn more'), help_page_path('user/instance_statistics/dev_ops_score'), target: '_blank'
......@@ -2,7 +2,7 @@
- usage_ping_enabled = Gitlab::CurrentSettings.usage_ping_enabled
.container
- if usage_ping_enabled && show_callout?('convdev_intro_callout_dismissed')
- if usage_ping_enabled && show_callout?('dev_ops_score_intro_callout_dismissed')
= render 'callout'
.prepend-top-default
......@@ -19,7 +19,7 @@
= _('index')
%br
= _('score')
= link_to icon('question-circle', 'aria-hidden' => 'true'), help_page_path('user/instance_statistics/convdev')
= 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|
......
......@@ -48,7 +48,7 @@
%li.dropdown
= render_if_exists 'dashboard/nav_link_list'
- if can?(current_user, :read_instance_statistics)
= nav_link(controller: [:conversational_development_index, :cohorts]) do
= nav_link(controller: [:dev_ops_score, :cohorts]) do
= link_to instance_statistics_root_path do
= _('Instance Statistics')
- if current_user.admin?
......
......@@ -6,15 +6,15 @@
= sprite_icon('chart', size: 24)
.sidebar-context-title= _('Instance Statistics')
%ul.sidebar-top-level-items
= nav_link(controller: :conversational_development_index) do
= link_to instance_statistics_conversational_development_index_index_path do
= nav_link(controller: :dev_ops_score) do
= link_to instance_statistics_dev_ops_score_index_path do
.nav-icon-container
= sprite_icon('comment')
%span.nav-item-name
= _('ConvDev Index')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :conversational_development_index, html_options: { class: "fly-out-top-item" } ) do
= link_to instance_statistics_conversational_development_index_index_path do
= nav_link(controller: :dev_ops_score, html_options: { class: "fly-out-top-item" } ) do
= link_to instance_statistics_dev_ops_score_index_path do
%strong.fly-out-top-item-name
= _('ConvDev Index')
......
# frozen_string_literal: true
namespace :instance_statistics do
root to: redirect('-/instance_statistics/conversational_development_index')
root to: redirect('-/instance_statistics/dev_ops_score')
resources :cohorts, only: :index
resources :conversational_development_index, only: :index
resources :dev_ops_score, only: :index
end
......@@ -7,10 +7,10 @@ module RuboCop
#
# @example
# # bad
# root to: redirect('/-/instance/statistics/conversational_development_index')
# root to: redirect('/-/instance/statistics/dev_ops_score')
#
# # good
# root to: redirect('-/instance/statistics/conversational_development_index')
# root to: redirect('-/instance/statistics/dev_ops_score')
#
class AvoidRouteRedirectLeadingSlash < RuboCop::Cop::Cop
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe InstanceStatistics::ConversationalDevelopmentIndexController do
describe InstanceStatistics::DevOpsScoreController do
it_behaves_like 'instance statistics availability'
end
......@@ -2,13 +2,13 @@
require 'spec_helper'
describe 'Conversational Development Index' do
describe 'Dev Ops Score' do
before do
sign_in(create(:admin))
end
it 'has dismissable intro callout', :js do
visit instance_statistics_conversational_development_index_index_path
visit instance_statistics_dev_ops_score_index_path
expect(page).to have_content 'Introducing Your Conversational Development Index'
......@@ -23,13 +23,13 @@ describe 'Conversational Development Index' do
end
it 'shows empty state' do
visit instance_statistics_conversational_development_index_index_path
visit instance_statistics_dev_ops_score_index_path
expect(page).to have_content('Usage ping is not enabled')
end
it 'hides the intro callout' do
visit instance_statistics_conversational_development_index_index_path
visit instance_statistics_dev_ops_score_index_path
expect(page).not_to have_content 'Introducing Your Conversational Development Index'
end
......@@ -39,7 +39,7 @@ describe 'Conversational Development Index' do
it 'shows empty state' do
stub_application_setting(usage_ping_enabled: true)
visit instance_statistics_conversational_development_index_index_path
visit instance_statistics_dev_ops_score_index_path
expect(page).to have_content('Data is still calculating')
end
......@@ -50,7 +50,7 @@ describe 'Conversational Development Index' do
stub_application_setting(usage_ping_enabled: true)
create(:dev_ops_score_metric)
visit instance_statistics_conversational_development_index_index_path
visit instance_statistics_dev_ops_score_index_path
expect(page).to have_content(
'Issues created per active user 1.2 You 9.3 Lead 13.3%'
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe 'Instance Statistics', 'routing' do
include RSpec::Rails::RequestExampleGroup
it "routes '/-/instance_statistics' to conversational development index" do
expect(get('/-/instance_statistics')).to redirect_to('/-/instance_statistics/conversational_development_index')
it "routes '/-/instance_statistics' to dev ops score" do
expect(get('/-/instance_statistics')).to redirect_to('/-/instance_statistics/dev_ops_score')
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment