From 043dd1e37ec6f4a91966a6548c2db0613f13834b Mon Sep 17 00:00:00 2001
From: Julia Miocene <jmiocene@gitlab.com>
Date: Tue, 1 Oct 2024 09:35:23 +0000
Subject: [PATCH] Update Locked Files page

Changelog: changed
---
 .../pages/projects/path_locks/index.js           |  5 +++--
 ee/app/views/projects/path_locks/index.html.haml | 16 ++++++++--------
 ee/spec/features/projects/path_locks_spec.rb     |  2 +-
 locale/gitlab.pot                                |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/ee/app/assets/javascripts/pages/projects/path_locks/index.js b/ee/app/assets/javascripts/pages/projects/path_locks/index.js
index 5ebb4f8bd93ad..93736e8e93781 100644
--- a/ee/app/assets/javascripts/pages/projects/path_locks/index.js
+++ b/ee/app/assets/javascripts/pages/projects/path_locks/index.js
@@ -2,12 +2,13 @@ import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_b
 
 initDeprecatedRemoveRowBehavior();
 
-const locks = document.querySelector('.locks');
+const locks = document.querySelector('.js-path-locks');
 
 locks.addEventListener('ajax:success', () => {
   const allRowsHidden = [...locks.querySelectorAll('li')].every((x) => x.offsetParent === null);
 
   if (allRowsHidden) {
-    locks.querySelector('.nothing-here-block.hidden')?.classList?.remove('hidden');
+    locks.querySelector('.js-path-locks-empty-state.hidden')?.classList?.remove('hidden');
+    locks.querySelector('.js-path-locks-header')?.classList?.add('hidden');
   }
 });
diff --git a/ee/app/views/projects/path_locks/index.html.haml b/ee/app/views/projects/path_locks/index.html.haml
index a2de0ff09488f..02a927847d356 100644
--- a/ee/app/views/projects/path_locks/index.html.haml
+++ b/ee/app/views/projects/path_locks/index.html.haml
@@ -1,16 +1,16 @@
 - page_title _("Locked files")
 
-.top-area
-  .nav-text
-    = sprite_icon('lock', size: 16, css_class: 'gl-align-middle')
-    = _("The following files or directories can only be modified by the user who locked them.")
-
-.locks
+.js-path-locks
   - if @path_locks.any?
+    = render ::Layouts::PageHeadingComponent.new(_('Locked files'),
+      description: _("The following files or directories can only be modified by the user who locked them."),
+      options: { class: 'js-path-locks-header' })
+
     %ul.content-list
       = render @path_locks
 
     = paginate @path_locks, theme: 'gitlab'
 
-  .nothing-here-block{ class: ('hidden' if @path_locks.any?) }
-    = _("Repository has no locks.")
+  .js-path-locks-empty-state{ class: ('hidden' if @path_locks.any?) }
+    = render Pajamas::EmptyStateComponent.new(svg_path: 'illustrations/status/status-nothing-md.svg',
+      title: _("Repository has no locks"))
diff --git a/ee/spec/features/projects/path_locks_spec.rb b/ee/spec/features/projects/path_locks_spec.rb
index dbc5407a6282f..1dd0337eb9df9 100644
--- a/ee/spec/features/projects/path_locks_spec.rb
+++ b/ee/spec/features/projects/path_locks_spec.rb
@@ -74,7 +74,7 @@
 
     click_link "Locked files"
 
-    within '.locks' do
+    within '.js-path-locks' do
       expect(page).to have_content('encoding')
     end
 
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index a3414d09e633d..722d298e6724c 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -46001,7 +46001,7 @@ msgstr ""
 msgid "Repository has more than one branch."
 msgstr ""
 
-msgid "Repository has no locks."
+msgid "Repository has no locks"
 msgstr ""
 
 msgid "Repository has tags."
-- 
GitLab