Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5172c823
Commit
5172c823
authored
Jan 28, 2022
by
Dheeraj Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace path-lock confirm modal with GlModal
parent
89d6a3f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
ee/app/assets/javascripts/path_locks.js
ee/app/assets/javascripts/path_locks.js
+4
-3
No files found.
ee/app/assets/javascripts/path_locks.js
View file @
5172c823
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
confirmAction
}
from
'
~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal
'
;
import
{
sprintf
,
__
}
from
'
~/locale
'
;
import
{
sprintf
,
__
}
from
'
~/locale
'
;
export
default
function
initPathLocks
(
url
,
path
)
{
export
default
function
initPathLocks
(
url
,
path
)
{
$
(
'
a.path-lock
'
).
on
(
'
click
'
,
(
e
)
=>
{
$
(
'
a.path-lock
'
).
on
(
'
click
'
,
async
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
const
{
dataset
}
=
e
.
target
;
const
{
dataset
}
=
e
.
target
;
...
@@ -13,8 +14,8 @@ export default function initPathLocks(url, path) {
...
@@ -13,8 +14,8 @@ export default function initPathLocks(url, path) {
?
__
(
'
Are you sure you want to lock %{path}?
'
)
?
__
(
'
Are you sure you want to lock %{path}?
'
)
:
__
(
'
Are you sure you want to unlock %{path}?
'
);
:
__
(
'
Are you sure you want to unlock %{path}?
'
);
// eslint-disable-next-line no-alert
const
confirmed
=
await
confirmAction
(
sprintf
(
message
,
{
path
}));
if
(
!
window
.
confirm
(
sprintf
(
message
,
{
path
}))
)
{
if
(
!
confirmed
)
{
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment