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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Show a custom sidebar on the notifications page. (Currently this is just the WP query sidebar as a placeholder. This will be replaced later.)
Henriette Darge2282f0ef2bc8
diff --git a/app/controllers/angular_controller.rb b/app/controllers/angular_controller.rbindex 131a858184f..ab376188bb6 100644--- a/app/controllers/angular_controller.rb+++ b/app/controllers/angular_controller.rb@@ -34,6 +34,12 @@ class AngularController < ApplicationControllerdef empty_layout# Frontend will handle rendering# but we will need to render with layout- render html: '', layout: 'angular'+ render html: '', layout: 'angular/angular'+ end++ def notifications_layout+ # Frontend will handle rendering+ # but we will need to render with notification specific layout+ render html: '', layout: 'angular/notifications'endenddiff --git a/app/controllers/api_docs_controller.rb b/app/controllers/api_docs_controller.rbindex d6767e3c44e..6a68efbe970 100644--- a/app/controllers/api_docs_controller.rb+++ b/app/controllers/api_docs_controller.rb@@ -34,6 +34,6 @@ class APIDocsController < ApplicationControllerdef indexrender_404 unless Setting.apiv3_docs_enabled?- render layout: 'angular', inline: ''+ render layout: 'angular/angular', inline: ''endenddiff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rbindex 8052b5d6902..2c13de152ac 100644--- a/app/controllers/my_controller.rb+++ b/app/controllers/my_controller.rb@@ -84,7 +84,7 @@ class MyController < ApplicationController# Configure user's mail notificationsdef notificationsrender html: '',- layout: 'angular',+ layout: 'angular/angular',locals: { menu_name: :my_menu }enddiff --git a/app/controllers/work_packages/calendars_controller.rb b/app/controllers/work_packages/calendars_controller.rbindex ffcc6b3dde8..f46ae172175 100644--- a/app/controllers/work_packages/calendars_controller.rb+++ b/app/controllers/work_packages/calendars_controller.rb@@ -33,6 +33,6 @@ class WorkPackages::CalendarsController < ApplicationControllerbefore_action :find_optional_projectdef index- render layout: 'angular'+ render layout: 'angular/angular'endenddiff --git a/app/controllers/work_packages_controller.rb b/app/controllers/work_packages_controller.rbindex 936bd4a5f0a..d447d85db8c 100644--- a/app/controllers/work_packages_controller.rb+++ b/app/controllers/work_packages_controller.rb@@ -46,7 +46,9 @@ class WorkPackagesController < ApplicationControllerdef showrespond_to do |format|format.html do- render :show, locals: { work_package: work_package, menu_name: project_or_wp_query_menu }, layout: 'angular'+ render :show,+ locals: { work_package: work_package, menu_name: project_or_wp_query_menu },+ layout: 'angular/angular'endformat.any(*WorkPackage::Exporter.single_formats) do@@ -66,8 +68,9 @@ class WorkPackagesController < ApplicationControllerdef indexrespond_to do |format|format.html do- render :index, locals: { query: @query, project: @project, menu_name: project_or_wp_query_menu },- layout: 'angular'+ render :index,+ locals: { query: @query, project: @project, menu_name: project_or_wp_query_menu },+ layout: 'angular/angular'endformat.any(*WorkPackage::Exporter.list_formats) dodiff --git a/app/views/layouts/angular.html.erb b/app/views/layouts/angular/angular.html.erbsimilarity index 100%rename from app/views/layouts/angular.html.erbrename to app/views/layouts/angular/angular.html.erbdiff --git a/app/views/layouts/angular/notifications.html.erb b/app/views/layouts/angular/notifications.html.erbnew file mode 100644index 00000000000..f6f6a4f2689--- /dev/null+++ b/app/views/layouts/angular/notifications.html.erb@@ -0,0 +1,40 @@+<%#-- copyright+OpenProject is an open source project management software.+Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.++++#%>++<%= content_for :header_tags do %>+ <%= nonced_javascript_tag do %>+ <%= include_gon(need_tag: false) -%>+ <% end %>+<% end -%>++<%= content_for :content_body do %>+ <openproject-base></openproject-base>+<% end -%>++<%= render template: "layouts/base", locals: local_assigns.merge({ menu_name: :notifications_menu }) %>diff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex b5db92a8102..b2cb30af33d 100644--- a/config/initializers/menus.rb+++ b/config/initializers/menus.rb@@ -115,6 +115,12 @@ Redmine::MenuManager.map :application_menu do |menu|last: trueend+Redmine::MenuManager.map :notifications_menu do |menu|+ menu.push :work_packages_query_select,+ { controller: '/work_packages', action: 'index' },+ partial: 'work_packages/menu_query_select'+end+Redmine::MenuManager.map :my_menu do |menu|menu_push = menu.push :account,{ controller: '/my', action: 'account' },diff --git a/config/routes.rb b/config/routes.rbindex 932b06c875d..56ef71138d4 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -576,7 +576,7 @@ OpenProject::Application.routes.draw doroot to: 'account#login'scope :notifications do- get '(/*state)', to: 'angular#empty_layout', as: :notifications_center+ get '(/*state)', to: 'angular#notifications_layout', as: :notifications_centerend# Development route for styleguidediff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.tsindex db1cb1f8f13..7a12cfa829a 100644--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts+++ b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts@@ -30,8 +30,6 @@ export class InAppNotificationCenterComponent implements OnInit {map((items) => Object.values(items)),);- notificationsCount$ = this.ianQuery.selectCount();-hasNotifications$ = this.ianQuery.hasNotifications$;hasMoreThanPageSize$ = this.ianQuery.hasMoreThanPageSize$;diff --git a/modules/boards/app/controllers/boards/boards_controller.rb b/modules/boards/app/controllers/boards/boards_controller.rbindex 1a1947be925..7399425a4f7 100644--- a/modules/boards/app/controllers/boards/boards_controller.rb+++ b/modules/boards/app/controllers/boards/boards_controller.rb@@ -10,7 +10,7 @@ module ::Boardsmenu_item :board_viewdef index- render layout: 'angular'+ render layout: 'angular/angular'endcurrent_menu_item :index dodiff --git a/modules/grids/app/controllers/grids/base_in_project_controller.rb b/modules/grids/app/controllers/grids/base_in_project_controller.rbindex 0a10e6ff760..1458a8b8b55 100644--- a/modules/grids/app/controllers/grids/base_in_project_controller.rb+++ b/modules/grids/app/controllers/grids/base_in_project_controller.rb@@ -4,7 +4,7 @@ module ::Gridsbefore_action :authorizedef show- render layout: 'angular'+ render layout: 'angular/angular'endendend