Show a custom sidebar on the notifications page.

(Currently this is just the WP query sidebar as a placeholder. This will be replaced later.)
This commit is contained in:
Henriette Darge
2021-08-11 10:06:17 +02:00
parent 00095af862
commit 2282f0ef2b
12 changed files with 65 additions and 12 deletions
+7 -1
View File
@@ -34,6 +34,12 @@ class AngularController < ApplicationController
def 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'
end
end
+1 -1
View File
@@ -34,6 +34,6 @@ class APIDocsController < ApplicationController
def index
render_404 unless Setting.apiv3_docs_enabled?
render layout: 'angular', inline: ''
render layout: 'angular/angular', inline: ''
end
end
+1 -1
View File
@@ -84,7 +84,7 @@ class MyController < ApplicationController
# Configure user's mail notifications
def notifications
render html: '',
layout: 'angular',
layout: 'angular/angular',
locals: { menu_name: :my_menu }
end
@@ -33,6 +33,6 @@ class WorkPackages::CalendarsController < ApplicationController
before_action :find_optional_project
def index
render layout: 'angular'
render layout: 'angular/angular'
end
end
+6 -3
View File
@@ -46,7 +46,9 @@ class WorkPackagesController < ApplicationController
def show
respond_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'
end
format.any(*WorkPackage::Exporter.single_formats) do
@@ -66,8 +68,9 @@ class WorkPackagesController < ApplicationController
def index
respond_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'
end
format.any(*WorkPackage::Exporter.list_formats) do
@@ -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 }) %>
+6
View File
@@ -115,6 +115,12 @@ Redmine::MenuManager.map :application_menu do |menu|
last: true
end
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' },
+1 -1
View File
@@ -576,7 +576,7 @@ OpenProject::Application.routes.draw do
root to: 'account#login'
scope :notifications do
get '(/*state)', to: 'angular#empty_layout', as: :notifications_center
get '(/*state)', to: 'angular#notifications_layout', as: :notifications_center
end
# Development route for styleguide
@@ -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$;
@@ -10,7 +10,7 @@ module ::Boards
menu_item :board_view
def index
render layout: 'angular'
render layout: 'angular/angular'
end
current_menu_item :index do
@@ -4,7 +4,7 @@ module ::Grids
before_action :authorize
def show
render layout: 'angular'
render layout: 'angular/angular'
end
end
end