diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-09-07 18:14:21 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-09-26 09:42:33 +0300 |
commit | 360c1470573a34ed47b6bf594339b122900ea6d9 (patch) | |
tree | cfba93dafdbbc1c9e613b11b0c972408e6752066 /app/assets/javascripts/notes | |
parent | 142bbd900b791478b2ad473efc8e0f78a7afe00d (diff) |
Disable comment form when discussion locked for user
Diffstat (limited to 'app/assets/javascripts/notes')
-rw-r--r-- | app/assets/javascripts/notes/components/issue_comment_form.vue | 3 | ||||
-rw-r--r-- | app/assets/javascripts/notes/components/issue_discussion_locked_widget.vue | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes/components/issue_comment_form.vue b/app/assets/javascripts/notes/components/issue_comment_form.vue index 1b27e74eeb6..afd58b7ceb7 100644 --- a/app/assets/javascripts/notes/components/issue_comment_form.vue +++ b/app/assets/javascripts/notes/components/issue_comment_form.vue @@ -9,6 +9,7 @@ import eventHub from '../event_hub'; import issueWarning from '../../vue_shared/components/issue/issue_warning.vue'; import issueNoteSignedOutWidget from './issue_note_signed_out_widget.vue'; + import issueDiscussionLockedWidget from './issue_discussion_locked_widget.vue'; import markdownField from '../../vue_shared/components/markdown/field.vue'; import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import issuableStateMixin from '../mixins/issuable_state'; @@ -29,6 +30,7 @@ components: { issueWarning, issueNoteSignedOutWidget, + issueDiscussionLockedWidget, markdownField, userAvatarLink, }, @@ -239,6 +241,7 @@ <template> <div> <issue-note-signed-out-widget v-if="!isLoggedIn" /> + <issue-discussion-locked-widget v-else-if="!canCreate" /> <ul v-else class="notes notes-form timeline"> diff --git a/app/assets/javascripts/notes/components/issue_discussion_locked_widget.vue b/app/assets/javascripts/notes/components/issue_discussion_locked_widget.vue new file mode 100644 index 00000000000..7169117421b --- /dev/null +++ b/app/assets/javascripts/notes/components/issue_discussion_locked_widget.vue @@ -0,0 +1,16 @@ +<script> + import { mapGetters } from 'vuex'; + + export default { + name: 'discussionLockedWidget', + }; + +</script> + +<template> + <div class="disabled-comment text-center"> + <span class="issuable-note-warning"> + This issue is locked. Only <b>project members</b> can comment. + </span> + </div> +</template> |