From dde6d240811a37d0b9adaa7be7111580c3792380 Mon Sep 17 00:00:00 2001
From: Annabel Dunstone Gray <annabel.dunstone@gmail.com>
Date: Thu, 11 Jul 2024 11:27:52 -0600
Subject: [PATCH] Update deploy keys pages

Changelog: changed
---
 .../settings/components/access_dropdown.vue   |  2 +-
 app/views/admin/deploy_keys/edit.html.haml    | 20 +++++++++----------
 app/views/admin/deploy_keys/index.html.haml   |  4 +++-
 app/views/admin/deploy_keys/new.html.haml     |  8 ++++----
 app/views/projects/deploy_keys/edit.html.haml |  2 +-
 .../hardening_application_recommendations.md  |  2 +-
 doc/user/project/deploy_keys/index.md         |  2 +-
 ee/lib/ee/gitlab/git_access_project.rb        |  2 +-
 ee/spec/features/protected_branches_spec.rb   |  2 +-
 ee/spec/features/protected_tags_spec.rb       |  2 +-
 lib/sidebars/admin/menus/deploy_keys_menu.rb  |  2 +-
 locale/gitlab.pot                             | 10 ++--------
 spec/features/admin/admin_deploy_keys_spec.rb | 10 +++++-----
 .../settings/repository_settings_spec.rb      |  2 +-
 spec/features/protected_branches_spec.rb      |  2 +-
 spec/features/protected_tags_spec.rb          |  2 +-
 .../admin/menus/deploy_keys_menu_spec.rb      |  2 +-
 ...cted_branches_with_deploy_keys_examples.rb |  2 +-
 ...rotected_tags_with_deploy_keys_examples.rb |  2 +-
 19 files changed, 37 insertions(+), 43 deletions(-)

diff --git a/app/assets/javascripts/projects/settings/components/access_dropdown.vue b/app/assets/javascripts/projects/settings/components/access_dropdown.vue
index 3fee7eaf31ce..f654072398af 100644
--- a/app/assets/javascripts/projects/settings/components/access_dropdown.vue
+++ b/app/assets/javascripts/projects/settings/components/access_dropdown.vue
@@ -20,7 +20,7 @@ export const i18n = {
   groupsSectionHeader: s__('AccessDropdown|Groups'),
   usersSectionHeader: s__('AccessDropdown|Users'),
   noRole: s__('AccessDropdown|No role'),
-  deployKeysSectionHeader: s__('AccessDropdown|Deploy Keys'),
+  deployKeysSectionHeader: s__('AccessDropdown|Deploy keys'),
   ownedBy: __('Owned by %{image_tag}'),
 };
 
diff --git a/app/views/admin/deploy_keys/edit.html.haml b/app/views/admin/deploy_keys/edit.html.haml
index 14f5d70b226f..f9373bfbee0d 100644
--- a/app/views/admin/deploy_keys/edit.html.haml
+++ b/app/views/admin/deploy_keys/edit.html.haml
@@ -1,13 +1,11 @@
-- add_to_breadcrumbs _('Deploy Keys'), admin_deploy_keys_path
-- page_title _('Edit Deploy Key')
+- add_to_breadcrumbs _('Deploy keys'), admin_deploy_keys_path
+- page_title _('Edit deploy key')
 
-%h1.page-title.gl-font-size-h-display= _('Edit public deploy key')
-%hr
+= render ::Layouts::PageHeadingComponent.new(_('Edit public deploy key'))
 
-%div
-  = gitlab_ui_form_for [:admin, @deploy_key], html: { class: 'deploy-key-form' } do |f|
-    = render partial: 'shared/deploy_keys/form', locals: { form: f, deploy_key: @deploy_key }
-    .form-actions
-      = f.submit _('Save changes'), pajamas_button: true
-      = render Pajamas::ButtonComponent.new(href: admin_deploy_keys_path) do
-        = _('Cancel')
+= gitlab_ui_form_for [:admin, @deploy_key], html: { class: 'deploy-key-form' } do |f|
+  = render partial: 'shared/deploy_keys/form', locals: { form: f, deploy_key: @deploy_key }
+  .gl-flex.gl-gap-3
+    = f.submit _('Save changes'), pajamas_button: true
+    = render Pajamas::ButtonComponent.new(href: admin_deploy_keys_path) do
+      = _('Cancel')
diff --git a/app/views/admin/deploy_keys/index.html.haml b/app/views/admin/deploy_keys/index.html.haml
index de2a737faa12..1c9a668d5ee9 100644
--- a/app/views/admin/deploy_keys/index.html.haml
+++ b/app/views/admin/deploy_keys/index.html.haml
@@ -1,3 +1,5 @@
-- page_title _('Deploy Keys')
+- page_title _('Deploy keys')
+
+= render ::Layouts::PageHeadingComponent.new(_('Deploy keys'))
 
 #js-admin-deploy-keys-table{ data: admin_deploy_keys_data }
