diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-27 12:29:51 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-07 21:52:09 +0300 |
commit | 58d1d6a5c7e0a45c9aa8a9d4d1be24dbdce5a08a (patch) | |
tree | 4f78e39630276f4dc734964f44dc1d7869282955 /config | |
parent | 5dde0536c323d14fef2327a8d553b5f8a8a7b2d0 (diff) |
Free up some group reserved words
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/group.rb | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/config/routes/group.rb b/config/routes/group.rb index 11124eaec51..db99e10bb9a 100644 --- a/config/routes/group.rb +++ b/config/routes/group.rb @@ -8,45 +8,46 @@ constraints(GroupUrlConstrainer.new) do scope(path: 'groups/*id', controller: :groups, constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do - get :edit, as: :edit_group - get :issues, as: :issues_group - get :merge_requests, as: :merge_requests_group - get :projects, as: :projects_group - get :activity, as: :activity_group + scope(path: '-') do + get :edit, as: :edit_group + get :issues, as: :issues_group + get :merge_requests, as: :merge_requests_group + get :projects, as: :projects_group + get :activity, as: :activity_group + end + get '/', action: :show, as: :group_canonical end - scope(path: 'groups/*group_id', + scope(path: 'groups/*group_id/-', module: :groups, as: :group, constraints: { group_id: Gitlab::PathRegex.full_namespace_route_regex }) do - scope path: '-' do - namespace :settings do - resource :ci_cd, only: [:show], controller: 'ci_cd' - end + namespace :settings do + resource :ci_cd, only: [:show], controller: 'ci_cd' + end - resources :variables, only: [:index, :show, :update, :create, :destroy] + resources :variables, only: [:index, :show, :update, :create, :destroy] - resources :children, only: [:index] + resources :children, only: [:index] - resources :labels, except: [:show] do - post :toggle_subscription, on: :member - end + resources :labels, except: [:show] do + post :toggle_subscription, on: :member + end - resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :edit, :update, :new, :create] do - member do - get :merge_requests - get :participants - get :labels - end + resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :edit, :update, :new, :create] do + member do + get :merge_requests + get :participants + get :labels end + end - resource :avatar, only: [:destroy] + resource :avatar, only: [:destroy] - resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do - post :resend_invite, on: :member - delete :leave, on: :collection - end + resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do + post :resend_invite, on: :member + delete :leave, on: :collection end end @@ -63,6 +64,8 @@ constraints(GroupUrlConstrainer.new) do # Legacy paths should be defined last, so they would be ignored if routes with # one of the previously reserved words exist. scope(path: 'groups/*group_id') do - Gitlab::Routing.redirect_legacy_paths(self, :labels, :milestones, :group_members) + Gitlab::Routing.redirect_legacy_paths(self, :labels, :milestones, :group_members, + :edit, :issues, :merge_requests, :projects, + :activity) end end |