Commit 15f0c200 authored by charlie ablett's avatar charlie ablett Committed by Vitaly Slobodin

Clarify epic delete warning

- add changelog
- change button text to 'delete epic'
parent df5fcb4e
...@@ -45,15 +45,23 @@ export default { ...@@ -45,15 +45,23 @@ export default {
shouldShowDeleteButton() { shouldShowDeleteButton() {
return this.canDestroy && this.showDeleteButton; return this.canDestroy && this.showDeleteButton;
}, },
deleteIssuableButtonText() {
return sprintf(__('Delete %{issuableType}'), {
issuableType: issuableTypes[this.issuableType],
});
},
}, },
methods: { methods: {
closeForm() { closeForm() {
eventHub.$emit('close.form'); eventHub.$emit('close.form');
}, },
deleteIssuable() { deleteIssuable() {
const confirmMessage = sprintf(__('%{issuableType} will be removed! Are you sure?'), { const confirmMessage =
issuableType: issuableTypes[this.issuableType], 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 // eslint-disable-next-line no-alert
if (window.confirm(confirmMessage)) { if (window.confirm(confirmMessage)) {
this.deleteLoading = true; this.deleteLoading = true;
...@@ -90,7 +98,7 @@ export default { ...@@ -90,7 +98,7 @@ export default {
class="float-right gl-mr-3 qa-delete-button" class="float-right gl-mr-3 qa-delete-button"
@click="deleteIssuable" @click="deleteIssuable"
> >
{{ __('Delete') }} {{ deleteIssuableButtonText }}
</gl-button> </gl-button>
</div> </div>
</template> </template>
---
title: Clarify epic delete warning
merge_request: 55574
author:
type: changed
...@@ -75,6 +75,9 @@ A modal appears to confirm your action. ...@@ -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. 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 ## Close an epic
Whenever you decide that there is no longer need for that epic, Whenever you decide that there is no longer need for that epic,
......
...@@ -31,8 +31,8 @@ RSpec.describe 'Delete Epic', :js do ...@@ -31,8 +31,8 @@ RSpec.describe 'Delete Epic', :js do
end end
it 'deletes the issue and redirect to epic list' do it 'deletes the issue and redirect to epic list' do
page.accept_alert 'Epic will be removed! Are you sure?' do page.accept_alert 'Delete this epic and all descendants?' do
find(:button, text: 'Delete').click find(:button, text: 'Delete Epic').click
end end
wait_for_requests wait_for_requests
......
...@@ -9766,6 +9766,9 @@ msgstr "" ...@@ -9766,6 +9766,9 @@ msgstr ""
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
msgid "Delete %{issuableType}"
msgstr ""
msgid "Delete %{name}" msgid "Delete %{name}"
msgstr "" msgstr ""
...@@ -9823,6 +9826,9 @@ msgstr "" ...@@ -9823,6 +9826,9 @@ msgstr ""
msgid "Delete this attachment" msgid "Delete this attachment"
msgstr "" msgstr ""
msgid "Delete this epic and all descendants?"
msgstr ""
msgid "Delete user list" msgid "Delete user list"
msgstr "" 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