Commit 44bba436 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch '26348-cleanup-navigation-order' into 'master'

Cleaning up navigational order - Project

Closes #26348

See merge request !9272
parents f14ee823 52352be6
...@@ -16,9 +16,6 @@ require('./shortcuts'); ...@@ -16,9 +16,6 @@ require('./shortcuts');
Mousetrap.bind('g p', function() { Mousetrap.bind('g p', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-project'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-project');
}); });
Mousetrap.bind('g e', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-project-activity');
});
Mousetrap.bind('g f', function() { Mousetrap.bind('g f', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-tree'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-tree');
}); });
...@@ -31,9 +28,6 @@ require('./shortcuts'); ...@@ -31,9 +28,6 @@ require('./shortcuts');
Mousetrap.bind('g n', function() { Mousetrap.bind('g n', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-network'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-network');
}); });
Mousetrap.bind('g g', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-graphs');
});
Mousetrap.bind('g i', function() { Mousetrap.bind('g i', function() {
return ShortcutsNavigation.findAndFollowLink('.shortcuts-issues'); return ShortcutsNavigation.findAndFollowLink('.shortcuts-issues');
}); });
......
...@@ -178,3 +178,29 @@ ...@@ -178,3 +178,29 @@
margin-left: $btn-side-margin; margin-left: $btn-side-margin;
} }
} }
.repo-charts {
.sub-header {
margin: 20px 0;
}
.sub-header-block.border-top {
margin-top: 20px;
padding: 0;
border-top: 1px solid $white-dark;
border-bottom: none;
}
.commit-stats li {
font-size: 16px;
}
.tree-ref-header {
margin-bottom: 20px;
h4 {
margin: 0;
line-height: 36px;
}
}
}
...@@ -17,6 +17,25 @@ class Projects::GraphsController < Projects::ApplicationController ...@@ -17,6 +17,25 @@ class Projects::GraphsController < Projects::ApplicationController
end end
def commits def commits
redirect_to action: 'charts'
end
def languages
redirect_to action: 'charts'
end
def charts
get_commits
get_languages
end
def ci
redirect_to charts_namespace_project_pipelines_path(@project.namespace, @project)
end
private
def get_commits
@commits = @project.repository.commits(@ref, limit: 2000, skip_merges: true) @commits = @project.repository.commits(@ref, limit: 2000, skip_merges: true)
@commits_graph = Gitlab::Graphs::Commits.new(@commits) @commits_graph = Gitlab::Graphs::Commits.new(@commits)
@commits_per_week_days = @commits_graph.commits_per_week_days @commits_per_week_days = @commits_graph.commits_per_week_days
...@@ -24,15 +43,7 @@ class Projects::GraphsController < Projects::ApplicationController ...@@ -24,15 +43,7 @@ class Projects::GraphsController < Projects::ApplicationController
@commits_per_month = @commits_graph.commits_per_month @commits_per_month = @commits_graph.commits_per_month
end end
def ci def get_languages
@charts = {}
@charts[:week] = Ci::Charts::WeekChart.new(project)
@charts[:month] = Ci::Charts::MonthChart.new(project)
@charts[:year] = Ci::Charts::YearChart.new(project)
@charts[:build_times] = Ci::Charts::BuildTime.new(project)
end
def languages
@languages = Linguist::Repository.new(@repository.rugged, @repository.rugged.head.target_id).languages @languages = Linguist::Repository.new(@repository.rugged, @repository.rugged.head.target_id).languages
total = @languages.map(&:last).sum total = @languages.map(&:last).sum
...@@ -52,8 +63,6 @@ class Projects::GraphsController < Projects::ApplicationController ...@@ -52,8 +63,6 @@ class Projects::GraphsController < Projects::ApplicationController
end end
end end
private
def fetch_graph def fetch_graph
@commits = @project.repository.commits(@ref, limit: 6000, skip_merges: true) @commits = @project.repository.commits(@ref, limit: 6000, skip_merges: true)
@log = [] @log = []
......
class Projects::PipelinesController < Projects::ApplicationController class Projects::PipelinesController < Projects::ApplicationController
before_action :pipeline, except: [:index, :new, :create] before_action :pipeline, except: [:index, :new, :create, :charts]
before_action :commit, only: [:show, :builds] before_action :commit, only: [:show, :builds]
before_action :authorize_read_pipeline! before_action :authorize_read_pipeline!
before_action :authorize_create_pipeline!, only: [:new, :create] before_action :authorize_create_pipeline!, only: [:new, :create]
before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action :authorize_update_pipeline!, only: [:retry, :cancel]
before_action :builds_enabled, only: :charts
def index def index
@scope = params[:scope] @scope = params[:scope]
...@@ -92,6 +93,14 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -92,6 +93,14 @@ class Projects::PipelinesController < Projects::ApplicationController
redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project)
end end
def charts
@charts = {}
@charts[:week] = Ci::Charts::WeekChart.new(project)
@charts[:month] = Ci::Charts::MonthChart.new(project)
@charts[:year] = Ci::Charts::YearChart.new(project)
@charts[:build_times] = Ci::Charts::BuildTime.new(project)
end
private private
def create_params def create_params
......
...@@ -128,12 +128,6 @@ ...@@ -128,12 +128,6 @@
.key p .key p
%td %td
Go to the project's home page Go to the project's home page
%tr
%td.shortcut
.key g
.key e
%td
Go to the project's activity feed
%tr %tr
%td.shortcut %td.shortcut
.key g .key g
...@@ -158,12 +152,6 @@ ...@@ -158,12 +152,6 @@
.key n .key n
%td %td
Go to network graph Go to network graph
%tr
%td.shortcut
.key g
.key g
%td
Go to graphs
%tr %tr
%td.shortcut %td.shortcut
.key g .key g
......
...@@ -21,40 +21,23 @@ ...@@ -21,40 +21,23 @@
.fade-right .fade-right
= icon('angle-right') = icon('angle-right')
%ul.nav-links.scrolling-tabs %ul.nav-links.scrolling-tabs
= nav_link(path: 'projects#show', html_options: {class: 'home'}) do = nav_link(path: ['projects#show', 'projects#activity', 'cycle_analytics#show'], html_options: { class: 'home' }) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
%span %span
Project Project
= nav_link(path: 'projects#activity') do
= link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do
%span
Activity
- if project_nav_tab? :files - if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare repositories tags branches releases network)) do = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare repositories tags branches releases graphs network)) do
= link_to project_files_path(@project), title: 'Repository', class: 'shortcuts-tree' do = link_to project_files_path(@project), title: 'Repository', class: 'shortcuts-tree' do
%span %span
Repository Repository
- if project_nav_tab? :pipelines
= nav_link(controller: [:pipelines, :builds, :environments, :cycle_analytics]) do
= link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
%span
Pipelines
- if project_nav_tab? :container_registry - if project_nav_tab? :container_registry
= nav_link(controller: %w(container_registry)) do = nav_link(controller: %w(container_registry)) do
= link_to project_container_registry_path(@project), title: 'Container Registry', class: 'shortcuts-container-registry' do = link_to project_container_registry_path(@project), title: 'Container Registry', class: 'shortcuts-container-registry' do
%span %span
Registry Registry
- if project_nav_tab? :graphs
= nav_link(controller: %w(graphs)) do
= link_to namespace_project_graph_path(@project.namespace, @project, current_ref), title: 'Graphs', class: 'shortcuts-graphs' do
%span
Graphs
- if project_nav_tab? :issues - if project_nav_tab? :issues
= nav_link(controller: [:issues, :labels, :milestones, :boards]) do = nav_link(controller: [:issues, :labels, :milestones, :boards]) do
= link_to namespace_project_issues_path(@project.namespace, @project), title: 'Issues', class: 'shortcuts-issues' do = link_to namespace_project_issues_path(@project.namespace, @project), title: 'Issues', class: 'shortcuts-issues' do
...@@ -70,6 +53,12 @@ ...@@ -70,6 +53,12 @@
Merge Requests Merge Requests
%span.badge.count.merge_counter= number_with_delimiter(MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened.count) %span.badge.count.merge_counter= number_with_delimiter(MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened.count)
- if project_nav_tab? :pipelines
= nav_link(controller: [:pipelines, :builds, :environments]) do
= link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
%span
Pipelines
- if project_nav_tab? :wiki - if project_nav_tab? :wiki
= nav_link(controller: :wikis) do = nav_link(controller: :wikis) do
= link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki' do = link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki' do
......
- @no_container = true - @no_container = true
= render "projects/head"
%div{ class: container_class } %div{ class: container_class }
.nav-block.activity-filter-block .nav-block.activity-filter-block
......
= content_for :sub_nav do
.scrolling-tabs-container.sub-nav-scroll
= render 'shared/nav_scroll'
.nav-links.sub-nav.scrolling-tabs
%ul{ class: container_class }
= nav_link(path: 'projects#show') do
= link_to project_path(@project), title: 'Project home', class: 'shortcuts-project' do
%span
Home
= nav_link(path: 'projects#activity') do
= link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do
%span
Activity
- if can?(current_user, :read_cycle_analytics, @project)
= nav_link(path: 'cycle_analytics#show') do
= link_to project_cycle_analytics_path(@project), title: 'Cycle Analytics', class: 'shortcuts-project-cycle-analytics' do
%span
Cycle Analytics
...@@ -11,14 +11,6 @@ ...@@ -11,14 +11,6 @@
= link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do = link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do
Commits Commits
= nav_link(controller: %w(network)) do
= link_to namespace_project_network_path(@project.namespace, @project, current_ref) do
Network
= nav_link(controller: :compare) do
= link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: current_ref) do
Compare
= nav_link(html_options: {class: branches_tab_class}) do = nav_link(html_options: {class: branches_tab_class}) do
= link_to namespace_project_branches_path(@project.namespace, @project) do = link_to namespace_project_branches_path(@project.namespace, @project) do
Branches Branches
...@@ -26,3 +18,19 @@ ...@@ -26,3 +18,19 @@
= nav_link(controller: [:tags, :releases]) do = nav_link(controller: [:tags, :releases]) do
= link_to namespace_project_tags_path(@project.namespace, @project) do = link_to namespace_project_tags_path(@project.namespace, @project) do
Tags Tags
= nav_link(path: 'graphs#show') do
= link_to namespace_project_graph_path(@project.namespace, @project, current_ref) do
Contributors
= nav_link(controller: %w(network)) do
= link_to namespace_project_network_path(@project.namespace, @project, current_ref) do
Graph
= nav_link(controller: :compare) do
= link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: current_ref) do
Compare
= nav_link(path: 'graphs#charts') do
= link_to charts_namespace_project_graph_path(@project.namespace, @project, current_ref) do
Charts
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('cycle_analytics') = page_specific_javascript_bundle_tag('cycle_analytics')
= render "projects/pipelines/head" = render "projects/head"
#cycle-analytics{ class: container_class, "v-cloak" => "true", data: { request_path: project_cycle_analytics_path(@project) } } #cycle-analytics{ class: container_class, "v-cloak" => "true", data: { request_path: project_cycle_analytics_path(@project) } }
- if @cycle_analytics_no_data - if @cycle_analytics_no_data
......
= content_for :sub_nav do
.scrolling-tabs-container.sub-nav-scroll
= render 'shared/nav_scroll'
.nav-links.sub-nav.scrolling-tabs
%ul{ class: (container_class) }
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('lib_chart')
= page_specific_javascript_bundle_tag('graphs')
= nav_link(action: :show) do
= link_to 'Contributors', namespace_project_graph_path
= nav_link(action: :commits) do
= link_to 'Commits', commits_namespace_project_graph_path
= nav_link(action: :languages) do
= link_to 'Languages', languages_namespace_project_graph_path
- if @project.feature_available?(:builds, current_user)
= nav_link(action: :ci) do
= link_to ci_namespace_project_graph_path do
Continuous Integration
- @no_container = true - @no_container = true
- page_title "Commits", "Graphs" - page_title "Charts"
= render 'head' - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('lib_chart')
= page_specific_javascript_bundle_tag('graphs')
= render "projects/commits/head"
%div{ class: container_class } .repo-charts{ class: container_class }
.sub-header-block %h4.sub-header
.tree-ref-holder Programming languages used in this repository
= render 'shared/ref_switcher', destination: 'graphs_commits'
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
%p.lead .row
Commit statistics for .col-md-4
%strong= @ref %ul.bordered-list
#{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')} - @languages.each do |language|
%li
%span{ style: "color: #{language[:color]}" }
= icon('circle')
&nbsp;
= language[:label]
.pull-right
= language[:value]
\%
.col-md-8
%canvas#languages-chart{ height: 400 }
.repo-charts{ class: container_class }
.sub-header-block.border-top
.row.tree-ref-header
.col-md-6
%h4
Commit statistics for
%strong= @ref
#{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')}
.col-md-6
.tree-ref-container
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs_commits'
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
.row .row
.col-md-6 .col-md-6
%ul %ul.commit-stats
%li %li
%p.lead Total:
%strong= @commits_graph.commits.size %strong #{@commits_graph.commits.size} commits
commits during
%strong= @commits_graph.duration
days
%li %li
%p.lead Average per day:
Average %strong #{@commits_graph.commit_per_day} commits
%strong= @commits_graph.commit_per_day
commits per day
%li %li
%p.lead Authors:
Contributed by %strong= @commits_graph.authors
%strong= @commits_graph.authors
authors
.col-md-6 .col-md-6
%div %div
%p.slead %p.slead
...@@ -40,15 +60,18 @@ ...@@ -40,15 +60,18 @@
%canvas#month-chart %canvas#month-chart
.row .row
.col-md-6 .col-md-6
%div
%p.slead
Commits per day hour (UTC)
%canvas#hour-chart
.col-md-6 .col-md-6
%div %div
%p.slead %p.slead
Commits per weekday Commits per weekday
%canvas#weekday-chart %canvas#weekday-chart
.row
.col-md-6
.col-md-6
%div
%p.slead
Commits per day hour (UTC)
%canvas#hour-chart
:javascript :javascript
var responsiveChart = function (selector, data) { var responsiveChart = function (selector, data) {
...@@ -93,3 +116,12 @@ ...@@ -93,3 +116,12 @@
var monthData = chartData(#{@commits_per_month.keys.to_json}, #{@commits_per_month.values.to_json}); var monthData = chartData(#{@commits_per_month.keys.to_json}, #{@commits_per_month.values.to_json});
responsiveChart($('#month-chart'), monthData); responsiveChart($('#month-chart'), monthData);
var data = #{@languages.to_json};
var ctx = $("#languages-chart").get(0).getContext("2d");
var options = {
scaleOverlay: true,
responsive: true,
maintainAspectRatio: false
}
var myPieChart = new Chart(ctx).Pie(data, options);
- @no_container = true
- page_title "Languages", "Graphs"
= render 'head'
%div{ class: container_class }
.sub-header-block
.oneline
Programming languages used in this repository
.row
.col-md-8
%canvas#languages-chart{ height: 400 }
.col-md-4
%ul.bordered-list
- @languages.each do |language|
%li
%span{ style: "color: #{language[:color]}" }
= icon('circle')
&nbsp;
= language[:label]
.pull-right
= language[:value]
\%
:javascript
var data = #{@languages.to_json};
var ctx = $("#languages-chart").get(0).getContext("2d");
var options = {
scaleOverlay: true,
responsive: true,
maintainAspectRatio: false
}
var myPieChart = new Chart(ctx).Pie(data, options);
- @no_container = true - @no_container = true
- page_title "Contributors", "Graphs" - page_title "Contributors"
= render 'head' - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('lib_chart')
= page_specific_javascript_bundle_tag('graphs')
= render 'projects/commits/head'
%div{ class: container_class } %div{ class: container_class }
.sub-header-block .sub-header-block
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
= nav_link(controller: :issues) do = nav_link(controller: :issues) do
= link_to namespace_project_issues_path(@project.namespace, @project), title: 'Issues' do = link_to namespace_project_issues_path(@project.namespace, @project), title: 'Issues' do
%span %span
Issues List
= nav_link(controller: :boards) do = nav_link(controller: :boards) do
= link_to namespace_project_boards_path(@project.namespace, @project), title: 'Board' do = link_to namespace_project_boards_path(@project.namespace, @project), title: 'Board' do
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
- @bulk_edit = can?(current_user, :admin_merge_request, @project) - @bulk_edit = can?(current_user, :admin_merge_request, @project)
- page_title "Merge Requests" - page_title "Merge Requests"
= render "projects/issues/head"
= render 'projects/last_push' = render 'projects/last_push'
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
......
- page_title "Network", @ref - page_title "Graph", @ref
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_tag('lib/raphael.js') = page_specific_javascript_tag('lib/raphael.js')
= page_specific_javascript_bundle_tag('network') = page_specific_javascript_bundle_tag('network')
......
...@@ -4,25 +4,25 @@ ...@@ -4,25 +4,25 @@
.nav-links.sub-nav.scrolling-tabs{ class: ('build' if local_assigns.fetch(:build_subnav, false)) } .nav-links.sub-nav.scrolling-tabs{ class: ('build' if local_assigns.fetch(:build_subnav, false)) }
%ul{ class: (container_class) } %ul{ class: (container_class) }
- if project_nav_tab? :pipelines - if project_nav_tab? :pipelines
= nav_link(controller: :pipelines) do = nav_link(path: 'pipelines#index', controller: :pipelines) do
= link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
%span %span
Pipelines Pipelines
- if project_nav_tab? :builds - if project_nav_tab? :builds
= nav_link(controller: %w(builds)) do = nav_link(path: 'builds#index', controller: :builds) do
= link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do = link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
%span %span
Jobs Jobs
- if project_nav_tab? :environments - if project_nav_tab? :environments
= nav_link(controller: %w(environments)) do = nav_link(path: 'environments#index', controller: :environments) do
= link_to project_environments_path(@project), title: 'Environments', class: 'shortcuts-environments' do = link_to project_environments_path(@project), title: 'Environments', class: 'shortcuts-environments' do
%span %span
Environments Environments
- if can?(current_user, :read_cycle_analytics, @project) - if @project.feature_available?(:builds, current_user) && !@project.empty_repo?
= nav_link(controller: %w(cycle_analytics)) do = nav_link(path: 'pipelines#charts') do
= link_to project_cycle_analytics_path(@project), title: 'Cycle Analytics' do = link_to charts_namespace_project_pipelines_path(@project.namespace, @project), title: 'Charts', class: 'shortcuts-pipelines-charts' do
%span %span
Cycle Analytics Charts
- @no_container = true - @no_container = true
- page_title "Continuous Integration", "Graphs" - page_title "Charts", "Pipelines"
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('lib_chart')
= page_specific_javascript_bundle_tag('graphs')
= render 'head' = render 'head'
%div{ class: container_class } %div{ class: container_class }
...@@ -10,9 +13,9 @@ ...@@ -10,9 +13,9 @@
#charts.ci-charts #charts.ci-charts
.row .row
.col-md-6 .col-md-6
= render 'projects/graphs/ci/overall' = render 'projects/pipelines/charts/overall'
.col-md-6 .col-md-6
= render 'projects/graphs/ci/build_times' = render 'projects/pipelines/charts/build_times'
%hr %hr
= render 'projects/graphs/ci/builds' = render 'projects/pipelines/charts/builds'
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
= render 'shared/no_ssh' = render 'shared/no_ssh'
= render 'shared/no_password' = render 'shared/no_password'
= render 'projects/last_push' = render "projects/head"
= render "projects/last_push"
= render "home_panel" = render "home_panel"
- if current_user && can?(current_user, :download_code, @project) - if current_user && can?(current_user, :download_code, @project)
......
---
title: Clean-up Project navigation order
merge_request: 9272
author:
...@@ -58,6 +58,7 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -58,6 +58,7 @@ constraints(ProjectUrlConstrainer.new) do
resources :graphs, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } do resources :graphs, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } do
member do member do
get :charts
get :commits get :commits
get :ci get :ci
get :languages get :languages
...@@ -140,6 +141,7 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -140,6 +141,7 @@ constraints(ProjectUrlConstrainer.new) do
resources :pipelines, only: [:index, :new, :create, :show] do resources :pipelines, only: [:index, :new, :create, :show] do
collection do collection do
resource :pipelines_settings, path: 'settings', only: [:show, :update] resource :pipelines_settings, path: 'settings', only: [:show, :update]
get :charts
end end
member do member do
......
...@@ -42,12 +42,10 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?' ...@@ -42,12 +42,10 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?'
| Keyboard Shortcut | Description | | Keyboard Shortcut | Description |
| ----------------- | ----------- | | ----------------- | ----------- |
| <kbd>g</kbd> + <kbd>p</kbd> | Go to the project's home page | | <kbd>g</kbd> + <kbd>p</kbd> | Go to the project's home page |
| <kbd>g</kbd> + <kbd>e</kbd> | Go to the project's activity feed |
| <kbd>g</kbd> + <kbd>f</kbd> | Go to files | | <kbd>g</kbd> + <kbd>f</kbd> | Go to files |
| <kbd>g</kbd> + <kbd>c</kbd> | Go to commits | | <kbd>g</kbd> + <kbd>c</kbd> | Go to commits |
| <kbd>g</kbd> + <kbd>b</kbd> | Go to jobs | | <kbd>g</kbd> + <kbd>b</kbd> | Go to jobs |
| <kbd>g</kbd> + <kbd>n</kbd> | Go to network graph | | <kbd>g</kbd> + <kbd>n</kbd> | Go to network graph |
| <kbd>g</kbd> + <kbd>g</kbd> | Go to graphs |
| <kbd>g</kbd> + <kbd>i</kbd> | Go to issues | | <kbd>g</kbd> + <kbd>i</kbd> | Go to issues |
| <kbd>g</kbd> + <kbd>m</kbd> | Go to merge requests | | <kbd>g</kbd> + <kbd>m</kbd> | Go to merge requests |
| <kbd>g</kbd> + <kbd>s</kbd> | Go to snippets | | <kbd>g</kbd> + <kbd>s</kbd> | Go to snippets |
......
...@@ -80,9 +80,9 @@ Feature: Project Active Tab ...@@ -80,9 +80,9 @@ Feature: Project Active Tab
And no other sub tabs should be active And no other sub tabs should be active
And the active main tab should be Repository And the active main tab should be Repository
Scenario: On Project Repository/Network Scenario: On Project Repository/Graph
Given I visit my project's network page Given I visit my project's graph page
Then the active sub tab should be Network Then the active sub tab should be Graph
And no other sub tabs should be active And no other sub tabs should be active
And the active main tab should be Repository And the active main tab should be Repository
......
...@@ -9,9 +9,10 @@ Feature: Project Graph ...@@ -9,9 +9,10 @@ Feature: Project Graph
Then page should have graphs Then page should have graphs
@javascript @javascript
Scenario: I should see project commits graphs Scenario: I should see project languages & commits graphs on commits graph url
When I visit project "Shop" commits graph page When I visit project "Shop" commits graph page
Then page should have commits graphs Then page should have commits graphs
Then page should have languages graphs
@javascript @javascript
Scenario: I should see project ci graphs Scenario: I should see project ci graphs
...@@ -20,6 +21,13 @@ Feature: Project Graph ...@@ -20,6 +21,13 @@ Feature: Project Graph
Then page should have CI graphs Then page should have CI graphs
@javascript @javascript
Scenario: I should see project languages graphs Scenario: I should see project languages & commits graphs on language graph url
When I visit project "Shop" languages graph page When I visit project "Shop" languages graph page
Then page should have languages graphs Then page should have languages graphs
Then page should have commits graphs
@javascript
Scenario: I should see project languages & commits graphs on charts url
When I visit project "Shop" chart page
Then page should have languages graphs
Then page should have commits graphs
...@@ -19,16 +19,11 @@ Feature: Project Shortcuts ...@@ -19,16 +19,11 @@ Feature: Project Shortcuts
Then the active sub tab should be Commits Then the active sub tab should be Commits
@javascript @javascript
Scenario: Navigate to network tab Scenario: Navigate to graph tab
Given I press "g" and "n" Given I press "g" and "n"
Then the active sub tab should be Network Then the active sub tab should be Graph
And the active main tab should be Repository And the active main tab should be Repository
@javascript
Scenario: Navigate to graphs tab
Given I press "g" and "g"
Then the active main tab should be Graphs
@javascript @javascript
Scenario: Navigate to issues tab Scenario: Navigate to issues tab
Given I press "g" and "i" Given I press "g" and "i"
...@@ -53,8 +48,3 @@ Feature: Project Shortcuts ...@@ -53,8 +48,3 @@ Feature: Project Shortcuts
Scenario: Navigate to project home Scenario: Navigate to project home
Given I press "g" and "p" Given I press "g" and "p"
Then the active main tab should be Home Then the active main tab should be Home
@javascript
Scenario: Navigate to project feed
Given I press "g" and "e"
Then the active main tab should be Activity
...@@ -18,6 +18,10 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps ...@@ -18,6 +18,10 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
visit languages_namespace_project_graph_path(project.namespace, project, "master") visit languages_namespace_project_graph_path(project.namespace, project, "master")
end end
step 'I visit project "Shop" chart page' do
visit charts_namespace_project_graph_path(project.namespace, project, "master")
end
step 'page should have languages graphs' do step 'page should have languages graphs' do
expect(page).to have_content /Ruby 66.* %/ expect(page).to have_content /Ruby 66.* %/
expect(page).to have_content /JavaScript 22.* %/ expect(page).to have_content /JavaScript 22.* %/
......
...@@ -66,7 +66,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps ...@@ -66,7 +66,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
end end
step 'page should have "v1.0.0" in title' do step 'page should have "v1.0.0" in title' do
expect(page).to have_css 'title', text: 'Network · v1.0.0', visible: false expect(page).to have_css 'title', text: 'Graph · v1.0.0', visible: false
end end
step 'page should only have content from "v1.0.0"' do step 'page should only have content from "v1.0.0"' do
......
...@@ -34,9 +34,4 @@ class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps ...@@ -34,9 +34,4 @@ class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps
find('body').native.send_key('g') find('body').native.send_key('g')
find('body').native.send_key('w') find('body').native.send_key('w')
end end
step 'I press "g" and "e"' do
find('body').native.send_key('g')
find('body').native.send_key('e')
end
end end
...@@ -232,7 +232,7 @@ module SharedPaths ...@@ -232,7 +232,7 @@ module SharedPaths
visit stats_namespace_project_repository_path(@project.namespace, @project) visit stats_namespace_project_repository_path(@project.namespace, @project)
end end
step "I visit my project's network page" do step "I visit my project's graph page" do
# Stub Graph max_size to speed up test (10 commits vs. 650) # Stub Graph max_size to speed up test (10 commits vs. 650)
Network::Graph.stub(max_count: 10) Network::Graph.stub(max_count: 10)
......
...@@ -12,10 +12,6 @@ module SharedProjectTab ...@@ -12,10 +12,6 @@ module SharedProjectTab
ensure_active_main_tab('Repository') ensure_active_main_tab('Repository')
end end
step 'the active main tab should be Graphs' do
ensure_active_main_tab('Graphs')
end
step 'the active main tab should be Issues' do step 'the active main tab should be Issues' do
ensure_active_main_tab('Issues') ensure_active_main_tab('Issues')
end end
...@@ -40,12 +36,8 @@ module SharedProjectTab ...@@ -40,12 +36,8 @@ module SharedProjectTab
expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 0) expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 0)
end end
step 'the active main tab should be Activity' do step 'the active sub tab should be Graph' do
ensure_active_main_tab('Activity') ensure_active_sub_tab('Graph')
end
step 'the active sub tab should be Network' do
ensure_active_sub_tab('Network')
end end
step 'the active sub tab should be Files' do step 'the active sub tab should be Files' do
......
...@@ -9,7 +9,23 @@ describe Projects::GraphsController do ...@@ -9,7 +9,23 @@ describe Projects::GraphsController do
project.team << [user, :master] project.team << [user, :master]
end end
describe 'GET #languages' do describe 'GET languages' do
it "redirects_to action charts" do
get(:commits, namespace_id: project.namespace.path, project_id: project.path, id: 'master')
expect(response).to redirect_to action: :charts
end
end
describe 'GET commits' do
it "redirects_to action charts" do
get(:commits, namespace_id: project.namespace.path, project_id: project.path, id: 'master')
expect(response).to redirect_to action: :charts
end
end
describe 'GET charts' do
let(:linguist_repository) do let(:linguist_repository) do
double(languages: { double(languages: {
'Ruby' => 1000, 'Ruby' => 1000,
...@@ -34,7 +50,7 @@ describe Projects::GraphsController do ...@@ -34,7 +50,7 @@ describe Projects::GraphsController do
end end
it 'sets the correct colour according to language' do it 'sets the correct colour according to language' do
get(:languages, namespace_id: project.namespace, project_id: project, id: 'master') get(:charts, namespace_id: project.namespace, project_id: project, id: 'master')
expected_values.each do |val| expected_values.each do |val|
expect(assigns(:languages)).to include(a_hash_including(val)) expect(assigns(:languages)).to include(a_hash_including(val))
......
...@@ -15,13 +15,11 @@ describe "Guest navigation menu" do ...@@ -15,13 +15,11 @@ describe "Guest navigation menu" do
within(".nav-links") do within(".nav-links") do
expect(page).to have_content 'Project' expect(page).to have_content 'Project'
expect(page).to have_content 'Activity'
expect(page).to have_content 'Issues' expect(page).to have_content 'Issues'
expect(page).to have_content 'Wiki' expect(page).to have_content 'Wiki'
expect(page).not_to have_content 'Repository' expect(page).not_to have_content 'Repository'
expect(page).not_to have_content 'Pipelines' expect(page).not_to have_content 'Pipelines'
expect(page).not_to have_content 'Graphs'
expect(page).not_to have_content 'Merge Requests' expect(page).not_to have_content 'Merge Requests'
end end
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