diff --git a/app/views/admin/deploy_keys/new.html.haml b/app/views/admin/deploy_keys/new.html.haml
index 8e0b0d347a20..278db311cc0d 100644
--- a/app/views/admin/deploy_keys/new.html.haml
+++ b/app/views/admin/deploy_keys/new.html.haml
@@ -1,11 +1,11 @@
-- add_to_breadcrumbs _('Deploy Keys'), admin_deploy_keys_path
-- page_title _('New Deploy Key')
+- add_to_breadcrumbs _('Deploy keys'), admin_deploy_keys_path
+- page_title _('New deploy key')
 
-%h1.page-title.gl-font-size-h-display= _('New public deploy key')
+= render ::Layouts::PageHeadingComponent.new(_('New public deploy key'))
 
 = gitlab_ui_form_for [:admin, @deploy_key], html: { class: 'deploy-key-form' } do |f|
   = render partial: 'shared/deploy_keys/form', locals: { form: f, deploy_key: @deploy_key }
-  .gl-display-flex.gl-mt-6.gl-gap-3
+  .gl-display-flex.gl-gap-3
     = f.submit 'Create', pajamas_button: true
     = render Pajamas::ButtonComponent.new(href: admin_deploy_keys_path) do
       = _('Cancel')
diff --git a/app/views/projects/deploy_keys/edit.html.haml b/app/views/projects/deploy_keys/edit.html.haml
index 0044ff4dc24f..982ab64ac55b 100644
--- a/app/views/projects/deploy_keys/edit.html.haml
+++ b/app/views/projects/deploy_keys/edit.html.haml
@@ -3,6 +3,6 @@
 
 = gitlab_ui_form_for [@project, @deploy_key], include_id: false, html: { class: 'js-requires-input' } do |f|
   = render partial: 'shared/deploy_keys/form', locals: { form: f, deploy_key: @deploy_key }
-  .gl-display-flex.gl-mt-6.gl-gap-3
+  .gl-display-flex.gl-gap-3
     = f.submit _('Save changes'), pajamas_button: true
     = link_button_to _('Cancel'), project_settings_repository_path(@project, anchor: 'js-deploy-keys-settings')
diff --git a/doc/security/hardening_application_recommendations.md b/doc/security/hardening_application_recommendations.md
index 4f185f66b968..95ff61f4e25d 100644
--- a/doc/security/hardening_application_recommendations.md
+++ b/doc/security/hardening_application_recommendations.md
@@ -46,7 +46,7 @@ The adjustments help limit pushes to established and authorized users.
 ## Deploy keys
 
 1. On the left sidebar, at the bottom, select **Admin area**.
-1. Select **Deploy Keys**.
+1. Select **Deploy keys**.
 
 Public deploy keys at are used to give read or read/write access to
 **all** projects on the instance, and are intended for remote automation to access
diff --git a/doc/user/project/deploy_keys/index.md b/doc/user/project/deploy_keys/index.md
index 982167f89f89..04d472a2d7c7 100644
--- a/doc/user/project/deploy_keys/index.md
+++ b/doc/user/project/deploy_keys/index.md
@@ -120,7 +120,7 @@ Prerequisites:
 To create a public deploy key:
 
 1. On the left sidebar, at the bottom, select **Admin area**.
-1. Select **Deploy Keys**.
+1. Select **Deploy keys**.
 1. Select **New deploy key**.
 1. Complete the fields.
    - Use a meaningful description for **Name**. For example, include the name of the external host
diff --git a/ee/lib/ee/gitlab/git_access_project.rb b/ee/lib/ee/gitlab/git_access_project.rb
index db027a01cf53..7a2b1226cb87 100644
--- a/ee/lib/ee/gitlab/git_access_project.rb
+++ b/ee/lib/ee/gitlab/git_access_project.rb
@@ -45,7 +45,7 @@ def allowed_access_namespace?
 
       # Verify that enabled_git_access_protocol is ssh_certificates and the
       # actor is either User or Key
-      # Deploy Keys are allowed anyway
+      # Deploy keys are allowed anyway
       def enforced_ssh_certificates?
         return false if ::Feature.disabled?(:enforce_ssh_certificates_via_settings, namespace.root_ancestor)
         return false unless namespace.root_ancestor.enforce_ssh_certificates?
