Commit 50b23e6b authored by Enrique Alcantara's avatar Enrique Alcantara

Rollout in-page search for settings pages

Remove the feature flag for the in-page
search settings feature. This feature allows
searching inside the sections of a settings page.

It is available for admin, group, project, and
user settings.
parent 761a8b63
- 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 }
.js-search-settings-app
%input.gl-form-input.form-control{ type: "text", placeholder: _("Search settings"), aria_label: _("Search settings"), disabled: true }
%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: Rollout in-page search for settings pages
merge_request:
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
......@@ -304,35 +304,10 @@ GitLab instance.
> - [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.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/294025) in GitLab 13.10.
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
it 'displays the search settings entry point' do
render
expect(rendered).to include('js-search-settings-app')
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