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
8e5ec1d2
Commit
8e5ec1d2
authored
Dec 21, 2021
by
Ezekiel Kigbo
Committed by
Martin Wortschack
Dec 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove legacy shared confirm_modal partial
parent
74dadeb0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
98 deletions
+0
-98
app/assets/javascripts/confirm_danger_modal.js
app/assets/javascripts/confirm_danger_modal.js
+0
-64
app/assets/javascripts/pages/groups/edit/index.js
app/assets/javascripts/pages/groups/edit/index.js
+0
-2
app/assets/javascripts/pages/projects/edit/index.js
app/assets/javascripts/pages/projects/edit/index.js
+0
-2
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+0
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+0
-2
app/views/shared/_confirm_modal.html.haml
app/views/shared/_confirm_modal.html.haml
+0
-21
qa/qa/page/component/confirm_modal.rb
qa/qa/page/component/confirm_modal.rb
+0
-6
No files found.
app/assets/javascripts/confirm_danger_modal.js
deleted
100644 → 0
View file @
74dadeb0
import
$
from
'
jquery
'
;
import
{
Rails
}
from
'
~/lib/utils/rails_ujs
'
;
import
{
rstrip
}
from
'
./lib/utils/common_utils
'
;
function
openConfirmDangerModal
(
$form
,
$modal
,
text
)
{
const
$input
=
$
(
'
.js-legacy-confirm-danger-input
'
,
$modal
);
$input
.
val
(
''
);
$
(
'
.js-confirm-text
'
,
$modal
).
text
(
text
||
''
);
$modal
.
modal
(
'
show
'
);
const
confirmTextMatch
=
$
(
'
.js-legacy-confirm-danger-match
'
,
$modal
).
text
();
const
$submit
=
$
(
'
.js-legacy-confirm-danger-submit
'
,
$modal
);
$submit
.
disable
();
$input
.
focus
();
// eslint-disable-next-line @gitlab/no-global-event-off
$input
.
off
(
'
input
'
).
on
(
'
input
'
,
function
handleInput
()
{
const
confirmText
=
rstrip
(
$
(
this
).
val
());
if
(
confirmText
===
confirmTextMatch
)
{
$submit
.
enable
();
}
else
{
$submit
.
disable
();
}
});
// eslint-disable-next-line @gitlab/no-global-event-off
$
(
'
.js-legacy-confirm-danger-submit
'
,
$modal
)
.
off
(
'
click
'
)
.
on
(
'
click
'
,
()
=>
{
if
(
$form
.
data
(
'
remote
'
))
{
Rails
.
fire
(
$form
[
0
],
'
submit
'
);
}
else
{
$form
.
submit
();
}
});
}
function
getModal
(
$btn
)
{
const
$modal
=
$btn
.
prev
(
'
.modal
'
);
if
(
$modal
.
length
)
{
return
$modal
;
}
return
$
(
'
#modal-confirm-danger
'
);
}
export
default
function
initConfirmDangerModal
()
{
$
(
document
).
on
(
'
click
'
,
'
.js-legacy-confirm-danger
'
,
(
e
)
=>
{
const
$btn
=
$
(
e
.
target
);
const
checkFieldName
=
$btn
.
data
(
'
checkFieldName
'
);
const
checkFieldCompareValue
=
$btn
.
data
(
'
checkCompareValue
'
);
const
checkFieldVal
=
parseInt
(
$
(
`[name="
${
checkFieldName
}
"]`
).
val
(),
10
);
if
(
!
checkFieldName
||
checkFieldVal
<
checkFieldCompareValue
)
{
e
.
preventDefault
();
const
$form
=
$btn
.
closest
(
'
form
'
);
const
$modal
=
getModal
(
$btn
);
const
text
=
$btn
.
data
(
'
confirmDangerMessage
'
);
openConfirmDangerModal
(
$form
,
$modal
,
text
);
}
});
}
app/assets/javascripts/pages/groups/edit/index.js
View file @
8e5ec1d2
import
{
GROUP_BADGE
}
from
'
~/badges/constants
'
;
import
initConfirmDangerModal
from
'
~/confirm_danger_modal
'
;
import
dirtySubmitFactory
from
'
~/dirty_submit/dirty_submit_factory
'
;
import
initFilePickers
from
'
~/file_pickers
'
;
import
TransferDropdown
from
'
~/groups/transfer_dropdown
'
;
...
...
@@ -14,7 +13,6 @@ import initConfirmDanger from '~/init_confirm_danger';
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initFilePickers
();
initConfirmDangerModal
();
initConfirmDanger
();
initSettingsPanels
();
dirtySubmitFactory
(
...
...
app/assets/javascripts/pages/projects/edit/index.js
View file @
8e5ec1d2
import
{
PROJECT_BADGE
}
from
'
~/badges/constants
'
;
import
initLegacyConfirmDangerModal
from
'
~/confirm_danger_modal
'
;
import
initConfirmDanger
from
'
~/init_confirm_danger
'
;
import
dirtySubmitFactory
from
'
~/dirty_submit/dirty_submit_factory
'
;
import
initFilePickers
from
'
~/file_pickers
'
;
...
...
@@ -15,7 +14,6 @@ import initProjectPermissionsSettings from '../shared/permissions';
import
initProjectLoadingSpinner
from
'
../shared/save_project_loader
'
;
initFilePickers
();
initLegacyConfirmDangerModal
();
initConfirmDanger
();
initSettingsPanels
();
initProjectDeleteButton
();
...
...
app/views/groups/edit.html.haml
View file @
8e5ec1d2
...
...
@@ -60,4 +60,3 @@
=
render_if_exists
'shared/groups/max_pages_size_setting'
=
render
'shared/confirm_modal'
,
phrase:
@group
.
path
app/views/projects/edit.html.haml
View file @
8e5ec1d2
...
...
@@ -110,5 +110,3 @@
.gl-spinner.gl-spinner-md.align-text-bottom
=
_
(
'Saving project.'
)
%p
=
_
(
'Please wait a moment, this page will automatically refresh when ready.'
)
=
render
'shared/confirm_modal'
,
phrase:
@project
.
path
app/views/shared/_confirm_modal.html.haml
deleted
100644 → 0
View file @
74dadeb0
#modal-confirm-danger
.modal.qa-confirm-modal
{
tabindex:
-
1
}
.modal-dialog
.modal-content
.modal-header
%h3
.page-title
=
_
(
'Confirmation required'
)
%button
.close
{
type:
"button"
,
"data-dismiss"
:
"modal"
,
"aria-label"
=>
_
(
'Close'
)
}
%span
{
"aria-hidden"
:
"true"
}
×
.modal-body
%p
.text-danger.js-confirm-text
%p
%span
.js-warning-text
=
_
(
'This action can lead to data loss. To prevent accidental actions we ask you to confirm your intention.'
)
%br
-
phrase_code
=
'<code class="js-legacy-confirm-danger-match">%{phrase_name}</code>'
.
html_safe
%
{
phrase_name:
phrase
}
=
_
(
'Please type %{phrase_code} to proceed or close this modal to cancel.'
).
html_safe
%
{
phrase_code:
phrase_code
}
.form-group
=
text_field_tag
'confirm_name_input'
,
''
,
class:
'form-control js-legacy-confirm-danger-input qa-confirm-input'
.form-actions
=
submit_tag
_
(
'Confirm'
),
class:
"gl-button btn btn-danger js-legacy-confirm-danger-submit qa-confirm-button"
qa/qa/page/component/confirm_modal.rb
View file @
8e5ec1d2
...
...
@@ -8,12 +8,6 @@ module QA
def
self
.
included
(
base
)
super
base
.
view
'app/views/shared/_confirm_modal.html.haml'
do
element
:confirm_modal
element
:confirm_input
element
:confirm_button
end
end
def
fill_confirmation_text
(
text
)
...
...
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