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 @@ ...@@ -3,21 +3,24 @@
%fieldset %fieldset
.sub-section .sub-section
%h4= _("Hashed repository storage paths")
.form-group .form-group
.form-check .form-check
= f.check_box :hashed_storage_enabled, class: 'form-check-input qa-hashed-storage-checkbox' = f.check_box :hashed_storage_enabled, class: 'form-check-input qa-hashed-storage-checkbox'
= f.label :hashed_storage_enabled, class: 'form-check-label' do = f.label :hashed_storage_enabled, _("Use hashed storage"), class: 'label-bold form-check-label'
Use hashed storage paths for newly created and renamed projects
.form-text.text-muted .form-text.text-muted
Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents = _("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.")
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 .form-group
= f.label :repository_storages, 'Storage paths for new projects', class: 'label-bold' .form-text
= f.select :repository_storages, repository_storages_options_for_select(@application_setting.repository_storages), %p.text-secondary
{include_hidden: false}, multiple: true, class: 'form-control' = _('Select the configured storaged available for new projects to be placed on.')
.form-text.text-muted = link_to icon('question-circle'), help_page_path('administration/repository_storage_paths')
Manage repository storage paths. Learn more in the .form-check
= succeed "." do = f.collection_check_boxes :repository_storages, Gitlab.config.repositories.storages, :first, :first, include_hidden: false do |b|
= link_to "repository storages documentation", help_page_path("administration/repository_storage_paths") = 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 "" ...@@ -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}" 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 "" msgstr ""
msgid "Hashed repository storage paths"
msgstr ""
msgid "Have your users email" msgid "Have your users email"
msgstr "" msgstr ""
...@@ -14321,6 +14324,9 @@ 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." 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 "" msgstr ""
msgid "Select the configured storaged available for new projects to be placed on."
msgstr ""
msgid "Select the custom project template source group." msgid "Select the custom project template source group."
msgstr "" msgstr ""
...@@ -15334,6 +15340,9 @@ msgstr "" ...@@ -15334,6 +15340,9 @@ msgstr ""
msgid "Storage" msgid "Storage"
msgstr "" msgstr ""
msgid "Storage nodes for new projects"
msgstr ""
msgid "Storage:" msgid "Storage:"
msgstr "" msgstr ""
...@@ -17473,6 +17482,12 @@ msgstr "" ...@@ -17473,6 +17482,12 @@ msgstr ""
msgid "Use group milestones to manage issues from multiple projects in the same milestone." msgid "Use group milestones to manage issues from multiple projects in the same milestone."
msgstr "" 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" msgid "Use one line per URI"
msgstr "" 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