diff options
author | Phil Hughes <me@iamphill.com> | 2017-06-22 10:50:29 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-06-22 10:50:29 +0000 |
commit | 245be4cee928ec65884177fcbe6f377cc40920da (patch) | |
tree | 3bc10ea37e47bb4919eb7e50ab4b43da4bf56914 | |
parent | 270ca89d9f5c3f5737f372a4f4014a429f5e75ba (diff) | |
parent | 54168362d1a352faf18cca9e0e336ffc413e0261 (diff) | |
download | gitlab-ce-245be4cee928ec65884177fcbe6f377cc40920da.tar.gz |
Merge branch '33904-edit-issue-warning' into 'master'
don't show "Someone edited the issue" warning when saving issue
Closes #33904
See merge request !12371
-rw-r--r-- | app/assets/javascripts/issue_show/components/app.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/issue_show/stores/index.js | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index 8473a81bc88..3d5fb7f441c 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -204,13 +204,7 @@ export default { method: 'getData', successCallback: (res) => { const data = res.json(); - const shouldUpdate = this.store.stateShouldUpdate(data); - this.store.updateState(data); - - if (this.showForm && (shouldUpdate.title || shouldUpdate.description)) { - this.store.formState.lockedWarningVisible = true; - } }, errorCallback(err) { throw new Error(err); diff --git a/app/assets/javascripts/issue_show/stores/index.js b/app/assets/javascripts/issue_show/stores/index.js index f2b822f3cbb..0c8bd6f1cc3 100644 --- a/app/assets/javascripts/issue_show/stores/index.js +++ b/app/assets/javascripts/issue_show/stores/index.js @@ -12,6 +12,10 @@ export default class Store { } updateState(data) { + if (this.stateShouldUpdate(data)) { + this.formState.lockedWarningVisible = true; + } + this.state.titleHtml = data.title; this.state.titleText = data.title_text; this.state.descriptionHtml = data.description; @@ -23,10 +27,8 @@ export default class Store { } stateShouldUpdate(data) { - return { - title: this.state.titleText !== data.title_text, - description: this.state.descriptionText !== data.description_text, - }; + return this.state.titleText !== data.title_text || + this.state.descriptionText !== data.description_text; } setFormState(state) { |