Commit eab88cc6 authored by Nick Kipling's avatar Nick Kipling Committed by Fatih Acet

Added package registry instance settings

Updated admin settings
Created package registry partial
Added npm forwarding setting
Updated pot
parent fc50a42d
......@@ -15,6 +15,8 @@
= render_if_exists 'admin/application_settings/required_instance_ci_setting', expanded: expanded_by_default?
= render_if_exists 'admin/application_settings/package_registry', expanded: expanded_by_default?
- if Gitlab.config.registry.enabled
%section.settings.as-registry.no-animate#js-registry-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
......
- if Feature.enabled?(:forward_npm_package_registry_requests) && Gitlab.config.packages.enabled
%section.settings.as-package.no-animate#js-package-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
%h4
= _('Package Registry')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
= expanded_by_default? ? _('Collapse') : _('Expand')
%p
= _("Settings related to the use and experience of using GitLab's Package Registry.")
.settings-content
= form_for @application_setting, url: ci_cd_admin_application_settings_path(anchor: 'js-package-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
%fieldset
.form-group
.form-check
= f.check_box :npm_package_requests_forwarding, class: 'form-check-input'
= f.label :npm_package_requests_forwarding, class: 'form-check-label' do
Enable forwarding of NPM package requests to npmjs.org
.form-text.text-muted
= _("When enabled, if an NPM package isn't found in the GitLab Registry, we will attempt to pull from the global NPM registry.")
= f.submit _('Save changes'), class: "btn btn-success"
......@@ -226,6 +226,21 @@ describe 'Admin updates EE-only settings' do
end
end
context 'package registry settings' do
before do
visit ci_cd_admin_application_settings_path
end
it 'allows you to change the npm_forwaring setting' do
page.within('#js-package-settings') do
check 'Enable forwarding of NPM package requests to npmjs.org'
click_button 'Save'
end
expect(current_settings.npm_package_requests_forwarding).to be true
end
end
def current_settings
ApplicationSetting.current_without_cache
end
......
......@@ -13475,6 +13475,9 @@ msgstr ""
msgid "Owner"
msgstr ""
msgid "Package Registry"
msgstr ""
msgid "Package deleted successfully"
msgstr ""
......@@ -17623,6 +17626,9 @@ msgstr ""
msgid "Settings"
msgstr ""
msgid "Settings related to the use and experience of using GitLab's Package Registry."
msgstr ""
msgid "Settings to prevent self-approval across all projects in the instance. Only an administrator can modify these settings."
msgstr ""
......@@ -21922,6 +21928,9 @@ msgstr ""
msgid "When enabled, any user visiting %{host} will be able to create an account."
msgstr ""
msgid "When enabled, if an NPM package isn't found in the GitLab Registry, we will attempt to pull from the global NPM registry."
msgstr ""
msgid "When enabled, users cannot use GitLab until the terms have been accepted."
msgstr ""
......
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