Commit 5172c823 authored by Dheeraj Joshi's avatar Dheeraj Joshi

Replace path-lock confirm modal with GlModal

parent 89d6a3f8
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;
} }
......
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