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

Introduce a new setting to disable the keyboard shortcuts

Henriette Darge2dbeb00282e9
diff --git a/app/components/projects/settings/general/show_component.html.erb b/app/components/projects/settings/general/show_component.html.erb
index d09dbf5fa04..ce1c1000995 100644
--- a/app/components/projects/settings/general/show_component.html.erb
+++ b/app/components/projects/settings/general/show_component.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
concat(
render(Primer::Beta::Subhead.new) do |component|
- component.with_heading(tag: :h2, size: :medium) { I18n.t("projects.settings.header_details") }
+ component.with_heading(tag: :h3, size: :medium) { I18n.t("projects.settings.header_details") }
end
)
concat(
@@ -52,7 +52,7 @@ See COPYRIGHT and LICENSE files for more details.
settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
concat(
render(Primer::Beta::Subhead.new) do |component|
- component.with_heading(tag: :h2, size: :medium) { I18n.t("projects.settings.header_status") }
+ component.with_heading(tag: :h3, size: :medium) { I18n.t("projects.settings.header_status") }
end
)
concat(
@@ -71,7 +71,7 @@ See COPYRIGHT and LICENSE files for more details.
settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
concat(
render(Primer::Beta::Subhead.new) do |component|
- component.with_heading(tag: :h2, size: :medium) { I18n.t("projects.settings.header_relations") }
+ component.with_heading(tag: :h3, size: :medium) { I18n.t("projects.settings.header_relations") }
end
)
concat(
diff --git a/app/forms/my/look_and_feel_form.rb b/app/forms/my/look_and_feel_form.rb
index 6fcd045a81c..df827a3c6c1 100644
--- a/app/forms/my/look_and_feel_form.rb
+++ b/app/forms/my/look_and_feel_form.rb
@@ -62,6 +62,11 @@ class My::LookAndFeelForm < ApplicationForm
end
end
+ f.check_box name: :disable_keyboard_shortcuts,
+ label: I18n.t("activerecord.attributes.user_preference.disable_keyboard_shortcuts"),
+ caption: I18n.t("activerecord.attributes.user_preference.disable_keyboard_shortcuts_caption_html",
+ href: OpenProject::Static::Links.links[:shortcuts][:href]).html_safe
+
f.submit(name: :submit,
label: I18n.t("activerecord.attributes.user_preference.button_update_look_and_feel"),
scheme: :default)
diff --git a/app/models/permitted_params.rb b/app/models/permitted_params.rb
index 5fb114feb0a..e20d2d1735f 100644
--- a/app/models/permitted_params.rb
+++ b/app/models/permitted_params.rb
@@ -264,8 +264,11 @@ class PermittedParams
end
def pref
- params.fetch(:pref, {}).permit(:time_zone, :theme,
- :comments_sorting, :warn_on_leaving_unsaved,
+ params.fetch(:pref, {}).permit(:time_zone,
+ :theme,
+ :comments_sorting,
+ :disable_keyboard_shortcuts,
+ :warn_on_leaving_unsaved,
:auto_hide_popups)
end
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index e34f27969f1..556e0b4d0ce 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -86,6 +86,14 @@ class UserPreference < ApplicationRecord
comments_sorting == "desc"
end
+ def disable_keyboard_shortcuts?
+ settings.fetch(:disable_keyboard_shortcuts) { Setting.disable_keyboard_shortcuts? }
+ end
+
+ def disable_keyboard_shortcuts=(value)
+ settings[:disable_keyboard_shortcuts] = to_boolean(value)
+ end
+
def diff_type
settings.fetch(:diff_type, "inline")
end
@@ -110,6 +118,7 @@ class UserPreference < ApplicationRecord
alias :comments_in_reverse_order :comments_in_reverse_order?
alias :warn_on_leaving_unsaved :warn_on_leaving_unsaved?
alias :auto_hide_popups :auto_hide_popups?
+ alias :disable_keyboard_shortcuts :disable_keyboard_shortcuts?
def comments_in_reverse_order=(value)
settings[:comments_sorting] = to_boolean(value) ? "desc" : "asc"
diff --git a/app/views/my/interface.html.erb b/app/views/my/interface.html.erb
index cb48a7ea917..c46059ba529 100644
--- a/app/views/my/interface.html.erb
+++ b/app/views/my/interface.html.erb
@@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details.
end
%>
<%=
- settings_primer_form_with(model: @user.pref, scope: :pref, url: { action: "update_settings" }) do |form|
+ settings_primer_form_with(model: @user.pref, scope: :pref, url: { action: "update_settings" }, method: :patch, data: { turbo: false }) do |form|
render(My::LookAndFeelForm.new(form))
end
%>
@@ -58,7 +58,7 @@ See COPYRIGHT and LICENSE files for more details.
end
%>
<%=
- settings_primer_form_with(model: @user.pref, scope: :pref, url: { action: "update_settings" }) do |form|
+ settings_primer_form_with(model: @user.pref, scope: :pref, url: { action: "update_settings" }, data: { turbo: false }) do |form|
render(My::AlertsForm.new(form))
end
%>
diff --git a/app/views/my/settings.html.erb b/app/views/my/settings.html.erb
index b8badde19c2..491b268a3cf 100644
--- a/app/views/my/settings.html.erb
+++ b/app/views/my/settings.html.erb
@@ -47,12 +47,14 @@ See COPYRIGHT and LICENSE files for more details.
<div class="form--field">
<%= f.select :language, lang_options_for_select, container_class: "-middle" %>
</div>
- <%= render Settings::TimeZoneSettingComponent.new(
- "time_zone",
- form: f,
- include_blank: false,
- container_class: "-middle"
- ) %>
+ <%= fields_for :pref, @user.pref, builder: TabularFormBuilder, lang: current_language do |pref_fields| %>
+ <%= render Settings::TimeZoneSettingComponent.new(
+ "time_zone",
+ form: pref_fields,
+ include_blank: false,
+ container_class: "-middle"
+ ) %>
+ <% end %>
</fieldset>
<%= styled_button_tag t(:button_save), class: "-primary -with-icon icon-checkmark" %>
<% end %>
diff --git a/app/views/users/_general.html.erb b/app/views/users/_general.html.erb
index 625dacc61e2..3d6f5faef87 100644
--- a/app/views/users/_general.html.erb
+++ b/app/views/users/_general.html.erb
@@ -48,6 +48,7 @@ See COPYRIGHT and LICENSE files for more details.
},
data: {
controller: "admin--users",
+ turbo: false,
"admin--users-password-auth-selected-value": @user.ldap_auth_source_id.blank?
},
as: :user do |f| %>
diff --git a/app/views/users/_preferences.html.erb b/app/views/users/_preferences.html.erb
index cdd2bda69d3..ec3d9447877 100644
--- a/app/views/users/_preferences.html.erb
+++ b/app/views/users/_preferences.html.erb
@@ -39,12 +39,15 @@ See COPYRIGHT and LICENSE files for more details.
<%= I18n.t("activerecord.attributes.user_preference.mode_guideline") %>
</div>
</div>
+
<div class="form--field">
- <%= pref_fields.select :comments_sorting,
- [[t("activities.work_packages.activity_tab.label_sort_asc"), "asc"],
- [t("activities.work_packages.activity_tab.label_sort_desc"), "desc"]],
- container_class: defined?(input_size) ? "-#{input_size}" : "" %>
+ <%= pref_fields.check_box :disable_keyboard_shortcuts,
+ label: I18n.t("activerecord.attributes.user_preference.disable_keyboard_shortcuts") %>
+ <span class="form--field-instructions">
+ <%= I18n.t(
+ "activerecord.attributes.user_preference.disable_keyboard_shortcuts_caption_html",
+ href: OpenProject::Static::Links.links[:shortcuts][:href]
+ ).html_safe %>
+ </span>
</div>
- <div class="form--field"><%= pref_fields.check_box :warn_on_leaving_unsaved %></div>
- <div class="form--field"><%= pref_fields.check_box :auto_hide_popups %></div>
<% end %>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
index 8fb5425bb53..35acaba0f5b 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -48,6 +48,7 @@ See COPYRIGHT and LICENSE files for more details.
html: { class: nil, autocomplete: "off" },
data: {
controller: "admin--users",
+ turbo: false,
"admin--users-password-auth-selected-value": @user.ldap_auth_source_id.blank?
},
as: :user do |f| %>
diff --git a/config/constants/settings/definition.rb b/config/constants/settings/definition.rb
index afaf76c0ef3..725a21342d7 100644
--- a/config/constants/settings/definition.rb
+++ b/config/constants/settings/definition.rb
@@ -333,6 +333,10 @@ module Settings
description: "Default sort order for activities",
default: "asc"
},
+ disable_keyboard_shortcuts: {
+ description: "Whether keyboard short cuts should be disabled (e.g. for better screen reader support)",
+ default: false
+ },
default_language: {
default: "en",
allowed: -> { Redmine::I18n.all_languages }
diff --git a/config/locales/en.yml b/config/locales/en.yml
index d535d9c1707..cdeeb82bdc2 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1175,6 +1175,9 @@ en:
button_update_look_and_feel: "Update look and feel"
button_update_alerts: "Update alerts"
comments_sorting: "Display work package activity sorted by"
+ disable_keyboard_shortcuts: "Disable keyboard shortcuts"
+ disable_keyboard_shortcuts_caption_html: |-
+ You can choose to disable default <a href="%{href}">keyboard shortcuts</a> if you use a screen reader or want to avoid accidentally triggering an action with a shortcut.
dismissed_enterprise_banners: "Hidden enterprise banners"
impaired: "Accessibility mode"
auto_hide_popups: "Auto-hide success notifications"
diff --git a/config/schemas/user_preferences.schema.json b/config/schemas/user_preferences.schema.json
index 7d6258deab8..04ff02a5d11 100644
--- a/config/schemas/user_preferences.schema.json
+++ b/config/schemas/user_preferences.schema.json
@@ -13,6 +13,9 @@
"type": "string",
"enum": ["light", "light_high_contrast", "dark"]
},
+ "disable_keyboard_shortcuts": {
+ "type": "boolean"
+ },
"warn_on_leaving_unsaved": {
"type": "boolean"
},
diff --git a/docs/api/apiv3/components/schemas/user_preferences_model.yml b/docs/api/apiv3/components/schemas/user_preferences_model.yml
index e361d424519..d6bc74e52f9 100644
--- a/docs/api/apiv3/components/schemas/user_preferences_model.yml
+++ b/docs/api/apiv3/components/schemas/user_preferences_model.yml
@@ -13,6 +13,7 @@ example:
method: "patch"
_type: UserPreferences
commentSortDescending: true
+ disableKeyboardShortcuts: false
timeZone: "Europe/Berlin"
warnOnLeavingUnsaved: true
notifications:
diff --git a/docs/api/apiv3/paths/my_preferences.yml b/docs/api/apiv3/paths/my_preferences.yml
index 606b3fa7041..e9d4d013735 100644
--- a/docs/api/apiv3/paths/my_preferences.yml
+++ b/docs/api/apiv3/paths/my_preferences.yml
@@ -19,6 +19,7 @@ get:
method: "patch"
_type: "UserPreferences"
commentSortDescending: true
+ disableKeyboardShortcuts: false
timeZone: "Europe/Berlin"
warnOnLeavingUnsaved: true
notifications:
@@ -82,6 +83,7 @@ patch:
method: "patch"
_type: UserPreferences
commentSortDescending: true
+ disableKeyboardShortcuts: false
timeZone: Europe/Berlin
warnOnLeavingUnsaved: true
notifications:
diff --git a/frontend/src/app/core/config/configuration.service.ts b/frontend/src/app/core/config/configuration.service.ts
index 071ac782ae0..e96eb0c8a92 100644
--- a/frontend/src/app/core/config/configuration.service.ts
+++ b/frontend/src/app/core/config/configuration.service.ts
@@ -51,6 +51,10 @@ export class ConfigurationService {
return this.userPreference('commentSortDescending');
}
+ public disableKeyboardShortcuts():boolean {
+ return this.userPreference('disableKeyboardShortcuts');
+ }
+
public warnOnLeavingUnsaved():boolean {
return this.userPreference('warnOnLeavingUnsaved');
}
diff --git a/frontend/src/app/features/user-preferences/state/user-preferences.model.ts b/frontend/src/app/features/user-preferences/state/user-preferences.model.ts
index c2f52762635..0fb3de3ee6c 100644
--- a/frontend/src/app/features/user-preferences/state/user-preferences.model.ts
+++ b/frontend/src/app/features/user-preferences/state/user-preferences.model.ts
@@ -17,6 +17,7 @@ export interface ImmediateRemindersSettings {
export interface IUserPreference {
autoHidePopups:boolean;
commentSortDescending:boolean;
+ disableKeyboardShortcuts:boolean;
timeZone:string|null;
warnOnLeavingUnsaved:boolean;
workdays:number[];
diff --git a/frontend/src/app/features/user-preferences/state/user-preferences.store.ts b/frontend/src/app/features/user-preferences/state/user-preferences.store.ts
index f05236f1a43..06a3ef9c381 100644
--- a/frontend/src/app/features/user-preferences/state/user-preferences.store.ts
+++ b/frontend/src/app/features/user-preferences/state/user-preferences.store.ts
@@ -36,6 +36,7 @@ function createInitialState():IUserPreference {
return {
autoHidePopups: true,
commentSortDescending: false,
+ disableKeyboardShortcuts: false,
timeZone: null,
warnOnLeavingUnsaved: true,
notifications: [],
diff --git a/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts b/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
index d10f835da7f..9ece394d3f3 100644
--- a/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
+++ b/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
@@ -31,6 +31,7 @@ import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helpe
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import * as Mousetrap from 'mousetrap';
+import { ConfigurationService } from 'core-app/core/config/configuration.service';
const accessKeys = {
preview: 1,
@@ -45,7 +46,6 @@ const accessKeys = {
// this could be extracted into a separate component if it grows
const accessibleListSelector = 'table.keyboard-accessible-list';
-const accessibleRowSelector = 'table.keyboard-accessible-list tbody tr';
@Injectable({
providedIn: 'root',
@@ -75,17 +75,22 @@ export class KeyboardShortcutService {
/* eslint-enable quote-props */
};
- constructor(private readonly PathHelper:PathHelperService,
+ constructor(
+ private readonly PathHelper:PathHelperService,
private readonly FocusHelper:FocusHelperService,
- private readonly currentProject:CurrentProjectService) {
- this.register();
- }
+ private readonly currentProject:CurrentProjectService,
+ private readonly configurationService:ConfigurationService,
+ ) {}
/**
* Register the keyboard shortcuts.
*/
public register():void {
- _.each(this.shortcuts, (action:() => void, key:string) => Mousetrap.bind(key, action));
+ void this.configurationService.initialize().then(() => {
+ if (!this.configurationService.disableKeyboardShortcuts()) {
+ _.each(this.shortcuts, (action:() => void, key:string) => Mousetrap.bind(key, action));
+ }
+ });
}
public accessKey(keyName:'preview'|'newWorkPackage'|'edit'|'quickSearch'|'projectSearch'|'help'|'moreMenu'|'details'):() => void {
diff --git a/lib/api/v3/user_preferences/user_preference_representer.rb b/lib/api/v3/user_preferences/user_preference_representer.rb
index f626a6f875e..bd395b272eb 100644
--- a/lib/api/v3/user_preferences/user_preference_representer.rb
+++ b/lib/api/v3/user_preferences/user_preference_representer.rb
@@ -56,6 +56,8 @@ module API
property :time_zone,
render_nil: true
+ property :disable_keyboard_shortcuts
+
property :warn_on_leaving_unsaved
property :comments_in_reverse_order,
as: :commentSortDescending
diff --git a/modules/backlogs/app/forms/my/backlogs_form.rb b/modules/backlogs/app/forms/my/backlogs_form.rb
index 9d3c28280b8..15de7a3eddd 100644
--- a/modules/backlogs/app/forms/my/backlogs_form.rb
+++ b/modules/backlogs/app/forms/my/backlogs_form.rb
@@ -30,12 +30,12 @@
class My::BacklogsForm < ApplicationForm
form do |f|
- f.text_field name: :"backlogs[task_color]",
+ f.text_field name: :task_color,
label: I18n.t("backlogs.task_color"),
value: @color,
input_width: :xsmall
- f.check_box name: :"backlogs[versions_default_fold_state]",
+ f.check_box name: :versions_default_fold_state,
value: DEFAULT_FOLD_STATE,
checked: default_fold_state_checked?,
label: I18n.t("backlogs.label_versions_default_fold_state"),
diff --git a/modules/backlogs/app/views/shared/_view_my_settings.html.erb b/modules/backlogs/app/views/shared/_view_my_settings.html.erb
index eccefde6806..c878554ece4 100644
--- a/modules/backlogs/app/views/shared/_view_my_settings.html.erb
+++ b/modules/backlogs/app/views/shared/_view_my_settings.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
end
%>
<%=
- settings_primer_form_with(model: user.pref, scope: :pref, url: { action: "update_settings" }) do |form|
+ settings_primer_form_with(model: user.pref, scope: :backlogs, url: { action: "update_settings" }, data: { turbo: false }) do |form|
render(My::BacklogsForm.new(form, color:, versions_default_fold_state:))
end
%>
diff --git a/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb b/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb
index a421692e8e2..55967958ca1 100644
--- a/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb
+++ b/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb
@@ -130,11 +130,11 @@ RSpec.describe "Backlogs in backlog view", :js,
.expect_story_not_in_sprint(sprint_story1, sprint)
# The backlogs can be folded by default
- visit my_settings_path
+ visit my_interface_path
check "Show versions folded"
- click_button "Save"
+ click_button "Update backlogs module"
backlogs_page.visit!
diff --git a/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb b/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb
index 5ddd99a6d90..ea90be01a85 100644
--- a/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb
+++ b/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb
@@ -238,11 +238,11 @@ RSpec.describe "Tasks on taskboard", :js,
text: "Burndown Chart")
# Tasks can get a color per assigned user
- visit my_settings_path
+ visit my_interface_path
fill_in "Task color", with: "#FBC4B3"
- click_button "Save"
+ click_button "Update backlogs module"
taskboard_page.visit!
diff --git a/spec/contracts/user_preferences/update_contract_spec.rb b/spec/contracts/user_preferences/update_contract_spec.rb
index 8d3a4a8efaa..5e2b829c5c8 100644
--- a/spec/contracts/user_preferences/update_contract_spec.rb
+++ b/spec/contracts/user_preferences/update_contract_spec.rb
@@ -51,6 +51,7 @@ RSpec.describe UserPreferences::UpdateContract do
},
time_zone: "America/Sao_Paulo",
warn_on_leaving_unsaved: true,
+ disable_keyboard_shortcuts: true,
workdays: [1, 2, 4, 6]
}
end
diff --git a/spec/controllers/my_controller_spec.rb b/spec/controllers/my_controller_spec.rb
index 5abec2f0e08..964e36c2087 100644
--- a/spec/controllers/my_controller_spec.rb
+++ b/spec/controllers/my_controller_spec.rb
@@ -230,17 +230,17 @@ RSpec.describe MyController do
end
end
- describe "settings:auto_hide_popups" do
+ describe "interface:auto_hide_popups" do
context "with render_views" do
before do
as_logged_in_user user do
- get :settings
+ get :interface
end
end
render_views
it "renders auto hide popups checkbox" do
- expect(response.body).to have_css("#my_account_form #pref_auto_hide_popups")
+ expect(response.body).to have_css("form #pref_auto_hide_popups")
end
end
diff --git a/spec/features/my/disable_keyboard_shortcuts_spec.rb b/spec/features/my/disable_keyboard_shortcuts_spec.rb
new file mode 100644
index 00000000000..9f9971f7827
--- /dev/null
+++ b/spec/features/my/disable_keyboard_shortcuts_spec.rb
@@ -0,0 +1,70 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) 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.
+#++
+
+require "spec_helper"
+
+RSpec.describe "My account disable keyboard shortcuts setting", :js, :selenium do
+ let(:user) { create(:user) }
+ let(:global_search) { Components::GlobalSearch.new }
+
+ before do
+ login_as(user)
+ visit my_account_path
+ end
+
+ it "can disable the keyboard short cuts" do
+ click_on "Interface"
+
+ # Per default, the keyboard short cuts are enabled
+ expect(page).to have_unchecked_field("Disable keyboard shortcuts", visible: :visible)
+ page.driver.browser.switch_to.active_element.send_keys("s")
+ global_search.expect_open
+
+ # Check the checkbox
+ page.check("Disable keyboard shortcuts")
+ expect(page).to have_checked_field("Disable keyboard shortcuts", visible: :visible)
+
+ # Save
+ click_button accessible_name: "Update look and feel"
+ wait_for_network_idle
+ expect(page).to have_checked_field("Disable keyboard shortcuts", visible: :visible)
+
+ # Directly try to trigger the keyboard short cut again (which should not work any more)
+ page.driver.browser.switch_to.active_element.send_keys("s")
+ global_search.expect_closed
+
+ # After a hard reload, the setting is still remembered and turned off
+ page.refresh
+ wait_for_network_idle
+ expect(page).to have_checked_field("Disable keyboard shortcuts", visible: :visible)
+ page.driver.browser.switch_to.active_element.send_keys("s")
+ global_search.expect_closed
+ end
+end
diff --git a/spec/features/users/my_spec.rb b/spec/features/users/my_spec.rb
index fc58b7adcb6..2962c86da2a 100644
--- a/spec/features/users/my_spec.rb
+++ b/spec/features/users/my_spec.rb
@@ -77,6 +77,8 @@ RSpec.describe "my", :js do
click_on "Save"
expect(page).to have_select "pref_time_zone", selected: "(UTC+01:00) Paris"
+ wait_for_network_idle
+ user.reload
expect(user.pref.time_zone).to eq "Europe/Paris"
end
end
diff --git a/spec/lib/api/v3/user_preferences/user_preference_representer_rendering_spec.rb b/spec/lib/api/v3/user_preferences/user_preference_representer_rendering_spec.rb
index b003763495f..df071c3ed69 100644
--- a/spec/lib/api/v3/user_preferences/user_preference_representer_rendering_spec.rb
+++ b/spec/lib/api/v3/user_preferences/user_preference_representer_rendering_spec.rb
@@ -56,6 +56,7 @@ RSpec.describe API::V3::UserPreferences::UserPreferenceRepresenter,
it { expect(subject).to have_json_path("timeZone") }
it { expect(subject).to have_json_path("commentSortDescending") }
+ it { expect(subject).to have_json_path("disableKeyboardShortcuts") }
it { expect(subject).to have_json_path("warnOnLeavingUnsaved") }
it { expect(subject).to have_json_path("autoHidePopups") }
diff --git a/spec/support/components/global_search.rb b/spec/support/components/global_search.rb
index a0d4f1517fc..379fb27953a 100644
--- a/spec/support/components/global_search.rb
+++ b/spec/support/components/global_search.rb
@@ -44,7 +44,11 @@ module Components
end
def expect_open
- expect(page).to have_selector(container)
+ expect(page).to have_selector(selector)
+ end
+
+ def expect_closed
+ expect(page).to have_no_selector("#{selector}.expanded")
end
def submit_in_project_and_subproject_scope