diff options
author | Jose <jvargas@gitlab.com> | 2018-05-11 14:00:20 -0500 |
---|---|---|
committer | Jose <jvargas@gitlab.com> | 2018-05-11 15:03:13 -0500 |
commit | 8a35e6aef927b220d0afb2edf278f3dd5a7aa9e9 (patch) | |
tree | b73a0f5fee567efdbe79fa0628e04b1357e357de | |
parent | 87b7314552259b7a2a9f3e69e74b08d3c0c8b77a (diff) | |
download | gitlab-ce-jivl-fix-locked-state.tar.gz |
Fix locked state not showing upjivl-fix-locked-state
-rw-r--r-- | app/assets/javascripts/notes/components/comment_form.vue | 7 | ||||
-rw-r--r-- | app/serializers/merge_request_widget_entity.rb | 3 | ||||
-rw-r--r-- | spec/features/merge_request/user_locks_discussion_spec.rb | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue index e0fdc0f1c22..775b16dda79 100644 --- a/app/assets/javascripts/notes/components/comment_form.vue +++ b/app/assets/javascripts/notes/components/comment_form.vue @@ -120,6 +120,9 @@ export default { endpoint() { return this.getNoteableData.create_note_path; }, + issuableTypeTitle() { + return this.noteableType === constants.MERGE_REQUEST_NOTEABLE_TYPE ? 'merge request' : 'issue'; + }, }, watch: { note(newNote) { @@ -308,8 +311,8 @@ Please check your network connection and try again.`; <div> <note-signed-out-widget v-if="!isLoggedIn" /> <discussion-locked-widget - issuable-type="issue" - v-else-if="isLocked(getNoteableData) && !canCreateNote" + :issuable-type="issuableTypeTitle" + v-else-if="!canCreateNote" /> <ul v-else-if="canCreateNote" diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb index b4e1af53fd8..2b83447c9a2 100644 --- a/app/serializers/merge_request_widget_entity.rb +++ b/app/serializers/merge_request_widget_entity.rb @@ -119,7 +119,8 @@ class MergeRequestWidgetEntity < IssuableEntity end expose :can_create_note do |issue| - can?(request.current_user, :create_note, issue.project) + #TODO correct issue to merge_request where applicable + can?(request.current_user, :create_note, issue) end expose :can_update do |issue| diff --git a/spec/features/merge_request/user_locks_discussion_spec.rb b/spec/features/merge_request/user_locks_discussion_spec.rb index a68df872334..76c759ab8d3 100644 --- a/spec/features/merge_request/user_locks_discussion_spec.rb +++ b/spec/features/merge_request/user_locks_discussion_spec.rb @@ -38,9 +38,9 @@ describe 'Merge request > User locks discussion', :js do end it 'the user can not create a comment' do - page.within('.issuable-discussion #notes') do + page.within('.js-vue-notes-event') do expect(page).not_to have_selector('js-main-target-form') - expect(page.find('.disabled-comment')) + expect(page.find('.issuable-note-warning')) .to have_content('This merge request is locked. Only project members can comment.') end end |