diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/issues.rb | 22 | ||||
-rw-r--r-- | config/routes/project.rb | 26 |
2 files changed, 30 insertions, 18 deletions
diff --git a/config/routes/issues.rb b/config/routes/issues.rb new file mode 100644 index 00000000000..9ac69975690 --- /dev/null +++ b/config/routes/issues.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +get :issues, to: 'issues#calendar', constraints: lambda { |req| req.format == :ics } + +resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do + member do + post :toggle_subscription + post :mark_as_spam + post :move + put :reorder + get :related_branches + get :can_create_branch + get :realtime_changes + post :create_merge_request + get :discussions, format: :json + end + + collection do + post :bulk_update + post :import_csv + end +end diff --git a/config/routes/project.rb b/config/routes/project.rb index e1950724386..68568db1326 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -401,25 +401,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - get :issues, to: 'issues#calendar', constraints: lambda { |req| req.format == :ics } - - resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do - member do - post :toggle_subscription - post :mark_as_spam - post :move - put :reorder - get :related_branches - get :can_create_branch - get :realtime_changes - post :create_merge_request - get :discussions, format: :json - end + # Unscoped route. It will be replaced with redirect to /-/issues/ + # Issue https://gitlab.com/gitlab-org/gitlab/issues/118849 + draw :issues - collection do - post :bulk_update - post :import_csv - end + # To ensure an old unscoped routing is used for the UI we need to + # add prefix 'as' to the scope routing and place it below original routing. + # Issue https://gitlab.com/gitlab-org/gitlab/issues/118849 + scope '-', as: 'scoped' do + draw :issues end resources :notes, only: [:create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do |