Skip to content
代码片段 群组 项目
未验证 提交 043dd1e3 编辑于 作者: Julia Miocene's avatar Julia Miocene 提交者: GitLab
浏览文件

Update Locked Files page

Changelog: changed
上级 07476c8f
No related branches found
No related tags found
无相关合并请求
...@@ -2,12 +2,13 @@ import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_b ...@@ -2,12 +2,13 @@ import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_b
initDeprecatedRemoveRowBehavior(); initDeprecatedRemoveRowBehavior();
const locks = document.querySelector('.locks'); const locks = document.querySelector('.js-path-locks');
locks.addEventListener('ajax:success', () => { locks.addEventListener('ajax:success', () => {
const allRowsHidden = [...locks.querySelectorAll('li')].every((x) => x.offsetParent === null); const allRowsHidden = [...locks.querySelectorAll('li')].every((x) => x.offsetParent === null);
if (allRowsHidden) { 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');
} }
}); });
- page_title _("Locked files") - page_title _("Locked files")
.top-area .js-path-locks
.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
- if @path_locks.any? - 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 %ul.content-list
= render @path_locks = render @path_locks
= paginate @path_locks, theme: 'gitlab' = paginate @path_locks, theme: 'gitlab'
.nothing-here-block{ class: ('hidden' if @path_locks.any?) } .js-path-locks-empty-state{ class: ('hidden' if @path_locks.any?) }
= _("Repository has no locks.") = render Pajamas::EmptyStateComponent.new(svg_path: 'illustrations/status/status-nothing-md.svg',
title: _("Repository has no locks"))
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
click_link "Locked files" click_link "Locked files"
within '.locks' do within '.js-path-locks' do
expect(page).to have_content('encoding') expect(page).to have_content('encoding')
end end
......
...@@ -46001,7 +46001,7 @@ msgstr "" ...@@ -46001,7 +46001,7 @@ msgstr ""
msgid "Repository has more than one branch." msgid "Repository has more than one branch."
msgstr "" msgstr ""
   
msgid "Repository has no locks." msgid "Repository has no locks"
msgstr "" msgstr ""
   
msgid "Repository has tags." msgid "Repository has tags."
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册