diff --git a/ee/spec/features/protected_branches_spec.rb b/ee/spec/features/protected_branches_spec.rb
index d5f379f89cb2..d1f376ca2ff5 100644
--- a/ee/spec/features/protected_branches_spec.rb
+++ b/ee/spec/features/protected_branches_spec.rb
@@ -260,7 +260,7 @@ def submit_form
     end
 
     include_examples 'Deploy keys with protected branches' do
-      let(:all_dropdown_sections) { ['Roles', 'Users', 'Deploy Keys'] }
+      let(:all_dropdown_sections) { ['Roles', 'Users', 'Deploy keys'] }
     end
   end
 
diff --git a/ee/spec/features/protected_tags_spec.rb b/ee/spec/features/protected_tags_spec.rb
index 316ccc0756e6..8808124cb7be 100644
--- a/ee/spec/features/protected_tags_spec.rb
+++ b/ee/spec/features/protected_tags_spec.rb
@@ -60,7 +60,7 @@
     end
 
     include_examples 'Deploy keys with protected tags' do
-      let(:all_dropdown_sections) { ['Roles', 'Users', 'Deploy Keys'] }
+      let(:all_dropdown_sections) { ['Roles', 'Users', 'Deploy keys'] }
     end
   end
 end
diff --git a/lib/sidebars/admin/menus/deploy_keys_menu.rb b/lib/sidebars/admin/menus/deploy_keys_menu.rb
index 4ffc6635f279..dbe470d81eee 100644
--- a/lib/sidebars/admin/menus/deploy_keys_menu.rb
+++ b/lib/sidebars/admin/menus/deploy_keys_menu.rb
@@ -11,7 +11,7 @@ def link
 
         override :title
         def title
-          s_('Admin|Deploy Keys')
+          s_('Admin|Deploy keys')
         end
 
         override :sprite_icon
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index f9a7155dd7d6..511977853d4e 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -2705,7 +2705,7 @@ msgstr ""
 msgid "Access to '%{classification_label}' not allowed"
 msgstr ""
 
-msgid "AccessDropdown|Deploy Keys"
+msgid "AccessDropdown|Deploy keys"
 msgstr ""
 
 msgid "AccessDropdown|Groups"
@@ -4699,7 +4699,7 @@ msgstr ""
 msgid "Admin|Credentials"
 msgstr ""
 
-msgid "Admin|Deploy Keys"
+msgid "Admin|Deploy keys"
 msgstr ""
 
 msgid "Admin|Features"
@@ -17900,9 +17900,6 @@ msgstr[1] ""
 msgid "Deploy Key"
 msgstr ""
 
-msgid "Deploy Keys"
-msgstr ""
-
 msgid "Deploy Token"
 msgstr ""
 
@@ -34543,9 +34540,6 @@ msgstr ""
 msgid "New Branch"
 msgstr ""
 
-msgid "New Deploy Key"
-msgstr ""
-
 msgid "New Epic"
 msgstr ""
 
diff --git a/spec/features/admin/admin_deploy_keys_spec.rb b/spec/features/admin/admin_deploy_keys_spec.rb
index 1d35cdd4da7a..98ad4837f073 100644
--- a/spec/features/admin/admin_deploy_keys_spec.rb
+++ b/spec/features/admin/admin_deploy_keys_spec.rb
@@ -37,7 +37,7 @@ def page_breadcrumbs
     it 'shows breadcrumbs' do
       expect(page_breadcrumbs).to eq([
         { text: 'Admin area', href: admin_root_path },
-        { text: 'Deploy Keys', href: admin_deploy_keys_path }
+        { text: 'Deploy keys', href: admin_deploy_keys_path }
       ])
     end
   end
@@ -75,8 +75,8 @@ def page_breadcrumbs
     it 'shows breadcrumbs' do
       expect(page_breadcrumbs).to eq([
         { text: 'Admin area', href: admin_root_path },
-        { text: 'Deploy Keys', href: admin_deploy_keys_path },
-        { text: 'New Deploy Key', href: new_admin_deploy_key_path }
+        { text: 'Deploy keys', href: admin_deploy_keys_path },
+        { text: 'New deploy key', href: new_admin_deploy_key_path }
       ])
     end
   end
@@ -103,8 +103,8 @@ def page_breadcrumbs
     it 'shows breadcrumbs' do
       expect(page_breadcrumbs).to eq([
         { text: 'Admin area', href: admin_root_path },
-        { text: 'Deploy Keys', href: admin_deploy_keys_path },
-        { text: 'Edit Deploy Key', href: edit_admin_deploy_key_path(deploy_key) }
+        { text: 'Deploy keys', href: admin_deploy_keys_path },
+        { text: 'Edit deploy key', href: edit_admin_deploy_key_path(deploy_key) }
       ])
     end
   end
diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb
index aa001a136ac4..aba4a8fccb35 100644
--- a/spec/features/projects/settings/repository_settings_spec.rb
+++ b/spec/features/projects/settings/repository_settings_spec.rb
@@ -61,7 +61,7 @@
       end
     end
 
-    context 'Deploy Keys', :js do
+    context 'Deploy keys', :js do
       let_it_be(:private_deploy_key) { create(:deploy_key, title: 'private_deploy_key', public: false) }
       let_it_be(:public_deploy_key) { create(:another_deploy_key, title: 'public_deploy_key', public: true) }
 
diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb
index ba6e38ae82ba..517bdada675f 100644
--- a/spec/features/protected_branches_spec.rb
+++ b/spec/features/protected_branches_spec.rb
@@ -211,7 +211,7 @@
     end
 
     include_examples 'Deploy keys with protected branches' do
-      let(:all_dropdown_sections) { ['Roles', 'Deploy Keys'] }
+      let(:all_dropdown_sections) { ['Roles', 'Deploy keys'] }
     end
   end
 end
diff --git a/spec/features/protected_tags_spec.rb b/spec/features/protected_tags_spec.rb
index f5b463d63fad..696a2d11b692 100644
--- a/spec/features/protected_tags_spec.rb
+++ b/spec/features/protected_tags_spec.rb
@@ -119,7 +119,7 @@
     end
 
     include_examples 'Deploy keys with protected tags' do
-      let(:all_dropdown_sections) { ['Roles', 'Deploy Keys'] }
+      let(:all_dropdown_sections) { ['Roles', 'Deploy keys'] }
     end
   end
 end
diff --git a/spec/lib/sidebars/admin/menus/deploy_keys_menu_spec.rb b/spec/lib/sidebars/admin/menus/deploy_keys_menu_spec.rb
index f0ee846fb427..074abd9b5dd9 100644
--- a/spec/lib/sidebars/admin/menus/deploy_keys_menu_spec.rb
+++ b/spec/lib/sidebars/admin/menus/deploy_keys_menu_spec.rb
@@ -5,7 +5,7 @@
 RSpec.describe Sidebars::Admin::Menus::DeployKeysMenu, feature_category: :navigation do
   it_behaves_like 'Admin menu',
     link: '/admin/deploy_keys',
-    title: s_('Admin|Deploy Keys'),
+    title: s_('Admin|Deploy keys'),
     icon: 'key'
 
   it_behaves_like 'Admin menu without sub menus', active_routes: { controller: :deploy_keys }
diff --git a/spec/support/shared_examples/features/protected_branches_with_deploy_keys_examples.rb b/spec/support/shared_examples/features/protected_branches_with_deploy_keys_examples.rb
index 956d5ca22958..13e0c2a5ef74 100644
--- a/spec/support/shared_examples/features/protected_branches_with_deploy_keys_examples.rb
+++ b/spec/support/shared_examples/features/protected_branches_with_deploy_keys_examples.rb
@@ -6,7 +6,7 @@
     sign_in(user)
   end
 
-  let(:dropdown_sections_minus_deploy_keys) { all_dropdown_sections - ['Deploy Keys'] }
+  let(:dropdown_sections_minus_deploy_keys) { all_dropdown_sections - ['Deploy keys'] }
 
   context 'when deploy keys are enabled to this project' do
     let!(:deploy_key_1) { create(:deploy_key, title: 'title 1', projects: [project]) }
diff --git a/spec/support/shared_examples/features/protected_tags_with_deploy_keys_examples.rb b/spec/support/shared_examples/features/protected_tags_with_deploy_keys_examples.rb
index 2b7147fa4b4a..2e5601d31ef8 100644
--- a/spec/support/shared_examples/features/protected_tags_with_deploy_keys_examples.rb
+++ b/spec/support/shared_examples/features/protected_tags_with_deploy_keys_examples.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 RSpec.shared_examples 'Deploy keys with protected tags' do
-  let(:dropdown_sections_minus_deploy_keys) { all_dropdown_sections - ['Deploy Keys'] }
+  let(:dropdown_sections_minus_deploy_keys) { all_dropdown_sections - ['Deploy keys'] }
 
   context 'when deploy keys are enabled to this project' do
     let!(:deploy_key_1) { create(:deploy_key, title: 'title 1', projects: [project]) }
-- 
GitLab