diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index be451401e97..7c3f5d00308 100644 --- a/app/assets/javascripts/notes/components/noteable_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -212,16 +212,6 @@ export default { return this.line; }, - commit() { - if (!this.discussion.for_commit) { - return null; - } - - return { - id: this.discussion.commit_id, - url: this.discussion.discussion_path, - }; - }, }, watch: { isReplying() { @@ -387,7 +377,6 @@ Please check your network connection and try again.`; :note="componentData(initialDiscussion)" :line="line" :help-page-path="helpPagePath" - :commit="commit" @handleDeleteNote="deleteNoteHandler" > null, - }, }, data() { return { @@ -80,24 +73,6 @@ export default { isTarget() { return this.targetNoteHash === this.noteAnchorId; }, - actionText() { - if (this.commit) { - const { id, url } = this.commit; - const linkStart = ``; - const linkEnd = ''; - return sprintf( - s__('MergeRequests|commented on commit %{linkStart}%{commitId}%{linkEnd}'), - { - commitId: truncateSha(id), - linkStart, - linkEnd, - }, - false, - ); - } - - return '·'; - }, }, created() { @@ -225,9 +200,13 @@ export default {
- - - + User sees discussions', :js do expect(page).to have_content "started a discussion on commit #{note.commit_id[0...7]}" end end - - context 'a commit non-diff discussion' do - let(:note) { create(:discussion_note_on_commit, project: project) } - - it 'displays correct header' do - expect(page).to have_content "commented on commit #{note.commit_id[0...7]}" - end - end end end diff --git a/spec/helpers/notes_helper_spec.rb b/spec/helpers/notes_helper_spec.rb index 0715f34dafe..21461e46cf4 100644 --- a/spec/helpers/notes_helper_spec.rb +++ b/spec/helpers/notes_helper_spec.rb @@ -185,8 +185,8 @@ describe NotesHelper do context 'for a non-diff discussion' do let(:discussion) { create(:discussion_note_on_commit, project: project).to_discussion } - it 'returns the commit path with the note anchor' do - expect(helper.discussion_path(discussion)).to eq(project_commit_path(project, commit, anchor: "note_#{discussion.first_note.id}")) + it 'returns the commit path' do + expect(helper.discussion_path(discussion)).to eq(project_commit_path(project, commit)) end end end