Commit 10897d0c authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '326962-move-service-templates-ui-behind-feature-flag' into 'master'

Move Service Templates nav link behind a feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!59098
parents 20e92797 865a902e
...@@ -172,6 +172,10 @@ module ServicesHelper ...@@ -172,6 +172,10 @@ module ServicesHelper
name: integration.to_param name: integration.to_param
} }
end end
def show_service_templates_nav_link?
Feature.disabled?(:disable_service_templates, type: :development, default_enabled: :yaml)
end
end end
ServicesHelper.prepend_if_ee('EE::ServicesHelper') ServicesHelper.prepend_if_ee('EE::ServicesHelper')
......
...@@ -202,6 +202,7 @@ ...@@ -202,6 +202,7 @@
= render_if_exists 'layouts/nav/sidebar/credentials_link' = render_if_exists 'layouts/nav/sidebar/credentials_link'
- if show_service_templates_nav_link?
= nav_link(controller: :services) do = nav_link(controller: :services) do
= link_to admin_application_settings_services_path do = link_to admin_application_settings_services_path do
.nav-icon-container .nav-icon-container
......
---
name: disable_service_templates
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59098
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/327436
milestone: '13.12'
type: development
group: group::ecosystem
default_enabled: false
...@@ -251,6 +251,16 @@ RSpec.describe 'Admin updates settings' do ...@@ -251,6 +251,16 @@ RSpec.describe 'Admin updates settings' do
end end
end end
context 'when Service Templates are enabled' do
before do
stub_feature_flags(disable_service_templates: false)
visit general_admin_application_settings_path
end
it 'shows Service Templates link' do
expect(page).to have_link('Service Templates')
end
context 'when the Slack Notifications Service template is active' do context 'when the Slack Notifications Service template is active' do
before do before do
create(:service, :template, type: 'SlackService', active: true) create(:service, :template, type: 'SlackService', active: true)
...@@ -288,6 +298,17 @@ RSpec.describe 'Admin updates settings' do ...@@ -288,6 +298,17 @@ RSpec.describe 'Admin updates settings' do
expect(find_field('Deployment')).not_to be_checked expect(find_field('Deployment')).not_to be_checked
end end
end end
end
context 'When Service templates are disabled' do
before do
stub_feature_flags(disable_service_templates: true)
end
it 'does not show Service Templates link' do
expect(page).not_to have_link('Service Templates')
end
end
context 'Integration page', :js do context 'Integration page', :js do
before do before do
......
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