Commit e1832914 authored by winniehell's avatar winniehell

Allow branch names ending with .json for graph and network page (!5579)

parent 010477ed
...@@ -34,6 +34,7 @@ v 8.11.0 (unreleased) ...@@ -34,6 +34,7 @@ v 8.11.0 (unreleased)
- Gitlab::Metrics.current_transaction needs to be public for RailsQueueDuration - Gitlab::Metrics.current_transaction needs to be public for RailsQueueDuration
- Fix search for notes which belongs to deleted objects - Fix search for notes which belongs to deleted objects
- Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska Ula Budziszewska) - Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska Ula Budziszewska)
- Allow branch names ending with .json for graph and network page !5579 (winniehell)
- Add the `sprockets-es6` gem - Add the `sprockets-es6` gem
- Multiple trigger variables show in separate lines (Katarzyna Kobierska Ula Budziszewska) - Multiple trigger variables show in separate lines (Katarzyna Kobierska Ula Budziszewska)
- Profile requests when a header is passed - Profile requests when a header is passed
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
:javascript :javascript
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "#{namespace_project_graph_path(@project.namespace, @project, current_ref, :json)}", url: "#{namespace_project_graph_path(@project.namespace, @project, current_ref, format: :json)}",
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
var graph = new ContributorsStatGraph(); var graph = new ContributorsStatGraph();
......
...@@ -626,13 +626,17 @@ Rails.application.routes.draw do ...@@ -626,13 +626,17 @@ Rails.application.routes.draw do
get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ } get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ }
resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } # Don't use format parameter as file extension (old 3.0.x behavior)
# See http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments
resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do scope format: false do
member do resources :network, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex }
get :commits
get :ci resources :graphs, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } do
get :languages member do
get :commits
get :ci
get :languages
end
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