Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-10-15 12:07:44 +0300
committerPhil Hughes <me@iamphill.com>2018-10-15 12:07:44 +0300
commit0d3cc8663688c997e910cc7bbb1e4b22057854e8 (patch)
tree840a683836e155d0a5e7f959f2596529fb206968 /app
parenta9827357186e38e5732d8dae23d9d02b1f4c7218 (diff)
parentcbb659cdb340176c4359ab0ee79e9d03782e00e9 (diff)
Merge branch 'ce-7921-fix-batch-comments-resolution' into 'master'
Backport CE changes for: Resolves "Reviews: Resolving or unresolving discussions with “Add comment now” does not work" See merge request gitlab-org/gitlab-ce!22303
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes/components/note_form.vue14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue
index 33998394a69..38c43e5fe08 100644
--- a/app/assets/javascripts/notes/components/note_form.vue
+++ b/app/assets/javascripts/notes/components/note_form.vue
@@ -102,6 +102,18 @@ export default {
},
methods: {
...mapActions(['toggleResolveNote']),
+ shouldToggleResolved(shouldResolve, beforeSubmitDiscussionState) {
+ // shouldBeResolved() checks the actual resolution state,
+ // considering batchComments (EEP), if applicable/enabled.
+ const newResolvedStateAfterUpdate =
+ this.shouldBeResolved && this.shouldBeResolved(shouldResolve);
+
+ const shouldToggleState =
+ newResolvedStateAfterUpdate !== undefined &&
+ beforeSubmitDiscussionState !== newResolvedStateAfterUpdate;
+
+ return shouldResolve || shouldToggleState;
+ },
handleUpdate(shouldResolve) {
const beforeSubmitDiscussionState = this.discussionResolved;
this.isSubmitting = true;
@@ -109,7 +121,7 @@ export default {
this.$emit('handleFormUpdate', this.updatedNoteBody, this.$refs.editNoteForm, () => {
this.isSubmitting = false;
- if (shouldResolve) {
+ if (this.shouldToggleResolved(shouldResolve, beforeSubmitDiscussionState)) {
this.resolveHandler(beforeSubmitDiscussionState);
}
});