Commit 827fcc6a authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch '321752-cablett-delete-epic-warning' into 'master'

Clarify epic delete warning

See merge request gitlab-org/gitlab!55574
parents fcdd7a4b 15f0c200
......@@ -45,13 +45,21 @@ export default {
shouldShowDeleteButton() {
return this.canDestroy && this.showDeleteButton;
},
deleteIssuableButtonText() {
return sprintf(__('Delete %{issuableType}'), {
issuableType: issuableTypes[this.issuableType],
});
},
},
methods: {
closeForm() {
eventHub.$emit('close.form');
},
deleteIssuable() {
const confirmMessage = sprintf(__('%{issuableType} will be removed! Are you sure?'), {
const confirmMessage =
this.issuableType === 'epic'
? __('Delete this epic and all descendants?')
: sprintf(__('%{issuableType} will be removed! Are you sure?'), {
issuableType: issuableTypes[this.issuableType],
});
// eslint-disable-next-line no-alert
......@@ -90,7 +98,7 @@ export default {
class="float-right gl-mr-3 qa-delete-button"
@click="deleteIssuable"
>
{{ __('Delete') }}
{{ deleteIssuableButtonText }}
</gl-button>
</div>
</template>
---
title: Clarify epic delete warning
merge_request: 55574
author:
type: changed
......@@ -75,6 +75,9 @@ A modal appears to confirm your action.
Deleting an epic releases all existing issues from their associated epic in the system.
WARNING:
If you delete an epic, all its child epics and their descendants are deleted as well. If needed, you can [remove child epics](#remove-a-child-epic-from-a-parent-epic) from the parent epic before you delete it.
## Close an epic
Whenever you decide that there is no longer need for that epic,
......
......@@ -31,8 +31,8 @@ RSpec.describe 'Delete Epic', :js do
end
it 'deletes the issue and redirect to epic list' do
page.accept_alert 'Epic will be removed! Are you sure?' do
find(:button, text: 'Delete').click
page.accept_alert 'Delete this epic and all descendants?' do
find(:button, text: 'Delete Epic').click
end
wait_for_requests
......
......@@ -9766,6 +9766,9 @@ msgstr ""
msgid "Delete"
msgstr ""
msgid "Delete %{issuableType}"
msgstr ""
msgid "Delete %{name}"
msgstr ""
......@@ -9823,6 +9826,9 @@ msgstr ""
msgid "Delete this attachment"
msgstr ""
msgid "Delete this epic and all descendants?"
msgstr ""
msgid "Delete user list"
msgstr ""
......
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