diff options
author | Fatih Acet <acetfatih@gmail.com> | 2019-02-07 00:18:07 +0100 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2019-02-07 09:28:35 -0600 |
commit | 8bf5e4795db1915552c1b999ee0c4a9c00466526 (patch) | |
tree | d44c8078f3fd20d584041793cb6d5f4230aef293 /app | |
parent | 79bd1b8717599205fd1bf4f79048d3065b500536 (diff) | |
download | gitlab-ce-8bf5e4795db1915552c1b999ee0c4a9c00466526.tar.gz |
Add fast tasklist support to MR tasklist
Also adds specs and fixes existing specs
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/issue_show/components/description.vue | 14 | ||||
-rw-r--r-- | app/assets/javascripts/merge_request.js | 8 |
2 files changed, 18 insertions, 4 deletions
diff --git a/app/assets/javascripts/issue_show/components/description.vue b/app/assets/javascripts/issue_show/components/description.vue index e664269b199..58f14bac8c8 100644 --- a/app/assets/javascripts/issue_show/components/description.vue +++ b/app/assets/javascripts/issue_show/components/description.vue @@ -1,6 +1,7 @@ <script> import $ from 'jquery'; -import { __ } from '~/locale'; +import { s__, sprintf } from '~/locale'; +import createFlash from '~/flash'; import animateMixin from '../mixins/animate'; import TaskList from '../../task_list'; import recaptchaModalImplementor from '../../vue_shared/mixins/recaptcha_modal_implementor'; @@ -91,9 +92,14 @@ export default { }, taskListUpdateError() { - window.Flash( - __( - 'Someone edited this issue at the same time you did. The description has been updated and you will need to make your changes again.', + createFlash( + sprintf( + s__( + 'Someone edited this %{issueType} at the same time you did. The description has been updated and you will need to make your changes again.', + ), + { + issueType: this.issuableType, + }, ), ); diff --git a/app/assets/javascripts/merge_request.js b/app/assets/javascripts/merge_request.js index ac3b47cd218..3b42a154af8 100644 --- a/app/assets/javascripts/merge_request.js +++ b/app/assets/javascripts/merge_request.js @@ -2,6 +2,7 @@ import $ from 'jquery'; import { __ } from '~/locale'; +import createFlash from '~/flash'; import TaskList from './task_list'; import MergeRequestTabs from './merge_request_tabs'; import IssuablesHelper from './helpers/issuables_helper'; @@ -40,6 +41,13 @@ function MergeRequest(opts) { document.querySelector('#task_status').innerText = result.task_status; document.querySelector('#task_status_short').innerText = result.task_status_short; }, + onError: () => { + createFlash( + __( + 'Someone edited this merge request at the same time you did. Please refresh the page to see changes.', + ), + ); + }, }); } } |