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
Remove access keys in application
Oliver Günther322fa6f77f43
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rbindex 6e20902cf1c..501e28fba09 100644--- a/app/controllers/help_controller.rb+++ b/app/controllers/help_controller.rb@@ -28,9 +28,9 @@#++class HelpController < ApplicationController- layout 'help'-- def keyboard_shortcuts; end+ def keyboard_shortcuts+ redirect_to OpenProject::Static::Links[:shortcuts][:href]+ enddef text_formattingdefault_link = OpenProject::Static::Links[:text_formatting][:href]diff --git a/app/views/help/_keyboard_shortcut_table.erb b/app/views/help/_keyboard_shortcut_table.erbdeleted file mode 100644index 0ef40ca9d2e..00000000000--- a/app/views/help/_keyboard_shortcut_table.erb+++ /dev/null@@ -1,47 +0,0 @@-<%#-- copyright-OpenProject is an open source project management software.-Copyright (C) 2012-2020 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.--++#%>--<table>- <tr>- <th><%= l(:label_keyboard_function) %></th>- <th><%= l(:label_keyboard_shortcut) %></th>- <th><%= l(:label_keyboard_accesskey) %></th>- </tr>- <% shortcuts.each do |shortcut| %>- <tr>- <td><%= shortcut[:name] %></td>- <td>- <% shortcut[:shortcut].split(' ').each do |key| %>- <kbd><%= key %></kbd>- <% end %>- </td>- <td><%= shortcut[:accesskey] ? accesskey(shortcut[:accesskey]) : empty_element_tag %></td>- </tr>- <% end %>-</table>diff --git a/app/views/help/keyboard_shortcuts.erb b/app/views/help/keyboard_shortcuts.erbdeleted file mode 100644index 99a265c0117..00000000000--- a/app/views/help/keyboard_shortcuts.erb+++ /dev/null@@ -1,107 +0,0 @@-<%#-- copyright-OpenProject is an open source project management software.-Copyright (C) 2012-2020 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 :styles do %>- body {- line-height: 2em;- font-family: sans-serif;- font-size: 1em;- }- h1 { font-size: 1.5em; }- h2 { font-size: 1.2em; }- kbd {- background-color: #F2F2F2;- border: 1px solid #CCCCCC;- border-radius: 3px 3px 3px 3px;- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.42), 0 0 0 2px #FFFFFF inset;- color: #444444;- display: inline-block;- font-family: Arial,Helvetica,sans-serif;- font-size: 13px;- line-height: 1.5;- margin: 0 0.5em 0 0.1em;- padding: 0.15em 0.7em;- text-shadow: 0 1px 0 #FFFFFF;- white-space: nowrap;- }- table th {- background-color: #dbdbdb;- padding-left: 20px;- padding-right: 20px;- }- table td {- vertical-align: top;- background-color: #f5f5f5;- height: 2em;- vertical-align: middle;- padding-left: 20px;- padding-right: 20px;- }-- /* Accessibility specific styles */- .hidden-for-sighted {- position: absolute;- left: -10000px;- top: auto;- width: 1px;- height: 1px;- overflow: hidden;- }-<% end %>--<h1><%= l(:label_keyboard_shortcut_help_heading) %></h1>-<hr />-<h2><%= l(:label_keyboard_shortcut_global_shortcuts) %></h2>-<% global_shortcuts = [ { name: l(:label_keyboard_shortcut_show_help), shortcut: '?' },- { name: l(:label_keyboard_shortcut_search_global), shortcut: 's', accesskey: :quick_search },- { name: l(:label_keyboard_shortcut_search_project), shortcut: 'p', accesskey: :project_search },- { name: l(:label_keyboard_shortcut_go_my_page), shortcut: 'g m' } ] %>--<%= render partial: 'help/keyboard_shortcut_table', locals: { shortcuts: global_shortcuts } %>--<h2><%= l(:label_keyboard_shortcut_within_project) %></h2>-<% project_shortcuts = [ { name: l(:label_keyboard_shortcut_go_overview), shortcut: 'g o' },- { name: l(:label_keyboard_shortcut_go_work_package), shortcut: 'g w p' },- { name: l(:label_keyboard_shortcut_go_wiki), shortcut: 'g w i' },- { name: l(:label_keyboard_shortcut_go_activity), shortcut: 'g a' },- { name: l(:label_keyboard_shortcut_go_calendar), shortcut: 'g c' },- { name: l(:label_keyboard_shortcut_go_news), shortcut: 'g n' },- { name: l(:label_keyboard_shortcut_go_timelines), shortcut: 'g t' },- { name: l(:label_keyboard_shortcut_new_work_package), shortcut: 'n w p', accesskey: :new_work_package },- { name: l(:label_keyboard_shortcut_details_package), shortcut: 'd w p', accesskey: :details } ] %>--<%= render partial: 'help/keyboard_shortcut_table', locals: { shortcuts: project_shortcuts } %>--<h2><%= l(:label_keyboard_shortcut_some_pages_only) %></h2>-<% special_shortcuts = [ { name: l(:label_keyboard_shortcut_go_edit), shortcut: 'g e', accesskey: :edit },- { name: l(:label_keyboard_shortcut_open_more_menu), shortcut: 'm', accesskey: :more_menu },- { name: l(:label_keyboard_shortcut_go_preview), shortcut: 'g p', accesskey: :preview },- { name: l(:label_keyboard_shortcut_focus_next_item), shortcut: 'j' },- { name: l(:label_keyboard_shortcut_focus_previous_item), shortcut: 'k' } ] %>-<%= render partial: 'help/keyboard_shortcut_table', locals: { shortcuts: special_shortcuts } %>diff --git a/app/views/layouts/help.html.erb b/app/views/layouts/help.html.erbdeleted file mode 100644index 30671082920..00000000000--- a/app/views/layouts/help.html.erb+++ /dev/null@@ -1,41 +0,0 @@-<%#-- copyright-OpenProject is an open source project management software.-Copyright (C) 2012-2020 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-2017 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.--++#%>-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">- <head>- <%= output_title_and_meta_tags %>- <meta http-equiv="content-type" content="text/html; charset=utf-8" />- <%= nonced_style_tag do %>- <%= yield(:styles) %>- <% end %>- </head>- <body>- <%= yield %>- </body>-</html>diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 84ec8ffd5c5..dc3c80189ee 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1753,31 +1753,6 @@ en:zero: "no projects"label_year: "Year"label_yesterday: "yesterday"- label_keyboard_function: "Function"- label_keyboard_shortcut: "Shortcut"- label_keyboard_accesskey: "Accesskey"- label_keyboard_shortcut_help_heading: "Available Keyboard Shortcuts"- label_keyboard_shortcut_within_project: "Project related shortcuts:"- label_keyboard_shortcut_global_shortcuts: "Global shortcuts:"- label_keyboard_shortcut_some_pages_only: "Special shortcuts:"- label_keyboard_shortcut_search_global: "Global search"- label_keyboard_shortcut_search_project: "Find a project"- label_keyboard_shortcut_go_my_page: "Go to my page"- label_keyboard_shortcut_show_help: "Show this help message"- label_keyboard_shortcut_go_overview: "Go to project overview"- label_keyboard_shortcut_go_work_package: "Go to project work packages"- label_keyboard_shortcut_go_wiki: "Go to project wiki"- label_keyboard_shortcut_go_activity: "Go to project activities"- label_keyboard_shortcut_go_calendar: "Go to project calendar"- label_keyboard_shortcut_go_news: "Go to project news"- label_keyboard_shortcut_go_timelines: "Go to timelines"- label_keyboard_shortcut_new_work_package: "Create new work package"- label_keyboard_shortcut_details_package: "Show work packages details pane"- label_keyboard_shortcut_go_edit: "Go to edit the current item (on detail pages only)"- label_keyboard_shortcut_open_more_menu: "Open more-menu (on detail pages only)"- label_keyboard_shortcut_go_preview: "Go to preview the current edit (on edit pages only)"- label_keyboard_shortcut_focus_previous_item: "Focus previous list element (on some lists only)"- label_keyboard_shortcut_focus_next_item: "Focus next list element (on some lists only)"auth_source:using_abstract_auth_source: "Can't use an abstract authentication source."diff --git a/frontend/src/app/modules/a11y/keyboard-shortcut-service.ts b/frontend/src/app/modules/a11y/keyboard-shortcut-service.tsindex 71a2ef70d86..62eb0789d7e 100644--- a/frontend/src/app/modules/a11y/keyboard-shortcut-service.ts+++ b/frontend/src/app/modules/a11y/keyboard-shortcut-service.ts@@ -87,12 +87,6 @@ export class KeyboardShortcutService {*/public register() {_.each(this.shortcuts, (action:() => void, key:string) => Mousetrap.bind(key, action));-- // Register help link clicks- jQuery('.help-link-shortcuts-link').click(() => {- this.showHelpModal();- return false;- });}public accessKey(keyName:'preview'|'newWorkPackage'|'edit'|'quickSearch'|'projectSearch'|'help'|'moreMenu'|'details') {@@ -102,7 +96,7 @@ export class KeyboardShortcutService {if (elem.is('input') || elem.attr('id') === 'global-search-input') {// timeout with delay so that the key is not// triggered on the input- setTimeout( () => this.FocusHelper.focus(elem), 200);+ setTimeout(() => this.FocusHelper.focus(elem), 200);} else if (elem.is('[href]')) {this.clickLink(elem[0]);} else {@@ -138,8 +132,7 @@ export class KeyboardShortcutService {cancelable: true});cancelled = !link.dispatchEvent(event);- }- else if (link.fireEvent) {+ } else if (link.fireEvent) {cancelled = !link.fireEvent('onclick');}@@ -155,7 +148,7 @@ export class KeyboardShortcutService {findListInPage() {const domLists = jQuery(accessibleListSelector);const focusElements:any = [];- domLists.find('tbody tr').each(function(index, tr) {+ domLists.find('tbody tr').each(function (index, tr) {var firstLink = jQuery(tr).find(':visible:tabbable')[0];if (firstLink !== undefined) {focusElements.push(firstLink);diff --git a/lib/redmine/menu_manager/top_menu/help_menu.rb b/lib/redmine/menu_manager/top_menu/help_menu.rbindex 2ba6de66c1b..5a04fe33115 100644--- a/lib/redmine/menu_manager/top_menu/help_menu.rb+++ b/lib/redmine/menu_manager/top_menu/help_menu.rb@@ -97,12 +97,7 @@ module Redmine::MenuManager::TopMenu::HelpMenutitle: l('label_videos'),target: '_blank'}- result << content_tag(:li) {- link_to l('homescreen.links.shortcuts'),- '',- class: 'help-link-shortcuts-link',- title: l('homescreen.links.shortcuts')- }+ result << static_link_item(:shortcuts)result << static_link_item(:forums)result << static_link_item(:professional_support)result << content_tag(:hr, '', class: 'form--separator')diff --git a/spec/features/accessibility/work_packages/work_package_query_spec.rb b/spec/features/accessibility/work_packages/work_package_query_spec.rbindex 38ab969b3da..dd93fc5d34f 100644--- a/spec/features/accessibility/work_packages/work_package_query_spec.rb+++ b/spec/features/accessibility/work_packages/work_package_query_spec.rb@@ -193,7 +193,7 @@ describe 'Work package index accessibility', type: :feature, selenium: true donew_window = window_opened_by { find('body').native.send_keys('?') }within_window new_window do- expect(page).to have_selector('h1', text: 'Available Keyboard Shortcuts')+ expect(page.current_url).to include 'https://docs.openproject.org/'endnew_window.close