Commit dc37eee0 authored by Nick Thomas's avatar Nick Thomas

Merge branch '215160-refactoring-for-group-deploy-keys' into 'master'

Deploy Keys - refactoring

See merge request gitlab-org/gitlab!30225
parents def0b11d 8b471d3a
......@@ -60,11 +60,11 @@ module Projects
end
def to_partial_path
'projects/deploy_keys/index'
'../../shared/deploy_keys/index'
end
def form_partial_path
'projects/deploy_keys/form'
'shared/deploy_keys/project_group_form'
end
private
......
- expanded = expanded_by_default?
%section.qa-deploy-keys-settings.settings.no-animate#js-deploy-keys-settings{ class: ('expanded' if expanded), data: { qa_selector: 'deploy_keys_settings' } }
.settings-header
%h4
Deploy Keys
%h4= _('Deploy Keys')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
Deploy keys allow read-only or read-write (if enabled) access to your repository. Deploy keys can be used for CI, staging or production servers. You can create a deploy key or add an existing one.
= _('Deploy keys allow read-only or read-write (if enabled) access to your repository. Deploy keys can be used for CI, staging or production servers. You can create a deploy key or add an existing one.')
.settings-content
%h5.prepend-top-0
Create a new deploy key for this project
= _('Create a new deploy key for this project')
= render @deploy_keys.form_partial_path
%hr
#js-deploy-keys{ data: { endpoint: project_deploy_keys_path(@project), project_id: @project.id } }
......@@ -8,17 +8,17 @@
= f.text_area :key, class: "form-control", rows: 5, required: true
.form-group.row
%p.light.append-bottom-0
Paste a machine public key here. Read more about how to generate it
= _('Paste a machine public key here. Read more about how to generate it')
= link_to "here", help_page_path("ssh/README")
= f.fields_for :deploy_keys_projects do |deploy_keys_project_form|
.form-group.row
= deploy_keys_project_form.label :can_push do
= deploy_keys_project_form.check_box :can_push
%strong Write access allowed
%strong= _('Write access allowed')
.form-group.row
%p.light.append-bottom-0
Allow this key to push to repository as well? (Default only allows pull access.)
= _('Allow this key to push to repository as well? (Default only allows pull access.)')
.form-group.row
= f.submit "Add key", class: "btn-success btn"
......@@ -6129,6 +6129,9 @@ msgstr ""
msgid "Create a new branch"
msgstr ""
msgid "Create a new deploy key for this project"
msgstr ""
msgid "Create a new file as there are no files yet. Afterwards, you'll be able to commit your changes."
msgstr ""
......@@ -6983,6 +6986,9 @@ msgstr ""
msgid "Deploy key was successfully updated."
msgstr ""
msgid "Deploy keys allow read-only or read-write (if enabled) access to your repository. Deploy keys can be used for CI, staging or production servers. You can create a deploy key or add an existing one."
msgstr ""
msgid "Deploy progress not found. To see pods, ensure your environment matches %{linkStart}deploy board criteria%{linkEnd}."
msgstr ""
......@@ -14799,6 +14805,9 @@ msgstr ""
msgid "Past due"
msgstr ""
msgid "Paste a machine public key here. Read more about how to generate it"
msgstr ""
msgid "Paste a machine public key here. Read more about how to generate it %{link_start}here%{link_end}"
msgstr ""
......
......@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class DeployKeys < Page::Base
view 'app/views/projects/deploy_keys/_form.html.haml' do
view 'app/views/shared/deploy_keys/_form.html.haml' do
element :deploy_key_title, 'text_field :title' # rubocop:disable QA/ElementWithPattern
element :deploy_key_key, 'text_area :key' # rubocop:disable QA/ElementWithPattern
end
......
......@@ -19,7 +19,7 @@ module QA
element :deploy_tokens_settings
end
view 'app/views/projects/deploy_keys/_index.html.haml' do
view 'app/views/shared/deploy_keys/_index.html.haml' do
element :deploy_keys_settings
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