Commit 038d40f0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Solve inconsistency between network graph & stat graphs

parent 9e2c8d94
class StatGraphController < ProjectResourceController
class GraphsController < ProjectResourceController
# Authorize
before_filter :authorize_read_project!
before_filter :authorize_code_access!
......
class GraphController < ProjectResourceController
class NetworkController < ProjectResourceController
include ExtractsPath
include ApplicationHelper
......
......@@ -14,7 +14,7 @@ class RefsController < ProjectResourceController
elsif params[:destination] == "blob"
project_blob_path(@project, (@id))
elsif params[:destination] == "graph"
project_graph_path(@project, @id, @options)
project_network_path(@project, @id, @options)
else
project_commits_path(@project, @id)
end
......
......@@ -9,10 +9,10 @@
= link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(commit commits compare repositories protected_branches)) do
= link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(graph)) do
= link_to "Network", project_graph_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(stat_graph)) do
= link_to "Graphs", project_stat_graph_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(network)) do
= link_to "Network", project_network_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(graphs)) do
= link_to "Graphs", project_graph_path(@project, @ref || @repository.root_ref)
- if @project.issues_enabled
= nav_link(controller: %w(issues milestones labels)) do
......
......@@ -5,7 +5,7 @@
.pull-left
= render partial: 'shared/ref_switcher', locals: {destination: 'graph'}
.pull-left
= form_tag project_graph_path(@project, @id), method: :get do |f|
= form_tag project_network_path(@project, @id), method: :get do |f|
.control-group
= label_tag :filter_ref, "Show only selected ref", class: 'control-label light'
.controls
......@@ -14,7 +14,7 @@
= hidden_field_tag(key, value, id: nil) unless key == "filter_ref"
.search.pull-right
= form_tag project_graph_path(@project, @id), method: :get do |f|
= form_tag project_network_path(@project, @id), method: :get do |f|
.control-group
= label_tag :search , "Looking for commit:", class: 'control-label light'
.controls
......
......@@ -11,7 +11,7 @@
$(this).closest('form').submit();
});
branch_graph = new BranchGraph($("#holder"), {
url: '#{project_graph_path(@project, @ref, @options.merge(format: :json))}',
url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}',
commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}',
ref: '#{@ref}',
commit_id: '#{@commit.id}'
......
......@@ -190,8 +190,8 @@ Gitlab::Application.routes.draw do
resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/}
resources :graph, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
resources :stat_graph, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
resources :network, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
scope module: :projects do
......
......@@ -8,6 +8,6 @@ class ProjectGraph < Spinach::FeatureSteps
When 'I visit project "Shop" graph page' do
project = Project.find_by_name("Shop")
visit project_stat_graph_path(project, "master")
visit project_graph_path(project, "master")
end
end
......@@ -12,7 +12,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
Network::Graph.stub(max_count: 10)
project = Project.find_by_name("Shop")
visit project_graph_path(project, "master")
visit project_network_path(project, "master")
end
And 'page should select "master" in select box' do
......
......@@ -149,7 +149,7 @@ module SharedPaths
# Stub Graph max_size to speed up test (10 commits vs. 650)
Network::Graph.stub(max_count: 10)
visit project_graph_path(@project, root_ref)
visit project_network_path(@project, root_ref)
end
step "I visit my project's issues page" do
......
......@@ -446,9 +446,15 @@ describe CompareController, "routing" do
end
end
describe GraphController, "routing" do
describe NetworkController, "routing" do
it "to #show" do
get("/gitlabhq/graph/master").should route_to('graph#show', project_id: 'gitlabhq', id: 'master')
get("/gitlabhq/graph/master.json").should route_to('graph#show', project_id: 'gitlabhq', id: 'master', format: "json")
get("/gitlabhq/network/master").should route_to('network#show', project_id: 'gitlabhq', id: 'master')
get("/gitlabhq/network/master.json").should route_to('network#show', project_id: 'gitlabhq', id: 'master', format: "json")
end
end
describe GraphsController, "routing" do
it "to #show" do
get("/gitlabhq/graphs/master").should route_to('graphs#show', project_id: 'gitlabhq', id: 'master')
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