diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-02-27 16:11:09 -0600 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-03-01 16:10:04 -0600 |
commit | f42397d19a735de2e5ae38725270614826ec05da (patch) | |
tree | 36286a97975b687eac5dd12f3f9c369125d3189b /app/assets/javascripts/pages/milestones | |
parent | 84e01b3e7a521c66077245a62247bd47a3731ddb (diff) | |
download | gitlab-ce-f42397d19a735de2e5ae38725270614826ec05da.tar.gz |
Add persistent flash messages
Diffstat (limited to 'app/assets/javascripts/pages/milestones')
-rw-r--r-- | app/assets/javascripts/pages/milestones/shared/components/promote_milestone_modal.vue | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/pages/milestones/shared/components/promote_milestone_modal.vue b/app/assets/javascripts/pages/milestones/shared/components/promote_milestone_modal.vue index eb49a5780bd..af85c3915df 100644 --- a/app/assets/javascripts/pages/milestones/shared/components/promote_milestone_modal.vue +++ b/app/assets/javascripts/pages/milestones/shared/components/promote_milestone_modal.vue @@ -1,6 +1,7 @@ <script> import axios from '~/lib/utils/axios_utils'; import createFlash from '~/flash'; + import { saveFlashMessage } from '~/lib/utils/flash_queue'; import GlModal from '~/vue_shared/components/gl_modal.vue'; import { redirectTo } from '~/lib/utils/url_utility'; import { s__, sprintf } from '~/locale'; @@ -36,7 +37,10 @@ return axios.post(this.url) .then((response) => { eventHub.$emit('promoteMilestoneModal.requestFinished', { milestoneUrl: this.url, successful: true }); - redirectTo(response.request.responseURL); + const responseURL = new URL(response.request.responseURL); + const bodyData = responseURL.searchParams.get('body_data'); + saveFlashMessage(bodyData, `${this.milestoneTitle} promoted to group milestone`, 'notice'); + redirectTo(`${responseURL.protocol}//${responseURL.host}${responseURL.pathname}`); }) .catch((error) => { eventHub.$emit('promoteMilestoneModal.requestFinished', { milestoneUrl: this.url, successful: false }); |