summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorSamantha Ming <sming@gitlab.com>2019-09-12 07:41:19 +0000
committerKushal Pandya <kushalspandya@gmail.com>2019-09-12 07:41:19 +0000
commit589c8d5625f64edf4dfaf9ddf1f9f4b2fe7efb32 (patch)
tree45bf0e41e0b754f378b654b59820f23702e8df56 /app/assets
parent42b8e6838e8d63dcad7641a6164d178e9e09262a (diff)
downloadgitlab-ce-589c8d5625f64edf4dfaf9ddf1f9f4b2fe7efb32.tar.gz
Hide resolve thread button from guest
- Show if user can_resolve all of the notes
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/notes/components/discussion_actions.vue9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes/components/discussion_actions.vue b/app/assets/javascripts/notes/components/discussion_actions.vue
index edab750b572..e3be91a4966 100644
--- a/app/assets/javascripts/notes/components/discussion_actions.vue
+++ b/app/assets/javascripts/notes/components/discussion_actions.vue
@@ -35,6 +35,13 @@ export default {
required: true,
},
},
+ computed: {
+ userCanResolveDiscussion() {
+ return this.discussion.notes.every(
+ note => note.current_user && note.current_user.can_resolve,
+ );
+ },
+ },
};
</script>
@@ -46,7 +53,7 @@ export default {
@onClick="$emit('showReplyForm')"
/>
- <div class="btn-group discussion-actions" role="group">
+ <div v-if="userCanResolveDiscussion" class="btn-group discussion-actions" role="group">
<div class="btn-group">
<resolve-discussion-button
v-if="discussion.resolvable"