diff options
author | Jarka Košanová <jarka@gitlab.com> | 2018-09-24 22:52:06 +0200 |
---|---|---|
committer | Jarka Košanová <jarka@gitlab.com> | 2018-09-24 22:52:06 +0200 |
commit | 398921b67ca8fefa5045fede67cf9591a0ac361f (patch) | |
tree | 76a31676895e41d704571dc56819403f39742c52 /app/assets/javascripts/issue_show | |
parent | f4c861db6ad1c5373b404902560366a1405523c9 (diff) | |
download | gitlab-ce-398921b67ca8fefa5045fede67cf9591a0ac361f.tar.gz |
Bacport FE changes from Closing Epicsce-7013-add-epics-close-support
Backport of js and vue files from closing epics
Diffstat (limited to 'app/assets/javascripts/issue_show')
3 files changed, 20 insertions, 1 deletions
diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index ad928484952..c6ad3aa3e0d 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -293,6 +293,7 @@ :show-delete-button="showDeleteButton" :can-attach-file="canAttachFile" :enable-autocomplete="enableAutocomplete" + :issuable-type="issuableType" /> <recaptcha-modal diff --git a/app/assets/javascripts/issue_show/components/edit_actions.vue b/app/assets/javascripts/issue_show/components/edit_actions.vue index 597c6d69a81..2d84526518b 100644 --- a/app/assets/javascripts/issue_show/components/edit_actions.vue +++ b/app/assets/javascripts/issue_show/components/edit_actions.vue @@ -1,7 +1,13 @@ <script> + import { __, sprintf } from '~/locale'; import updateMixin from '../mixins/update'; import eventHub from '../event_hub'; + const issuableTypes = { + issue: __('Issue'), + epic: __('Epic'), + }; + export default { mixins: [updateMixin], props: { @@ -18,6 +24,10 @@ required: false, default: true, }, + issuableType: { + type: String, + required: true, + }, }, data() { return { @@ -37,8 +47,11 @@ eventHub.$emit('close.form'); }, deleteIssuable() { + const confirmMessage = sprintf(__('%{issuableType} will be removed! Are you sure?'), { + issuableType: issuableTypes[this.issuableType], + }); // eslint-disable-next-line no-alert - if (window.confirm('Issue will be removed! Are you sure?')) { + if (window.confirm(confirmMessage)) { this.deleteLoading = true; eventHub.$emit('delete.issuable'); diff --git a/app/assets/javascripts/issue_show/components/form.vue b/app/assets/javascripts/issue_show/components/form.vue index e509bb52f7d..03d8d0ec67c 100644 --- a/app/assets/javascripts/issue_show/components/form.vue +++ b/app/assets/javascripts/issue_show/components/form.vue @@ -27,6 +27,10 @@ required: false, default: () => [], }, + issuableType: { + type: String, + required: true, + }, markdownPreviewPath: { type: String, required: true, @@ -110,6 +114,7 @@ :form-state="formState" :can-destroy="canDestroy" :show-delete-button="showDeleteButton" + :issuable-type="issuableType" /> </form> </template> |