Commit 323574cc authored by Adam Hegyi's avatar Adam Hegyi

Toggle analytics navbar feature flags default on

- Turn feature flags default on
  - analytics_pages_under_project_analytics_sidebar
  - analytics_pages_under_group_analytics_sidebar
- Documentation changes.
- Update QA tests and remove some duplicated methods.
parent 0a8d441b
......@@ -31,7 +31,7 @@ module AnalyticsNavbarHelper
end
def cycle_analytics_navbar_link(project, current_user)
return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project)
return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project, default_enabled: true)
return unless project_nav_tab?(:cycle_analytics)
navbar_sub_item(
......@@ -43,7 +43,7 @@ module AnalyticsNavbarHelper
end
def repository_analytics_navbar_link(project, current_user)
return if Feature.disabled?(:analytics_pages_under_project_analytics_sidebar, project)
return if Feature.disabled?(:analytics_pages_under_project_analytics_sidebar, project, default_enabled: true)
return if project.empty_repo?
navbar_sub_item(
......@@ -55,7 +55,7 @@ module AnalyticsNavbarHelper
end
def ci_cd_analytics_navbar_link(project, current_user)
return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project)
return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project, default_enabled: true)
return unless project_nav_tab?(:pipelines)
return unless project.feature_available?(:builds, current_user) || !project.empty_repo?
......
......@@ -6,10 +6,10 @@
= link_to navbar_links.first.link do
.nav-icon-container
= sprite_icon('chart')
%span.nav-item-name
%span.nav-item-name{ data: { qa_selector: 'analytics_link' } }
= _('Analytics')
%ul.sidebar-sub-level-items
%ul.sidebar-sub-level-items{ data: { qa_selector: 'analytics_sidebar_submenu' } }
- navbar_links.each do |menu_item|
= nav_link(path: menu_item.path) do
= link_to(menu_item.link, menu_item.link_to_options) do
......
- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, @group)
- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, @group, default_enabled: true)
- issues_count = group_issues_count(state: 'opened')
- merge_requests_count = group_merge_requests_count(state: 'opened')
......
- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, @project)
- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, @project, default_enabled: true)
.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) }
.nav-sidebar-inner-scroll
......@@ -9,7 +9,7 @@
= project_icon(@project, alt: @project.name, class: 'avatar s40 avatar-tile', width: 40, height: 40)
.sidebar-context-title
= @project.name
%ul.sidebar-top-level-items
%ul.sidebar-top-level-items.qa-project-sidebar
- paths = sidebar_projects_paths
- paths << 'cycle_analytics#show' unless should_display_analytics_pages_in_sidebar
= nav_link(path: paths, html_options: { class: 'home' }) do
......
---
title: Move analytics pages under the sidebar for projects and groups
merge_request: 24470
author:
type: changed
......@@ -16,7 +16,7 @@ group:
- Merge requests
- Push events
To view the Contribution Analytics, go to your group's **Overview > Contribution Analytics**
To view the Contribution Analytics, go to your group's **Analytics > Contribution Analytics**
page.
## Use cases
......
......@@ -14,10 +14,10 @@ requests to be merged and much more.
## View your group's Insights
You can access your group's Insights by clicking the **Overview > Insights**
You can access your group's Insights by clicking the **Analytics > Insights**
link in the left sidebar:
![Insights sidebar link](img/insights_sidebar_link.png)
![Insights sidebar link](img/insights_sidebar_link_v12_8.png)
## Configure your Insights
......
......@@ -10,7 +10,7 @@ Issues Analytics is a bar graph which illustrates the number of issues created e
The default timespan is 13 months, which includes the current month, and the 12 months
prior.
To access the chart, navigate to a group's sidebar and select **Issues > Analytics**.
To access the chart, navigate to a group's sidebar and select **Analytics > Issues Analytics**.
Hover over each bar to see the total number of issues.
......@@ -28,7 +28,7 @@ You can change the total number of months displayed by setting a URL parameter.
For example, `https://gitlab.com/groups/gitlab-org/-/issues_analytics?months_back=15`
shows a total of 15 months for the chart in the GitLab.org group.
![Issues created per month](img/issues_created_per_month.png)
![Issues created per month](img/issues_created_per_month_v12_8.png)
<!-- ## Troubleshooting
......
......@@ -13,10 +13,10 @@ This feature is [also available at the group level](../../group/insights/index.m
## View your project's Insights
You can access your project's Insights by clicking the **Project > Insights**
You can access your project's Insights by clicking the **Analytics > Insights**
link in the left sidebar:
![Insights sidebar link](img/insights_sidebar_link.png)
![Insights sidebar link](img/insights_sidebar_link_v12_8.png)
## Configure your Insights
......
......@@ -52,7 +52,7 @@ relatively quickly to work, and they will take you to another page in the projec
| <kbd>t</kbd> | Go to the project file search page. (**Repository > Files**, click **Find Files**). |
| <kbd>g</kbd> + <kbd>c</kbd> | Go to the project commits list (**Repository > Commits**). |
| <kbd>g</kbd> + <kbd>n</kbd> | Go to the [repository graph](#repository-graph) page (**Repository > Graph**). |
| <kbd>g</kbd> + <kbd>d</kbd> | Go to repository charts (**Repository > Charts**). |
| <kbd>g</kbd> + <kbd>d</kbd> | Go to repository charts (**Analytics > Repository Analytics**). |
| <kbd>g</kbd> + <kbd>i</kbd> | Go to the project issues list (**Issues > List**). |
| <kbd>i</kbd> | Go to the New Issue page (**Issues**, click **New Issue** ). |
| <kbd>g</kbd> + <kbd>b</kbd> | Go to the project issue boards list (**Issues > Boards**). |
......
......@@ -37,7 +37,7 @@ module EE
end
def contribution_analytics_navbar_link(group, current_user)
return unless ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, group)
return unless ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, group, default_enabled: true)
return unless group_sidebar_link?(:contribution_analytics)
navbar_sub_item(
......@@ -49,7 +49,7 @@ module EE
end
def group_insights_navbar_link(group, current_user)
return unless ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, group)
return unless ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, group, default_enabled: true)
return unless group_sidebar_link?(:group_insights)
navbar_sub_item(
......@@ -61,7 +61,7 @@ module EE
end
def issues_analytics_navbar_link(group, current_user)
return unless ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, group)
return unless ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, group, default_enabled: true)
return unless group_sidebar_link?(:analytics)
navbar_sub_item(
......@@ -72,7 +72,7 @@ module EE
end
def insights_navbar_link(project, current_user)
return unless ::Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project)
return unless ::Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project, default_enabled: true)
return unless project_nav_tab?(:project_insights)
navbar_sub_item(
......
......@@ -13,7 +13,7 @@ module EE
override :group_overview_nav_link_paths
def group_overview_nav_link_paths
if ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, @group)
if ::Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, @group, default_enabled: true)
super
else
super + %w[
......
......@@ -6,7 +6,7 @@ module EE
override :sidebar_projects_paths
def sidebar_projects_paths
if ::Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, @project)
if ::Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, @project, default_enabled: true)
super
else
super + %w[
......
- page_title _('Analytics')
- page_title _('Issues Analytics')
= render 'shared/issuable/search_bar', type: :issues_analytics, show_sorting_dropdown: false
#js-issues-analytics{ data: { endpoint: group_issues_analytics_path(@group) } }
......@@ -159,6 +159,10 @@ module QA
autoload :Validator, 'qa/page/validator'
autoload :Validatable, 'qa/page/validatable'
module SubMenus
autoload :Common, 'qa/page/sub_menus/common'
end
module Main
autoload :Login, 'qa/page/main/login'
autoload :Menu, 'qa/page/main/menu'
......
......@@ -71,8 +71,10 @@ module QA
end
def click_group_insights_link
within_sidebar do
click_element(:group_insights_link)
hover_element(:analytics_link) do
within_submenu(:analytics_sidebar_submenu) do
click_element(:group_insights_link)
end
end
end
......
......@@ -15,8 +15,10 @@ module QA
end
def click_project_insights_link
within_sidebar do
click_element(:project_insights_link)
hover_element(:analytics_link) do
within_submenu(:analytics_sidebar_submenu) do
click_element(:project_insights_link)
end
end
end
end
......
......@@ -13,15 +13,22 @@ module QA
element :contribution_analytics_link
end
view 'app/views/layouts/nav/sidebar/_analytics_links.html.haml' do
element :analytics_link
element :analytics_sidebar_submenu
end
def click_group_members_item
within_sidebar do
click_element(:group_members_item)
end
end
def click_group_analytics_item
within_sidebar do
click_element(:contribution_analytics_link)
def click_contribution_analytics_item
hover_element(:analytics_link) do
within_submenu(:analytics_sidebar_submenu) do
click_element(:contribution_analytics_link)
end
end
end
......
......@@ -5,6 +5,8 @@ module QA
module Group
module SubMenus
module Common
include QA::Page::SubMenus::Common
def self.included(base)
base.class_eval do
view 'app/views/layouts/nav/sidebar/_group.html.haml' do
......@@ -13,23 +15,10 @@ module QA
end
end
def hover_element(element)
within_sidebar do
find_element(element).hover
yield
end
end
private
def within_sidebar
within_element(:group_sidebar) do
yield
end
end
def within_submenu(element)
within_element(element) do
yield
end
def sidebar_element
:group_sidebar
end
end
end
......
......@@ -5,20 +5,12 @@ module QA
module Project
module SubMenus
module Common
def within_sidebar
within('.sidebar-top-level-items') do
yield
end
end
include QA::Page::SubMenus::Common
private
def within_submenu
if has_css?('.fly-out-list')
within('.fly-out-list') do
yield
end
else
yield
end
def sidebar_element
:project_sidebar
end
end
end
......
# frozen_string_literal: true
module QA
module Page
module SubMenus
module Common
def hover_element(element)
within_sidebar do
find_element(element).hover
yield
end
end
def within_sidebar
within_element(sidebar_element) do
yield
end
end
def within_submenu(element = nil)
if element
within_element(element) do
yield
end
else
within_submenu_without_element do
yield
end
end
end
private
def within_submenu_without_element
if has_css?('.fly-out-list')
within('.fly-out-list') do
yield
end
else
yield
end
end
def sidebar_element
raise NotImplementedError
end
end
end
end
end
......@@ -38,7 +38,7 @@ module QA
Page::MergeRequest::Show.perform(&:merge!)
group.visit!
Page::Group::Menu.perform(&:click_group_analytics_item)
Page::Group::Menu.perform(&:click_contribution_analytics_item)
end
it 'tests contributions' do
......
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