Commit d4ac6f76 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Checkbox select repository storages

Repository storages selection was rather brittle, as a few wrong clicks
in the small selection box could lead to a storage not being used, or
actually being used.

This change updates the styling a bit to conform to other styling, uses
i18n for strings in this section, and uses checkboxes to select storage
nodes.

Conflicts:
	locale/gitlab.pot
parent da72dc6d
......@@ -3,21 +3,24 @@
%fieldset
.sub-section
%h4= _("Hashed repository storage paths")
.form-group
.form-check
= f.check_box :hashed_storage_enabled, class: 'form-check-input qa-hashed-storage-checkbox'
= f.label :hashed_storage_enabled, class: 'form-check-label' do
Use hashed storage paths for newly created and renamed projects
= f.label :hashed_storage_enabled, _("Use hashed storage"), class: 'label-bold form-check-label'
.form-text.text-muted
Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents
repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance.
= _("Use hashed storage paths for newly created and renamed projects. Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance.")
.sub-section
%h4= _("Storage nodes for new projects")
.form-group
= f.label :repository_storages, 'Storage paths for new projects', class: 'label-bold'
= f.select :repository_storages, repository_storages_options_for_select(@application_setting.repository_storages),
{include_hidden: false}, multiple: true, class: 'form-control'
.form-text.text-muted
Manage repository storage paths. Learn more in the
= succeed "." do
= link_to "repository storages documentation", help_page_path("administration/repository_storage_paths")
.form-text
%p.text-secondary
= _('Select the configured storaged available for new projects to be placed on.')
= link_to icon('question-circle'), help_page_path('administration/repository_storage_paths')
.form-check
= f.collection_check_boxes :repository_storages, Gitlab.config.repositories.storages, :first, :first, include_hidden: false do |b|
= b.check_box class: 'form-check-input'
= b.label class: 'label-bold form-check-label'
%br
= f.submit 'Save changes', class: "btn btn-success qa-save-changes-button"
= f.submit _('Save changes'), class: "btn btn-success qa-save-changes-button"
......@@ -8213,6 +8213,9 @@ msgstr ""
msgid "HTTP Basic: Access denied\\nYou must use a personal access token with 'api' scope for Git over HTTP.\\nYou can generate one at %{profile_personal_access_tokens_url}"
msgstr ""
msgid "Hashed repository storage paths"
msgstr ""
msgid "Have your users email"
msgstr ""
......@@ -14321,6 +14324,9 @@ msgstr ""
msgid "Select the branch you want to set as the default for this project. All merge requests and commits will automatically be made against this branch unless you specify a different one."
msgstr ""
msgid "Select the configured storaged available for new projects to be placed on."
msgstr ""
msgid "Select the custom project template source group."
msgstr ""
......@@ -15334,6 +15340,9 @@ msgstr ""
msgid "Storage"
msgstr ""
msgid "Storage nodes for new projects"
msgstr ""
msgid "Storage:"
msgstr ""
......@@ -17473,6 +17482,12 @@ msgstr ""
msgid "Use group milestones to manage issues from multiple projects in the same milestone."
msgstr ""
msgid "Use hashed storage"
msgstr ""
msgid "Use hashed storage paths for newly created and renamed projects. Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance."
msgstr ""
msgid "Use one line per URI"
msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
describe 'admin/application_settings/_repository_storage.html.haml' do
let(:app_settings) { build(:application_setting) }
let(:storages) do
{
"mepmep" => { "path" => "/tmp" },
"foobar" => { "path" => "/tmp" }
}
end
before do
assign(:application_setting, app_settings)
stub_storage_settings(storages)
end
context 'when multiple storages are available' do
it 'lists them all' do
render
storages.keys.each do |storage_name|
expect(rendered).to have_content(storage_name)
end
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