Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add `boards/new` routing

Aaron Contreras3741da4c208d
diff --git a/modules/boards/app/controllers/boards/boards_controller.rb b/modules/boards/app/controllers/boards/boards_controller.rb
index d2f819043d4..6033614b7e5 100644
--- a/modules/boards/app/controllers/boards/boards_controller.rb
+++ b/modules/boards/app/controllers/boards/boards_controller.rb
@@ -31,6 +31,8 @@ module ::Boards
:boards
end
+ def new; end
+
private
def authorize_work_package_permission
diff --git a/modules/boards/config/routes.rb b/modules/boards/config/routes.rb
index 8a930e909ea..f1636b2cd60 100644
--- a/modules/boards/config/routes.rb
+++ b/modules/boards/config/routes.rb
@@ -1,6 +1,11 @@
OpenProject::Application.routes.draw do
get '/boards/all', to: 'boards/boards#overview'
+ resources :boards,
+ controller: 'boards/boards',
+ only: %i[new],
+ as: :work_package_boards
+
scope '', as: :work_package_boards do
get '/boards(/*state)', to: 'boards/boards#index'
end
diff --git a/modules/boards/spec/routing/boards_routing_spec.rb b/modules/boards/spec/routing/boards_routing_spec.rb
index 9a938ad8c7d..0fec59346db 100644
--- a/modules/boards/spec/routing/boards_routing_spec.rb
+++ b/modules/boards/spec/routing/boards_routing_spec.rb
@@ -29,15 +29,21 @@
require 'spec_helper'
RSpec.describe 'Boards routing' do
- it {
+ it do
expect(subject)
.to route(:get, '/projects/foobar/boards/state')
- .to(controller: 'boards/boards', action: 'index', project_id: 'foobar', state: 'state')
- }
+ .to(controller: 'boards/boards', action: 'index', project_id: 'foobar', state: 'state')
+ end
- it {
+ it do
expect(subject)
.to route(:get, '/boards/state')
- .to(controller: 'boards/boards', action: 'index', state: 'state')
- }
+ .to(controller: 'boards/boards', action: 'index', state: 'state')
+ end
+
+ it do
+ expect(subject)
+ .to route(:get, '/boards/new')
+ .to(controller: 'boards/boards', action: 'new')
+ end
end