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 global boards overview page

Klaus Zandersd15f8bd84338
diff --git a/modules/boards/app/components/boards/row_component.rb b/modules/boards/app/components/boards/row_component.rb
new file mode 100644
index 00000000000..f4e081a0dd2
--- /dev/null
+++ b/modules/boards/app/components/boards/row_component.rb
@@ -0,0 +1,56 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) 2012-2023 the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Boards
+ class RowComponent < ::RowComponent
+ include ApplicationHelper
+
+ def project_id
+ link_to_project model.project, {}, {}, false
+ end
+
+ def name
+ link_to model.name, project_work_package_boards_path(model.project, model)
+ end
+
+ def created_at
+ safe_join([format_date(model.created_at), format_time(model.created_at, false)], " ")
+ end
+
+ def type
+ case model.board_type
+ when :action
+ t('boards.board_types.action', attribute: t(model.board_type_attribute, scope: 'boards.board_type_attributes'))
+ else
+ t('boards.board_types.free')
+ end
+ end
+ end
+end
diff --git a/modules/boards/app/components/boards/table_component.rb b/modules/boards/app/components/boards/table_component.rb
new file mode 100644
index 00000000000..90f202e0893
--- /dev/null
+++ b/modules/boards/app/components/boards/table_component.rb
@@ -0,0 +1,50 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) 2012-2023 the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Boards
+ class TableComponent < ::TableComponent
+ columns :name, :project_id, :type, :created_at
+ sortable_columns :name, :project_id, :created_at
+
+ def initial_sort
+ %i[name asc]
+ end
+
+ def paginated?
+ true
+ end
+
+ def headers
+ columns.map do |attr|
+ [attr, { caption: Boards::Grid.human_attribute_name(attr) }]
+ end
+ end
+ end
+end
diff --git a/modules/boards/app/controllers/boards/boards_controller.rb b/modules/boards/app/controllers/boards/boards_controller.rb
index 7399425a4f7..3193b26430d 100644
--- a/modules/boards/app/controllers/boards/boards_controller.rb
+++ b/modules/boards/app/controllers/boards/boards_controller.rb
@@ -1,11 +1,15 @@
module ::Boards
class BoardsController < BaseController
before_action :find_optional_project
- before_action :authorize
- # The boards permission alone does not suffice
- # to view work packages
- before_action :authorize_work_package_permission
+ with_options only: [:index] do
+ # The boards permission alone does not suffice
+ # to view work packages
+ before_action :authorize
+ before_action :authorize_work_package_permission
+ end
+
+ before_action :authorize_global, only: :overview
menu_item :board_view
@@ -13,6 +17,11 @@ module ::Boards
render layout: 'angular/angular'
end
+ def overview
+ projects = Project.allowed_to(User.current, :view_meetings)
+ @board_grids = Boards::Grid.includes(:project).where(project: projects)
+ end
+
current_menu_item :index do
:board_view
end
diff --git a/modules/boards/app/views/boards/boards/overview.html.erb b/modules/boards/app/views/boards/boards/overview.html.erb
new file mode 100644
index 00000000000..17add482fc4
--- /dev/null
+++ b/modules/boards/app/views/boards/boards/overview.html.erb
@@ -0,0 +1,51 @@
+<%#-- copyright
+OpenProject is an open source project management software.
+Copyright (C) 2012-2023 the OpenProject GmbH
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License version 3.
+
+OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+Copyright (C) 2006-2013 Jean-Philippe Lang
+Copyright (C) 2010-2013 the ChiliProject Team
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+See COPYRIGHT and LICENSE files for more details.
+
+++#%>
+
+<% html_title(t('boards.label_boards')) -%>
+
+<%= toolbar title: t('boards.label_boards') do %>
+ <% if authorize_for(:boards, :new) %>
+ <li class="toolbar-item">
+ <a href="<%= "foo" %>"
+ id="add-board-button"
+ title="<%= I18n.t(:label_meeting_new) %>"
+ arial-label="<%= I18n.t(:label_meeting_new) %>"
+ class="button -alt-highlight">
+ <%= op_icon('button--icon icon-add') %>
+ <span class="button--text"><%= t(:label_meeting) %></span>
+ </a>
+ </li>
+ <% end %>
+<% end %>
+
+<% if @board_grids.empty? -%>
+ <%= no_results_box %>
+<% else -%>
+<%= render Boards::TableComponent.new(rows: @board_grids) %>
+<% end -%>
diff --git a/modules/boards/config/routes.rb b/modules/boards/config/routes.rb
index b0b692797e1..b01874974f3 100644
--- a/modules/boards/config/routes.rb
+++ b/modules/boards/config/routes.rb
@@ -1,4 +1,6 @@
OpenProject::Application.routes.draw do
+ get '/boards', to: 'boards/boards#overview'
+
scope '', as: :work_package_boards do
get '/boards(/*state)', to: 'boards/boards#index'
end
diff --git a/modules/boards/lib/open_project/boards/engine.rb b/modules/boards/lib/open_project/boards/engine.rb
index 4ef6cfc00b3..6de54e0629a 100644
--- a/modules/boards/lib/open_project/boards/engine.rb
+++ b/modules/boards/lib/open_project/boards/engine.rb
@@ -52,6 +52,16 @@ module OpenProject::Boards
partial: 'boards/boards/menu_board',
last: true,
caption: :'boards.label_boards'
+
+ menu :top_menu,
+ :boards, { controller: 'boards/boards', project_id: nil, action: 'overview' },
+ context: :modules,
+ caption: :project_module_board_view,
+ if: Proc.new {
+ OpenProject::FeatureDecisions.more_global_index_pages_active? &&
+ (User.current.logged? || !Setting.login_required?) &&
+ User.current.allowed_to_globally?(:show_board_views)
+ }
end
patch_with_namespace :BasicData, :SettingSeeder