From d7942f223cd30c28933c65bb8efa0cb9277b808e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 30 Oct 2017 15:01:37 +0100 Subject: [PATCH] Allow to disable the Performance Bar and document the `p b` shortcut in its doc page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/models/application_setting.rb | 2 +- ...s-enabled-even-though-it-won-t-show-up.yml | 5 ++++ .../monitoring/performance/performance_bar.md | 6 +++++ doc/workflow/shortcuts.md | 2 +- spec/features/admin/admin_settings_spec.rb | 23 +++++++++++++++++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/39570-performance-bar-appears-enabled-even-though-it-won-t-show-up.yml diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index f266e7db6da..5e16badabec 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -420,7 +420,7 @@ class ApplicationSetting < ActiveRecord::Base # the enabling/disabling is `performance_bar_allowed_group_id` # - If `enable` is false, we set `performance_bar_allowed_group_id` to `nil` def performance_bar_enabled=(enable) - return if enable + return if Gitlab::Utils.to_boolean(enable) self.performance_bar_allowed_group_id = nil end diff --git a/changelogs/unreleased/39570-performance-bar-appears-enabled-even-though-it-won-t-show-up.yml b/changelogs/unreleased/39570-performance-bar-appears-enabled-even-though-it-won-t-show-up.yml new file mode 100644 index 00000000000..66939d89d69 --- /dev/null +++ b/changelogs/unreleased/39570-performance-bar-appears-enabled-even-though-it-won-t-show-up.yml @@ -0,0 +1,5 @@ +--- +title: Allow to disable the Performance Bar +merge_request: 15084 +author: +type: fixed diff --git a/doc/administration/monitoring/performance/performance_bar.md b/doc/administration/monitoring/performance/performance_bar.md index 68efe0aae5c..b9464945cea 100644 --- a/doc/administration/monitoring/performance/performance_bar.md +++ b/doc/administration/monitoring/performance/performance_bar.md @@ -28,6 +28,12 @@ will be allowed to display the Performance Bar. Make sure _Enable the Performance Bar_ is checked and hit **Save** to save the changes. +Once the Performance Bar is enabled, you will need to press the [p + +b keyboard shortcut](../../../workflow/shortcuts.md) to actually +display it. + +You can toggle the Bar using the same shortcut. + --- ![GitLab Performance Bar Admin Settings](img/performance_bar_configuration_settings.png) diff --git a/doc/workflow/shortcuts.md b/doc/workflow/shortcuts.md index 87416008e98..2e1bd6bfe5c 100644 --- a/doc/workflow/shortcuts.md +++ b/doc/workflow/shortcuts.md @@ -9,7 +9,7 @@ You can see GitLab's keyboard shortcuts by using 'shift + ?' | n | Main navigation | | s | Focus search | | f | Focus filter | -| p b | Show/hide the Performance Bar | +| p + b | Show/hide the Performance Bar | | ? | Show/hide this dialog | | + shift + p | Toggle markdown preview | | | Edit last comment (when focused on an empty textarea) | diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index c490dce7ab0..85561511101 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -95,6 +95,29 @@ feature 'Admin updates settings' do expect(find_field('ED25519 SSH keys').value).to eq(forbidden) end + scenario 'Change Performance Bar settings' do + group = create(:group) + + check 'Enable the Performance Bar' + fill_in 'Allowed group', with: group.path + + click_on 'Save' + + expect(page).to have_content 'Application settings saved successfully' + + expect(find_field('Enable the Performance Bar')).to be_checked + expect(find_field('Allowed group').value).to eq group.path + + uncheck 'Enable the Performance Bar' + + click_on 'Save' + + expect(page).to have_content 'Application settings saved successfully' + + expect(find_field('Enable the Performance Bar')).not_to be_checked + expect(find_field('Allowed group').value).to be_nil + end + def check_all_events page.check('Active') page.check('Push')