summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-11 09:54:01 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-11 09:54:01 +0300
commit038d40f0f5b202fe9ed133fdf9de1774bdbc8ede (patch)
treea8ce15d3aac9307f76b116c73f5c8c4caa30ce7f
parent9e2c8d94766617358d39b81fe42f360e6dc469f8 (diff)
downloadgitlab-ce-038d40f0f5b202fe9ed133fdf9de1774bdbc8ede.tar.gz
Solve inconsistency between network graph & stat graphs
-rw-r--r--app/controllers/graphs_controller.rb (renamed from app/controllers/stat_graph_controller.rb)2
-rw-r--r--app/controllers/network_controller.rb (renamed from app/controllers/graph_controller.rb)2
-rw-r--r--app/controllers/refs_controller.rb2
-rw-r--r--app/views/graphs/show.html.haml (renamed from app/views/stat_graph/show.html.haml)0
-rw-r--r--app/views/graphs/show.js.haml (renamed from app/views/stat_graph/show.js.haml)0
-rw-r--r--app/views/layouts/nav/_project.html.haml8
-rw-r--r--app/views/network/_head.html.haml (renamed from app/views/graph/_head.html.haml)4
-rw-r--r--app/views/network/show.html.haml (renamed from app/views/graph/show.html.haml)2
-rw-r--r--app/views/network/show.json.erb (renamed from app/views/graph/show.json.erb)0
-rw-r--r--config/routes.rb4
-rw-r--r--features/steps/project/project_graph.rb2
-rw-r--r--features/steps/project/project_network_graph.rb2
-rw-r--r--features/steps/shared/paths.rb2
-rw-r--r--spec/routing/project_routing_spec.rb12
14 files changed, 24 insertions, 18 deletions
diff --git a/app/controllers/stat_graph_controller.rb b/app/controllers/graphs_controller.rb
index f076f4726d0..5ae9c15c0f7 100644
--- a/app/controllers/stat_graph_controller.rb
+++ b/app/controllers/graphs_controller.rb
@@ -1,4 +1,4 @@
-class StatGraphController < ProjectResourceController
+class GraphsController < ProjectResourceController
# Authorize
before_filter :authorize_read_project!
before_filter :authorize_code_access!
diff --git a/app/controllers/graph_controller.rb b/app/controllers/network_controller.rb
index c79ed5ca3cc..3c8e747ba4e 100644
--- a/app/controllers/graph_controller.rb
+++ b/app/controllers/network_controller.rb
@@ -1,4 +1,4 @@
-class GraphController < ProjectResourceController
+class NetworkController < ProjectResourceController
include ExtractsPath
include ApplicationHelper
diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb
index e7def3984f8..cae9193a1da 100644
--- a/app/controllers/refs_controller.rb
+++ b/app/controllers/refs_controller.rb
@@ -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
diff --git a/app/views/stat_graph/show.html.haml b/app/views/graphs/show.html.haml
index 05bc1436e6d..05bc1436e6d 100644
--- a/app/views/stat_graph/show.html.haml
+++ b/app/views/graphs/show.html.haml
diff --git a/app/views/stat_graph/show.js.haml b/app/views/graphs/show.js.haml
index b7c9b4113e9..b7c9b4113e9 100644
--- a/app/views/stat_graph/show.js.haml
+++ b/app/views/graphs/show.js.haml
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
index 399bcf5de2e..1c5781daab0 100644
--- a/app/views/layouts/nav/_project.html.haml
+++ b/app/views/layouts/nav/_project.html.haml
@@ -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
diff --git a/app/views/graph/_head.html.haml b/app/views/network/_head.html.haml
index 7a5b3c6f43d..62ab8b049ac 100644
--- a/app/views/graph/_head.html.haml
+++ b/app/views/network/_head.html.haml
@@ -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
diff --git a/app/views/graph/show.html.haml b/app/views/network/show.html.haml
index 0ee6648317c..a480ceaf995 100644
--- a/app/views/graph/show.html.haml
+++ b/app/views/network/show.html.haml
@@ -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}'
diff --git a/app/views/graph/show.json.erb b/app/views/network/show.json.erb
index 9a62cdb3dc9..9a62cdb3dc9 100644
--- a/app/views/graph/show.json.erb
+++ b/app/views/network/show.json.erb
diff --git a/config/routes.rb b/config/routes.rb
index c555cd0b361..a50f78c616b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -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
diff --git a/features/steps/project/project_graph.rb b/features/steps/project/project_graph.rb
index 489485b1dc4..50942b3cbb3 100644
--- a/features/steps/project/project_graph.rb
+++ b/features/steps/project/project_graph.rb
@@ -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
diff --git a/features/steps/project/project_network_graph.rb b/features/steps/project/project_network_graph.rb
index 48a73f09fac..f001c0beb9a 100644
--- a/features/steps/project/project_network_graph.rb
+++ b/features/steps/project/project_network_graph.rb
@@ -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
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index 3641e788662..21b6159bce3 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -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
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index 94f9480a4d0..a1d4bd6a4cd 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -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