Commit 40b16f19 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 1dbf5b7e 827fcc6a
...@@ -45,13 +45,21 @@ export default { ...@@ -45,13 +45,21 @@ 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 =
this.issuableType === 'epic'
? __('Delete this epic and all descendants?')
: sprintf(__('%{issuableType} will be removed! Are you sure?'), {
issuableType: issuableTypes[this.issuableType], issuableType: issuableTypes[this.issuableType],
}); });
// eslint-disable-next-line no-alert // eslint-disable-next-line no-alert
...@@ -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 ""
......
...@@ -18,13 +18,17 @@ module QA ...@@ -18,13 +18,17 @@ module QA
element :delete_file_button element :delete_file_button
end end
view 'app/assets/javascripts/snippets/components/snippet_visibility_edit.vue' do
element :visibility_content
end
def add_to_file_content(content) def add_to_file_content(content)
text_area.set content text_area.set content
text_area.has_text?(content) # wait for changes to take effect text_area.has_text?(content) # wait for changes to take effect
end end
def change_visibility_to(visibility_type) def change_visibility_to(visibility_type)
choose(visibility_type) click_element(:visibility_content, visibility: visibility_type)
end end
def click_add_file def click_add_file
......
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