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