Commit 73368270 authored by David Fernandez's avatar David Fernandez

Merge branch '294025-rollout-search-settings' into 'master'

Rollout in-page search for settings pages [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!56659
parents 24273981 a4622735
- container_class = local_assigns.fetch(:container_class, 'gl-mt-5')
- if Feature.enabled?(:search_settings_in_page, @project, default_enabled: false)
%div{ class: container_class }
%div{ class: container_class }
.js-search-settings-app
%input.gl-form-input.form-control{ type: "text", placeholder: _("Search settings"), aria_label: _("Search settings"), disabled: true }
---
title: Add in-page search for all settings pages
merge_request: 56659
author:
type: added
---
name: search_settings_in_page
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50207
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/294025
milestone: '13.7'
type: development
group: group::editor
default_enabled: false
......@@ -302,37 +302,12 @@ GitLab instance.
## Search settings
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/292941) in GitLab 13.8.
> - [Added to Group, Admin, and User settings](https://gitlab.com/groups/gitlab-org/-/epics/4842) in GitLab 13.9
> - It's [deployed behind a feature flag](../feature_flags.md), disabled by default.
> - It's disabled on GitLab.com.
> - It's not recommended for production use.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-search-settings). **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/292941) in GitLab 13.8 behind a feature flag, disabled by default.
> - [Added to Group, Admin, and User settings](https://gitlab.com/groups/gitlab-org/-/epics/4842) in GitLab 13.9.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/294025) in GitLab 13.11.
You can search inside a Project, Group, Admin, or User's settings by entering
a search term in the search box located at the top of the page. The search results
appear highlighted in the sections that match the search term.
![Search project settings](img/project_search_general_settings_v13_8.png)
### Enable or disable Search settings **(FREE SELF)**
Search settings is under development and not ready for production use. It is
deployed behind a feature flag that is **disabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md)
can enable it.
To enable it:
```ruby
Feature.enable(:search_settings_in_page)
```
To disable it:
```ruby
Feature.disable(:search_settings_in_page)
```
......@@ -20,8 +20,10 @@ RSpec.describe 'Admin searches application settings', :js do
end
context 'in ci/cd settings page' do
let(:visit_path) { ci_cd_admin_application_settings_path }
before do
visit(ci_cd_admin_application_settings_path)
end
it_behaves_like 'can search settings with feature flag check', 'Variables', 'Package Registry'
it_behaves_like 'can search settings', 'Variables', 'Package Registry'
end
end
......@@ -11,10 +11,12 @@ RSpec.describe 'User searches group settings', :js do
sign_in(user)
end
context 'in General settings page' do
let(:visit_path) { edit_group_path(group) }
context 'in general settings page' do
before do
visit edit_group_path(group)
end
it_behaves_like 'can search settings with feature flag check', 'Naming', 'Permissions'
it_behaves_like 'can search settings', 'Naming', 'Permissions'
end
context 'in Integrations page' do
......
......@@ -10,9 +10,11 @@ RSpec.describe 'User searches their settings', :js do
end
context 'in profile page' do
let(:visit_path) { profile_path }
before do
visit profile_path
end
it_behaves_like 'can search settings with feature flag check', 'Public Avatar', 'Main settings'
it_behaves_like 'can search settings', 'Public Avatar', 'Main settings'
end
context 'in preferences page' do
......
......@@ -11,9 +11,11 @@ RSpec.describe 'User searches project settings', :js do
end
context 'in general settings page' do
let(:visit_path) { edit_project_path(project) }
before do
visit edit_project_path(project)
end
it_behaves_like 'can search settings with feature flag check', 'Naming', 'Visibility'
it_behaves_like 'can search settings', 'Naming', 'Visibility'
end
context 'in Integrations page' do
......
......@@ -35,23 +35,3 @@ RSpec.shared_examples 'can highlight results' do |search_term|
end
end
end
RSpec.shared_examples 'can search settings with feature flag check' do |search_term, non_match_section|
let(:flag) { true }
before do
stub_feature_flags(search_settings_in_page: flag)
visit(visit_path)
end
context 'with feature flag on' do
it_behaves_like 'can search settings', search_term, non_match_section
end
context 'with feature flag off' do
let(:flag) { false }
it_behaves_like 'cannot search settings'
end
end
......@@ -19,21 +19,8 @@ RSpec.describe 'layouts/profile' do
.with({ locals: { container_class: 'gl-my-5' } })
end
context 'when search_settings_in_page feature flag is on' do
it 'displays the search settings entry point' do
render
expect(rendered).to include('js-search-settings-app')
end
end
context 'when search_settings_in_page feature flag is off' do
before do
stub_feature_flags(search_settings_in_page: false)
end
it 'does not display the search settings entry point' do
render
expect(rendered).not_to include('js-search-settings-app')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment