Commit 9e608ed0 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ee-issue/55953' into 'master'

Backport from CE (issue #55953)

See merge request gitlab-org/gitlab-ee!14162
parents 5eabb74a fbdb819d
...@@ -32,15 +32,15 @@ const CommentAndResolveBtn = Vue.extend({ ...@@ -32,15 +32,15 @@ const CommentAndResolveBtn = Vue.extend({
buttonText: function() { buttonText: function() {
if (this.isDiscussionResolved) { if (this.isDiscussionResolved) {
if (this.textareaIsEmpty) { if (this.textareaIsEmpty) {
return __('Unresolve discussion'); return __('Unresolve thread');
} else { } else {
return __('Comment & unresolve discussion'); return __('Comment & unresolve thread');
} }
} else { } else {
if (this.textareaIsEmpty) { if (this.textareaIsEmpty) {
return __('Resolve discussion'); return __('Resolve thread');
} else { } else {
return __('Comment & resolve discussion'); return __('Comment & resolve thread');
} }
} }
}, },
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
return this.getUserData.id; return this.getUserData.id;
}, },
commentButtonTitle() { commentButtonTitle() {
return this.noteType === constants.COMMENT ? 'Comment' : 'Start discussion'; return this.noteType === constants.COMMENT ? 'Comment' : 'Start thread';
}, },
startDiscussionDescription() { startDiscussionDescription() {
let text = 'Discuss a specific suggestion or question'; let text = 'Discuss a specific suggestion or question';
...@@ -418,7 +418,7 @@ append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown" ...@@ -418,7 +418,7 @@ append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown"
> >
<i aria-hidden="true" class="fa fa-check icon"> </i> <i aria-hidden="true" class="fa fa-check icon"> </i>
<div class="description"> <div class="description">
<strong>Start discussion</strong> <strong>Start thread</strong>
<p>{{ startDiscussionDescription }}</p> <p>{{ startDiscussionDescription }}</p>
</div> </div>
</button> </button>
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
</span> </span>
<span class="line-resolve-text"> <span class="line-resolve-text">
{{ resolvedDiscussionsCount }}/{{ resolvableDiscussionsCount }} {{ resolvedDiscussionsCount }}/{{ resolvableDiscussionsCount }}
{{ n__('discussion resolved', 'discussions resolved', resolvableDiscussionsCount) }} {{ n__('thread resolved', 'threads resolved', resolvableDiscussionsCount) }}
</span> </span>
</div> </div>
<div <div
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
<a <a
v-gl-tooltip v-gl-tooltip
:href="resolveAllDiscussionsIssuePath" :href="resolveAllDiscussionsIssuePath"
:title="s__('Resolve all discussions in new issue')" :title="s__('Resolve all threads in new issue')"
class="new-issue-for-discussion btn btn-default discussion-create-issue-btn" class="new-issue-for-discussion btn btn-default discussion-create-issue-btn"
> >
<icon name="issue-new" /> <icon name="issue-new" />
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
<div v-if="isLoggedIn && !allResolved" class="btn-group btn-group-sm" role="group"> <div v-if="isLoggedIn && !allResolved" class="btn-group btn-group-sm" role="group">
<button <button
v-gl-tooltip v-gl-tooltip
title="Jump to first unresolved discussion" title="Jump to first unresolved thread"
class="btn btn-default discussion-next-btn" class="btn btn-default discussion-next-btn"
@click="jumpToFirstUnresolvedDiscussion" @click="jumpToFirstUnresolvedDiscussion"
> >
......
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
<gl-button <gl-button
v-gl-tooltip v-gl-tooltip
:href="url" :href="url"
:title="s__('MergeRequests|Resolve this discussion in a new issue')" :title="s__('MergeRequests|Resolve this thread in a new issue')"
class="new-issue-for-discussion discussion-create-issue-btn" class="new-issue-for-discussion discussion-create-issue-btn"
> >
<icon name="issue-new" /> <icon name="issue-new" />
......
...@@ -283,11 +283,11 @@ export default { ...@@ -283,11 +283,11 @@ export default {
type="checkbox" type="checkbox"
class="qa-unresolve-review-discussion" class="qa-unresolve-review-discussion"
/> />
{{ __('Unresolve discussion') }} {{ __('Unresolve thread') }}
</template> </template>
<template v-else> <template v-else>
<input v-model="isResolving" type="checkbox" class="qa-resolve-review-discussion" /> <input v-model="isResolving" type="checkbox" class="qa-resolve-review-discussion" />
{{ __('Resolve discussion') }} {{ __('Resolve thread') }}
</template> </template>
</label> </label>
</p> </p>
......
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
@click="handleToggle" @click="handleToggle"
> >
<i :class="toggleChevronClass" class="fa" aria-hidden="true"></i> <i :class="toggleChevronClass" class="fa" aria-hidden="true"></i>
{{ __('Toggle discussion') }} {{ __('Toggle thread') }}
</button> </button>
</div> </div>
<a <a
......
...@@ -174,22 +174,20 @@ export default { ...@@ -174,22 +174,20 @@ export default {
active: isActive, active: isActive,
} = this.discussion; } = this.discussion;
let text = s__('MergeRequests|started a discussion'); let text = s__('MergeRequests|started a thread');
if (isForCommit) { if (isForCommit) {
text = s__( text = s__('MergeRequests|started a thread on commit %{linkStart}%{commitId}%{linkEnd}');
'MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}',
);
} else if (isDiffDiscussion && commitId) { } else if (isDiffDiscussion && commitId) {
text = isActive text = isActive
? s__('MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}') ? s__('MergeRequests|started a thread on commit %{linkStart}%{commitId}%{linkEnd}')
: s__( : s__(
'MergeRequests|started a discussion on an outdated change in commit %{linkStart}%{commitId}%{linkEnd}', 'MergeRequests|started a thread on an outdated change in commit %{linkStart}%{commitId}%{linkEnd}',
); );
} else if (isDiffDiscussion) { } else if (isDiffDiscussion) {
text = isActive text = isActive
? s__('MergeRequests|started a discussion on %{linkStart}the diff%{linkEnd}') ? s__('MergeRequests|started a thread on %{linkStart}the diff%{linkEnd}')
: s__( : s__(
'MergeRequests|started a discussion on %{linkStart}an old version of the diff%{linkEnd}', 'MergeRequests|started a thread on %{linkStart}an old version of the diff%{linkEnd}',
); );
} }
......
...@@ -20,13 +20,13 @@ export default { ...@@ -20,13 +20,13 @@ export default {
resolveButtonTitle() { resolveButtonTitle() {
if (this.updatedNoteBody) { if (this.updatedNoteBody) {
if (this.discussionResolved) { if (this.discussionResolved) {
return __('Comment & unresolve discussion'); return __('Comment & unresolve thread');
} }
return __('Comment & resolve discussion'); return __('Comment & resolve thread');
} }
return this.discussionResolved ? __('Unresolve discussion') : __('Resolve discussion'); return this.discussionResolved ? __('Unresolve thread') : __('Resolve thread');
}, },
}, },
methods: { methods: {
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
<status-icon :show-disabled-button="true" status="warning" /> <status-icon :show-disabled-button="true" status="warning" />
<div class="media-body space-children"> <div class="media-body space-children">
<span class="bold"> <span class="bold">
{{ s__('mrWidget|There are unresolved discussions. Please resolve these discussions') }} {{ s__('mrWidget|There are unresolved threads. Please resolve these threads') }}
</span> </span>
<a <a
v-if="mr.createIssueToResolveDiscussionsPath" v-if="mr.createIssueToResolveDiscussionsPath"
......
...@@ -249,7 +249,7 @@ module SystemNoteService ...@@ -249,7 +249,7 @@ module SystemNoteService
end end
def resolve_all_discussions(merge_request, project, author) def resolve_all_discussions(merge_request, project, author)
body = "resolved all discussions" body = "resolved all threads"
create_note(NoteSummary.new(merge_request, project, author, body, action: 'discussion')) create_note(NoteSummary.new(merge_request, project, author, body, action: 'discussion'))
end end
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
= icon("chevron-up") = icon("chevron-up")
- else - else
= icon("chevron-down") = icon("chevron-down")
= _('Toggle discussion') = _('Toggle thread')
= link_to_member(@project, discussion.author, avatar: false) = link_to_member(@project, discussion.author, avatar: false)
.inline.discussion-headline-light .inline.discussion-headline-light
= discussion.author.to_reference = discussion.author.to_reference
started a discussion started a thread
- url = discussion_path(discussion) - url = discussion_path(discussion)
- if discussion.for_commit? && @noteable != discussion.noteable - if discussion.for_commit? && @noteable != discussion.noteable
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
.btn-group{ role: "group", "v-if" => "showButton" } .btn-group{ role: "group", "v-if" => "showButton" }
= link_to custom_icon('icon_mr_issue'), = link_to custom_icon('icon_mr_issue'),
new_project_issue_path(@project, merge_request_to_resolve_discussions_of: merge_request.iid, discussion_to_resolve: discussion.id), new_project_issue_path(@project, merge_request_to_resolve_discussions_of: merge_request.iid, discussion_to_resolve: discussion.id),
title: 'Resolve this discussion in a new issue', title: 'Resolve this thread in a new issue',
aria: { label: 'Resolve this discussion in a new issue' }, aria: { label: 'Resolve this thread in a new issue' },
data: { container: 'body' }, data: { container: 'body' },
class: 'new-issue-for-discussion btn btn-default discussion-create-issue-btn has-tooltip' class: 'new-issue-for-discussion btn btn-default discussion-create-issue-btn has-tooltip'
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
= hidden_field_tag 'merge_request_to_resolve_discussions_of', @merge_request_to_resolve_discussions_of.iid = hidden_field_tag 'merge_request_to_resolve_discussions_of', @merge_request_to_resolve_discussions_of.iid
- if @discussion_to_resolve - if @discussion_to_resolve
= hidden_field_tag 'discussion_to_resolve', @discussion_to_resolve.id = hidden_field_tag 'discussion_to_resolve', @discussion_to_resolve.id
Creating this issue will resolve the discussion in Creating this issue will resolve the thread in
- else - else
Creating this issue will resolve all discussions in Creating this issue will resolve all threads in
= link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve) = link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve)
- else - else
The The
= @discussion_to_resolve ? 'discussion' : 'discussions' = @discussion_to_resolve ? 'thread' : 'threads'
at at
= link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve) = link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve)
will stay unresolved. Ask someone with permission to resolve will stay unresolved. Ask someone with permission to resolve
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
%li.divider.droplab-item-ignore %li.divider.droplab-item-ignore
%li#discussion{ data: { value: 'DiscussionNote', 'submit-text' => _('Start discussion'), 'close-text' => _("Start discussion & close %{noteable_name}") % { noteable_name: noteable_name }, 'reopen-text' => _("Start discussion & reopen %{noteable_name}") % { noteable_name: noteable_name } } } %li#discussion{ data: { value: 'DiscussionNote', 'submit-text' => _('Start thread'), 'close-text' => _("Start thread & close %{noteable_name}") % { noteable_name: noteable_name }, 'reopen-text' => _("Start thread & reopen %{noteable_name}") % { noteable_name: noteable_name } } }
%button.btn.btn-transparent %button.btn.btn-transparent
= icon('check', class: 'icon') = icon('check', class: 'icon')
.description .description
%strong= _("Start discussion") %strong= _("Start thread")
%p %p
= succeed '.' do = succeed '.' do
- if @note.noteable.supports_resolvable_notes? - if @note.noteable.supports_resolvable_notes?
......
---
title: "renamed discussion to thread in merge-request and issue timeline"
merge_request: 29553
author: Michel Engelen
type: changed
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
return file.file_path; return file.file_path;
} }
return sprintf(__("%{authorsName}'s discussion"), { return sprintf(__("%{authorsName}'s thread"), {
authorsName: this.discussion.notes.find(note => !note.system).author.name, authorsName: this.discussion.notes.find(note => !note.system).author.name,
}); });
}, },
......
...@@ -36,14 +36,14 @@ export default { ...@@ -36,14 +36,14 @@ export default {
if (discussionToBeResolved) { if (discussionToBeResolved) {
if (discussionResolved) { if (discussionResolved) {
message = s__('MergeRequests|Discussion stays resolved'); message = s__('MergeRequests|Thread stays resolved');
} else { } else {
message = s__('MergeRequests|Discussion will be resolved'); message = s__('MergeRequests|Thread will be resolved');
} }
} else if (discussionResolved) { } else if (discussionResolved) {
message = s__('MergeRequests|Discussion will be unresolved'); message = s__('MergeRequests|Thread will be unresolved');
} else if (this.$options.showStaysResolved) { } else if (this.$options.showStaysResolved) {
message = s__('MergeRequests|Discussion stays unresolved'); message = s__('MergeRequests|Thread stays unresolved');
} }
return message; return message;
......
...@@ -21,7 +21,7 @@ export const addDraftToDiscussion = ({ commit }, { endpoint, data }) => ...@@ -21,7 +21,7 @@ export const addDraftToDiscussion = ({ commit }, { endpoint, data }) =>
return res; return res;
}) })
.catch(() => { .catch(() => {
flash(__('An error occurred adding a draft to the discussion.')); flash(__('An error occurred adding a draft to the thread.'));
}); });
export const createNewDraft = ({ commit }, { endpoint, data }) => export const createNewDraft = ({ commit }, { endpoint, data }) =>
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
return resolveStatus; return resolveStatus;
}, },
handleAddToReview() { handleAddToReview() {
// check if draft should resolve discussion // check if draft should resolve thread
const shouldResolve = const shouldResolve =
(this.discussionResolved && !this.isUnresolving) || (this.discussionResolved && !this.isUnresolving) ||
(!this.discussionResolved && this.isResolving); (!this.discussionResolved && this.isResolving);
......
...@@ -12,14 +12,14 @@ module DraftNotes ...@@ -12,14 +12,14 @@ module DraftNotes
def execute def execute
if in_reply_to_discussion_id.present? if in_reply_to_discussion_id.present?
unless discussion unless discussion
return base_error('Discussion to reply to cannot be found') return base_error('Thread to reply to cannot be found')
end end
params[:discussion_id] = discussion.reply_id params[:discussion_id] = discussion.reply_id
end end
if params[:resolve_discussion] && !can_resolve_discussion? if params[:resolve_discussion] && !can_resolve_discussion?
return base_error('User is not allowed to resolve discussion') return base_error('User is not allowed to resolve thread')
end end
draft_note = DraftNote.new(params) draft_note = DraftNote.new(params)
......
...@@ -90,7 +90,7 @@ describe Projects::MergeRequests::DraftsController do ...@@ -90,7 +90,7 @@ describe Projects::MergeRequests::DraftsController do
expect(json_response['references']['users']).to include(user2.username) expect(json_response['references']['users']).to include(user2.username)
end end
context 'in a discussion' do context 'in a thread' do
let(:discussion) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project).discussion } let(:discussion) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project).discussion }
it 'creates draft note as a reply' do it 'creates draft note as a reply' do
...@@ -104,7 +104,7 @@ describe Projects::MergeRequests::DraftsController do ...@@ -104,7 +104,7 @@ describe Projects::MergeRequests::DraftsController do
expect(draft_note.discussion_id).to eq(discussion.reply_id) expect(draft_note.discussion_id).to eq(discussion.reply_id)
end end
it 'creates a draft note that will resolve a discussion' do it 'creates a draft note that will resolve a thread' do
expect do expect do
create_draft_note( create_draft_note(
overrides: { in_reply_to_discussion_id: discussion.reply_id }, overrides: { in_reply_to_discussion_id: discussion.reply_id },
...@@ -119,7 +119,7 @@ describe Projects::MergeRequests::DraftsController do ...@@ -119,7 +119,7 @@ describe Projects::MergeRequests::DraftsController do
expect(draft_note.resolve_discussion).to eq(true) expect(draft_note.resolve_discussion).to eq(true)
end end
it 'cannot create more than one draft note per discussion' do it 'cannot create more than one draft note per thread' do
expect do expect do
create_draft_note( create_draft_note(
overrides: { in_reply_to_discussion_id: discussion.reply_id }, overrides: { in_reply_to_discussion_id: discussion.reply_id },
...@@ -283,7 +283,7 @@ describe Projects::MergeRequests::DraftsController do ...@@ -283,7 +283,7 @@ describe Projects::MergeRequests::DraftsController do
.and change { DraftNote.count }.by(-1) .and change { DraftNote.count }.by(-1)
end end
context 'when publishing drafts in a discussion' do context 'when publishing drafts in a thread' do
let(:note) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project) } let(:note) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project) }
def create_reply(discussion_id, resolves: false) def create_reply(discussion_id, resolves: false)
...@@ -295,7 +295,7 @@ describe Projects::MergeRequests::DraftsController do ...@@ -295,7 +295,7 @@ describe Projects::MergeRequests::DraftsController do
) )
end end
it 'resolves a discussion if the draft note resolves it' do it 'resolves a thread if the draft note resolves it' do
draft_reply = create_reply(note.discussion_id, resolves: true) draft_reply = create_reply(note.discussion_id, resolves: true)
post :publish, params: params post :publish, params: params
...@@ -307,7 +307,7 @@ describe Projects::MergeRequests::DraftsController do ...@@ -307,7 +307,7 @@ describe Projects::MergeRequests::DraftsController do
expect(discussion.resolved_by.id).to eq(user.id) expect(discussion.resolved_by.id).to eq(user.id)
end end
it 'unresolves a discussion if the draft note unresolves it' do it 'unresolves a thread if the draft note unresolves it' do
note.discussion.resolve!(user) note.discussion.resolve!(user)
expect(note.discussion.resolved?).to eq(true) expect(note.discussion.resolved?).to eq(true)
......
require 'spec_helper' require 'spec_helper'
describe 'Discussion Comments Epic', :js do describe 'Thread Comments Epic', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:epic) { create(:epic) } let(:epic) { create(:epic) }
...@@ -12,5 +12,5 @@ describe 'Discussion Comments Epic', :js do ...@@ -12,5 +12,5 @@ describe 'Discussion Comments Epic', :js do
visit group_epic_path(epic.group, epic) visit group_epic_path(epic.group, epic)
end end
it_behaves_like 'discussion comments', 'epic' it_behaves_like 'thread comments', 'epic'
end end
...@@ -54,7 +54,7 @@ describe 'Epic show', :js do ...@@ -54,7 +54,7 @@ describe 'Epic show', :js do
end end
end end
it 'shows epic discussion filter dropdown' do it 'shows epic thread filter dropdown' do
page.within('.js-epic-tabs-container') do page.within('.js-epic-tabs-container') do
expect(find('.js-discussion-filter-container #discussion-filter-dropdown')).to have_content('Show all activity') expect(find('.js-discussion-filter-container #discussion-filter-dropdown')).to have_content('Show all activity')
end end
...@@ -97,7 +97,7 @@ describe 'Epic show', :js do ...@@ -97,7 +97,7 @@ describe 'Epic show', :js do
end end
end end
it 'does not show discussion filter dropdown' do it 'does not show thread filter dropdown' do
expect(find('.js-epic-tabs-container')).to have_selector('.js-discussion-filter-container', visible: false) expect(find('.js-epic-tabs-container')).to have_selector('.js-discussion-filter-container', visible: false)
end end
......
...@@ -137,25 +137,25 @@ describe 'Merge request > Batch comments', :js do ...@@ -137,25 +137,25 @@ describe 'Merge request > Batch comments', :js do
end end
end end
context 'discussion is unresolved' do context 'thread is unresolved' do
let!(:active_discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } let!(:active_discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion }
before do before do
visit_diffs visit_diffs
end end
it 'publishes comment right away and resolves the discussion' do it 'publishes comment right away and resolves the thread' do
expect(active_discussion.resolved?).to eq(false) expect(active_discussion.resolved?).to eq(false)
write_reply_to_discussion(button_text: 'Add comment now', resolve: true) write_reply_to_discussion(button_text: 'Add comment now', resolve: true)
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
expect(page).to have_content('1/1 discussion resolved') expect(page).to have_content('1/1 thread resolved')
expect(page).to have_selector('.line-resolve-btn.is-active') expect(page).to have_selector('.line-resolve-btn.is-active')
end end
end end
it 'publishes review and resolves the discussion' do it 'publishes review and resolves the thread' do
expect(active_discussion.resolved?).to eq(false) expect(active_discussion.resolved?).to eq(false)
write_reply_to_discussion(resolve: true) write_reply_to_discussion(resolve: true)
...@@ -168,7 +168,7 @@ describe 'Merge request > Batch comments', :js do ...@@ -168,7 +168,7 @@ describe 'Merge request > Batch comments', :js do
wait_for_requests wait_for_requests
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
expect(page).to have_content('1/1 discussion resolved') expect(page).to have_content('1/1 thread resolved')
expect(page).to have_selector('.line-resolve-btn.is-active') expect(page).to have_selector('.line-resolve-btn.is-active')
end end
...@@ -176,7 +176,7 @@ describe 'Merge request > Batch comments', :js do ...@@ -176,7 +176,7 @@ describe 'Merge request > Batch comments', :js do
end end
end end
context 'discussion is resolved' do context 'thread is resolved' do
let!(:active_discussion) { create(:diff_note_on_merge_request, :resolved, noteable: merge_request, project: project).to_discussion } let!(:active_discussion) { create(:diff_note_on_merge_request, :resolved, noteable: merge_request, project: project).to_discussion }
before do before do
...@@ -187,18 +187,18 @@ describe 'Merge request > Batch comments', :js do ...@@ -187,18 +187,18 @@ describe 'Merge request > Batch comments', :js do
page.find('.js-diff-comment-avatar').click page.find('.js-diff-comment-avatar').click
end end
it 'publishes comment right away and unresolves the discussion' do it 'publishes comment right away and unresolves the thread' do
expect(active_discussion.resolved?).to eq(true) expect(active_discussion.resolved?).to eq(true)
write_reply_to_discussion(button_text: 'Add comment now', unresolve: true) write_reply_to_discussion(button_text: 'Add comment now', unresolve: true)
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
expect(page).to have_content('0/1 discussion resolved') expect(page).to have_content('0/1 thread resolved')
expect(page).to have_selector('.line-resolve-btn.is-disabled') expect(page).to have_selector('.line-resolve-btn.is-disabled')
end end
end end
it 'publishes review and unresolves the discussion' do it 'publishes review and unresolves the thread' do
expect(active_discussion.resolved?).to eq(true) expect(active_discussion.resolved?).to eq(true)
wait_for_requests wait_for_requests
...@@ -213,7 +213,7 @@ describe 'Merge request > Batch comments', :js do ...@@ -213,7 +213,7 @@ describe 'Merge request > Batch comments', :js do
wait_for_requests wait_for_requests
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
expect(page).to have_content('0/1 discussion resolved') expect(page).to have_content('0/1 thread resolved')
expect(page).to have_selector('.line-resolve-btn.is-disabled') expect(page).to have_selector('.line-resolve-btn.is-disabled')
end end
...@@ -259,11 +259,11 @@ def write_reply_to_discussion(button_text: 'Start a review', text: 'Line is wron ...@@ -259,11 +259,11 @@ def write_reply_to_discussion(button_text: 'Start a review', text: 'Line is wron
fill_in('note_note', with: text) fill_in('note_note', with: text)
if resolve if resolve
page.check('Resolve discussion') page.check('Resolve thread')
end end
if unresolve if unresolve
page.check('Unresolve discussion') page.check('Unresolve thread')
end end
click_button(button_text) click_button(button_text)
......
...@@ -80,7 +80,7 @@ xdescribe 'Merge request > User approves', :js do ...@@ -80,7 +80,7 @@ xdescribe 'Merge request > User approves', :js do
end end
end end
context 'when merge when discussions resolved is active' do context 'when merge when threads resolved is active' do
let(:project) do let(:project) do
create(:project, :repository, create(:project, :repository,
approvals_before_merge: 1, approvals_before_merge: 1,
......
...@@ -9,7 +9,7 @@ describe 'Merge request > User sees approval widget', :js do ...@@ -9,7 +9,7 @@ describe 'Merge request > User sees approval widget', :js do
sign_in(user) sign_in(user)
end end
context 'when merge when discussions resolved is active' do context 'when merge when threads resolved is active' do
let(:project) do let(:project) do
create(:project, :repository, create(:project, :repository,
approvals_before_merge: 1, approvals_before_merge: 1,
......
...@@ -99,7 +99,7 @@ describe('Batch comments draft preview item component', () => { ...@@ -99,7 +99,7 @@ describe('Batch comments draft preview item component', () => {
}); });
}); });
describe('for discussion', () => { describe('for thread', () => {
beforeEach(() => { beforeEach(() => {
createComponent(false, { discussion_id: '1', resolve_discussion: true }, store => { createComponent(false, { discussion_id: '1', resolve_discussion: true }, store => {
store.state.notes.discussions.push({ store.state.notes.discussions.push({
...@@ -117,13 +117,13 @@ describe('Batch comments draft preview item component', () => { ...@@ -117,13 +117,13 @@ describe('Batch comments draft preview item component', () => {
it('renders title', () => { it('renders title', () => {
expect(vm.$el.querySelector('.review-preview-item-header-text').textContent).toContain( expect(vm.$el.querySelector('.review-preview-item-header-text').textContent).toContain(
"Author Name's discussion", "Author Name's thread",
); );
}); });
it('it renders discussion resolved text', () => { it('it renders thread resolved text', () => {
expect(vm.$el.querySelector('.draft-note-resolution').textContent).toContain( expect(vm.$el.querySelector('.draft-note-resolution').textContent).toContain(
'Discussion will be resolved', 'Thread will be resolved',
); );
}); });
}); });
......
...@@ -52,9 +52,7 @@ describe('noteActions', () => { ...@@ -52,9 +52,7 @@ describe('noteActions', () => {
const resolveButton = wrapper.find({ ref: 'resolveButton' }); const resolveButton = wrapper.find({ ref: 'resolveButton' });
expect(resolveButton.exists()).toBe(true); expect(resolveButton.exists()).toBe(true);
expect(resolveButton.attributes('data-original-title')).toEqual( expect(resolveButton.attributes('data-original-title')).toEqual('Thread stays unresolved');
'Discussion stays unresolved',
);
}); });
}); });
}); });
...@@ -23,11 +23,11 @@ describe DraftNotes::CreateService do ...@@ -23,11 +23,11 @@ describe DraftNotes::CreateService do
it 'cannot resolve when there is nothing to resolve' do it 'cannot resolve when there is nothing to resolve' do
draft = create_draft(note: 'Not a reply!', resolve_discussion: true) draft = create_draft(note: 'Not a reply!', resolve_discussion: true)
expect(draft.errors[:base]).to include('User is not allowed to resolve discussion') expect(draft.errors[:base]).to include('User is not allowed to resolve thread')
expect(draft).not_to be_persisted expect(draft).not_to be_persisted
end end
context 'in a discussion' do context 'in a thread' do
it 'creates a draft note with discussion_id' do it 'creates a draft note with discussion_id' do
discussion = create(:discussion_note_on_merge_request, noteable: merge_request, project: project).discussion discussion = create(:discussion_note_on_merge_request, noteable: merge_request, project: project).discussion
...@@ -38,7 +38,7 @@ describe DraftNotes::CreateService do ...@@ -38,7 +38,7 @@ describe DraftNotes::CreateService do
expect(draft.resolve_discussion).to be_falsey expect(draft.resolve_discussion).to be_falsey
end end
it 'creates a draft that resolves the discussion' do it 'creates a draft that resolves the thread' do
discussion = create(:discussion_note_on_merge_request, noteable: merge_request, project: project).discussion discussion = create(:discussion_note_on_merge_request, noteable: merge_request, project: project).discussion
draft = create_draft(note: 'A reply!', in_reply_to_discussion_id: discussion.reply_id, resolve_discussion: true) draft = create_draft(note: 'A reply!', in_reply_to_discussion_id: discussion.reply_id, resolve_discussion: true)
......
...@@ -189,17 +189,17 @@ describe DraftNotes::PublishService do ...@@ -189,17 +189,17 @@ describe DraftNotes::PublishService do
end end
end end
context 'with drafts that resolve discussions' do context 'with drafts that resolve threads' do
let!(:note) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project) } let!(:note) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project) }
let!(:draft_note) { create(:draft_note, merge_request: merge_request, author: user, resolve_discussion: true, discussion_id: note.discussion.reply_id) } let!(:draft_note) { create(:draft_note, merge_request: merge_request, author: user, resolve_discussion: true, discussion_id: note.discussion.reply_id) }
it 'resolves the discussion' do it 'resolves the thread' do
publish(draft: draft_note) publish(draft: draft_note)
expect(note.discussion.resolved?).to be true expect(note.discussion.resolved?).to be true
end end
it 'sends notifications if all discussions are resolved' do it 'sends notifications if all threads are resolved' do
expect_any_instance_of(MergeRequests::ResolvedDiscussionNotificationService).to receive(:execute).with(merge_request) expect_any_instance_of(MergeRequests::ResolvedDiscussionNotificationService).to receive(:execute).with(merge_request)
publish publish
......
...@@ -21,7 +21,7 @@ describe Issues::BuildService do ...@@ -21,7 +21,7 @@ describe Issues::BuildService do
end end
end end
context 'for a single discussion' do context 'for a single thread' do
describe '#execute' do describe '#execute' do
let(:merge_request) { create(:merge_request, title: "Hello world", source_project: project) } let(:merge_request) { create(:merge_request, title: "Hello world", source_project: project) }
let(:discussion) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, note: "Almost done").to_discussion } let(:discussion) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, note: "Almost done").to_discussion }
...@@ -30,7 +30,7 @@ describe Issues::BuildService do ...@@ -30,7 +30,7 @@ describe Issues::BuildService do
context 'with an issue template' do context 'with an issue template' do
let(:project) { create(:project, :repository, issues_template: 'Work hard, play hard!') } let(:project) { create(:project, :repository, issues_template: 'Work hard, play hard!') }
it 'picks the discussion description over the issue template' do it 'picks the thread description over the issue template' do
issue = service.execute issue = service.execute
expect(issue.description).to include('Almost done') expect(issue.description).to include('Almost done')
......
...@@ -146,7 +146,7 @@ msgstr[1] "" ...@@ -146,7 +146,7 @@ msgstr[1] ""
msgid "%{actionText} & %{openOrClose} %{noteable}" msgid "%{actionText} & %{openOrClose} %{noteable}"
msgstr "" msgstr ""
msgid "%{authorsName}'s discussion" msgid "%{authorsName}'s thread"
msgstr "" msgstr ""
msgid "%{commit_author_link} authored %{commit_timeago}" msgid "%{commit_author_link} authored %{commit_timeago}"
...@@ -1165,7 +1165,7 @@ msgstr "" ...@@ -1165,7 +1165,7 @@ msgstr ""
msgid "An error has occurred" msgid "An error has occurred"
msgstr "" msgstr ""
msgid "An error occurred adding a draft to the discussion." msgid "An error occurred adding a draft to the thread."
msgstr "" msgstr ""
msgid "An error occurred adding a new draft." msgid "An error occurred adding a new draft."
...@@ -3408,10 +3408,10 @@ msgstr "" ...@@ -3408,10 +3408,10 @@ msgstr ""
msgid "Comment & reopen %{noteable_name}" msgid "Comment & reopen %{noteable_name}"
msgstr "" msgstr ""
msgid "Comment & resolve discussion" msgid "Comment & resolve thread"
msgstr "" msgstr ""
msgid "Comment & unresolve discussion" msgid "Comment & unresolve thread"
msgstr "" msgstr ""
msgid "Comment form position" msgid "Comment form position"
...@@ -8435,34 +8435,34 @@ msgstr "" ...@@ -8435,34 +8435,34 @@ msgstr ""
msgid "MergeRequests|An error occurred while saving the draft comment." msgid "MergeRequests|An error occurred while saving the draft comment."
msgstr "" msgstr ""
msgid "MergeRequests|Discussion stays resolved" msgid "MergeRequests|Failed to squash. Should be done manually."
msgstr "" msgstr ""
msgid "MergeRequests|Discussion stays unresolved" msgid "MergeRequests|Jump to next unresolved discussion"
msgstr "" msgstr ""
msgid "MergeRequests|Discussion will be resolved" msgid "MergeRequests|Reply..."
msgstr "" msgstr ""
msgid "MergeRequests|Discussion will be unresolved" msgid "MergeRequests|Resolve this thread in a new issue"
msgstr "" msgstr ""
msgid "MergeRequests|Failed to squash. Should be done manually." msgid "MergeRequests|Saving the comment failed"
msgstr "" msgstr ""
msgid "MergeRequests|Jump to next unresolved discussion" msgid "MergeRequests|Squash task canceled: another squash is already in progress."
msgstr "" msgstr ""
msgid "MergeRequests|Reply..." msgid "MergeRequests|Thread stays resolved"
msgstr "" msgstr ""
msgid "MergeRequests|Resolve this discussion in a new issue" msgid "MergeRequests|Thread stays unresolved"
msgstr "" msgstr ""
msgid "MergeRequests|Saving the comment failed" msgid "MergeRequests|Thread will be resolved"
msgstr "" msgstr ""
msgid "MergeRequests|Squash task canceled: another squash is already in progress." msgid "MergeRequests|Thread will be unresolved"
msgstr "" msgstr ""
msgid "MergeRequests|Toggle comments for this file" msgid "MergeRequests|Toggle comments for this file"
...@@ -8477,19 +8477,19 @@ msgstr "" ...@@ -8477,19 +8477,19 @@ msgstr ""
msgid "MergeRequests|commented on commit %{commitLink}" msgid "MergeRequests|commented on commit %{commitLink}"
msgstr "" msgstr ""
msgid "MergeRequests|started a discussion" msgid "MergeRequests|started a thread"
msgstr "" msgstr ""
msgid "MergeRequests|started a discussion on %{linkStart}an old version of the diff%{linkEnd}" msgid "MergeRequests|started a thread on %{linkStart}an old version of the diff%{linkEnd}"
msgstr "" msgstr ""
msgid "MergeRequests|started a discussion on %{linkStart}the diff%{linkEnd}" msgid "MergeRequests|started a thread on %{linkStart}the diff%{linkEnd}"
msgstr "" msgstr ""
msgid "MergeRequests|started a discussion on an outdated change in commit %{linkStart}%{commitId}%{linkEnd}" msgid "MergeRequests|started a thread on an outdated change in commit %{linkStart}%{commitId}%{linkEnd}"
msgstr "" msgstr ""
msgid "MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}" msgid "MergeRequests|started a thread on commit %{linkStart}%{commitId}%{linkEnd}"
msgstr "" msgstr ""
msgid "MergeRequest| %{paragraphStart}changed the description %{descriptionChangedTimes} times %{timeDifferenceMinutes}%{paragraphEnd}" msgid "MergeRequest| %{paragraphStart}changed the description %{descriptionChangedTimes} times %{timeDifferenceMinutes}%{paragraphEnd}"
...@@ -11550,7 +11550,7 @@ msgstr "" ...@@ -11550,7 +11550,7 @@ msgstr ""
msgid "Resetting the authorization key will invalidate the previous key. Existing alert configurations will need to be updated with the new key." msgid "Resetting the authorization key will invalidate the previous key. Existing alert configurations will need to be updated with the new key."
msgstr "" msgstr ""
msgid "Resolve all discussions in new issue" msgid "Resolve all threads in new issue"
msgstr "" msgstr ""
msgid "Resolve conflicts on source branch" msgid "Resolve conflicts on source branch"
...@@ -11559,6 +11559,9 @@ msgstr "" ...@@ -11559,6 +11559,9 @@ msgstr ""
msgid "Resolve discussion" msgid "Resolve discussion"
msgstr "" msgstr ""
msgid "Resolve thread"
msgstr ""
msgid "Resolved" msgid "Resolved"
msgstr "" msgstr ""
...@@ -12901,22 +12904,22 @@ msgstr "" ...@@ -12901,22 +12904,22 @@ msgstr ""
msgid "Start date" msgid "Start date"
msgstr "" msgstr ""
msgid "Start discussion" msgid "Start merge train"
msgstr "" msgstr ""
msgid "Start discussion & close %{noteable_name}" msgid "Start merge train when pipeline succeeds"
msgstr "" msgstr ""
msgid "Start discussion & reopen %{noteable_name}" msgid "Start the Runner!"
msgstr "" msgstr ""
msgid "Start merge train" msgid "Start thread"
msgstr "" msgstr ""
msgid "Start merge train when pipeline succeeds" msgid "Start thread & close %{noteable_name}"
msgstr "" msgstr ""
msgid "Start the Runner!" msgid "Start thread & reopen %{noteable_name}"
msgstr "" msgstr ""
msgid "Start your trial" msgid "Start your trial"
...@@ -14416,9 +14419,6 @@ msgstr "" ...@@ -14416,9 +14419,6 @@ msgstr ""
msgid "Toggle commit list" msgid "Toggle commit list"
msgstr "" msgstr ""
msgid "Toggle discussion"
msgstr ""
msgid "Toggle emoji award" msgid "Toggle emoji award"
msgstr "" msgstr ""
...@@ -14431,6 +14431,9 @@ msgstr "" ...@@ -14431,6 +14431,9 @@ msgstr ""
msgid "Toggle sidebar" msgid "Toggle sidebar"
msgstr "" msgstr ""
msgid "Toggle thread"
msgstr ""
msgid "ToggleButton|Toggle Status: OFF" msgid "ToggleButton|Toggle Status: OFF"
msgstr "" msgstr ""
...@@ -14695,6 +14698,9 @@ msgstr "" ...@@ -14695,6 +14698,9 @@ msgstr ""
msgid "Unresolve discussion" msgid "Unresolve discussion"
msgstr "" msgstr ""
msgid "Unresolve thread"
msgstr ""
msgid "Unschedule job" msgid "Unschedule job"
msgstr "" msgstr ""
...@@ -16574,11 +16580,6 @@ msgstr "" ...@@ -16574,11 +16580,6 @@ msgstr ""
msgid "disabled" msgid "disabled"
msgstr "" msgstr ""
msgid "discussion resolved"
msgid_plural "discussions resolved"
msgstr[0] ""
msgstr[1] ""
msgid "done" msgid "done"
msgstr "" msgstr ""
...@@ -16960,7 +16961,7 @@ msgstr "" ...@@ -16960,7 +16961,7 @@ msgstr ""
msgid "mrWidget|There are merge conflicts" msgid "mrWidget|There are merge conflicts"
msgstr "" msgstr ""
msgid "mrWidget|There are unresolved discussions. Please resolve these discussions" msgid "mrWidget|There are unresolved threads. Please resolve these threads"
msgstr "" msgstr ""
msgid "mrWidget|This feature merges changes from the target branch to the source branch. You cannot use this feature since the source branch is protected." msgid "mrWidget|This feature merges changes from the target branch to the source branch. You cannot use this feature since the source branch is protected."
...@@ -17177,6 +17178,11 @@ msgstr "" ...@@ -17177,6 +17178,11 @@ msgstr ""
msgid "this document" msgid "this document"
msgstr "" msgstr ""
msgid "thread resolved"
msgid_plural "threads resolved"
msgstr[0] ""
msgstr[1] ""
msgid "to help your contributors communicate effectively!" msgid "to help your contributors communicate effectively!"
msgstr "" msgstr ""
......
require 'spec_helper' require 'spec_helper'
describe 'Discussion Comments Commit', :js do describe 'Thread Comments Commit', :js do
include RepoHelpers include RepoHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -16,7 +16,7 @@ describe 'Discussion Comments Commit', :js do ...@@ -16,7 +16,7 @@ describe 'Discussion Comments Commit', :js do
visit project_commit_path(project, sample_commit.id) visit project_commit_path(project, sample_commit.id)
end end
it_behaves_like 'discussion comments', 'commit' it_behaves_like 'thread comments', 'commit'
it 'has class .js-note-emoji' do it 'has class .js-note-emoji' do
expect(page).to have_css('.js-note-emoji') expect(page).to have_css('.js-note-emoji')
......
require 'spec_helper' require 'spec_helper'
describe 'Discussion Comments Issue', :js do describe 'Thread Comments Issue', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
...@@ -12,5 +12,5 @@ describe 'Discussion Comments Issue', :js do ...@@ -12,5 +12,5 @@ describe 'Discussion Comments Issue', :js do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
end end
it_behaves_like 'discussion comments', 'issue' it_behaves_like 'thread comments', 'issue'
end end
require 'spec_helper' require 'spec_helper'
describe 'Discussion Comments Merge Request', :js do describe 'Thread Comments Merge Request', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
...@@ -12,5 +12,5 @@ describe 'Discussion Comments Merge Request', :js do ...@@ -12,5 +12,5 @@ describe 'Discussion Comments Merge Request', :js do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
it_behaves_like 'discussion comments', 'merge request' it_behaves_like 'thread comments', 'merge request'
end end
require 'spec_helper' require 'spec_helper'
describe 'Discussion Comments Snippet', :js do describe 'Thread Comments Snippet', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:snippet) { create(:project_snippet, :private, project: project, author: user) } let(:snippet) { create(:project_snippet, :private, project: project, author: user) }
...@@ -12,5 +12,5 @@ describe 'Discussion Comments Snippet', :js do ...@@ -12,5 +12,5 @@ describe 'Discussion Comments Snippet', :js do
visit project_snippet_path(project, snippet) visit project_snippet_path(project, snippet)
end end
it_behaves_like 'discussion comments', 'snippet' it_behaves_like 'thread comments', 'snippet'
end end
require 'rails_helper' require 'rails_helper'
describe 'Resolving all open discussions in a merge request from an issue', :js do describe 'Resolving all open threads in a merge request from an issue', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion }
def resolve_all_discussions_link_selector def resolve_all_discussions_link_selector
text = "Resolve all discussions in new issue" text = "Resolve all threads in new issue"
url = new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) url = new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
%Q{a[data-original-title="#{text}"][href="#{url}"]} %Q{a[data-original-title="#{text}"][href="#{url}"]}
end end
...@@ -19,15 +19,15 @@ describe 'Resolving all open discussions in a merge request from an issue', :js ...@@ -19,15 +19,15 @@ describe 'Resolving all open discussions in a merge request from an issue', :js
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
it 'shows a button to resolve all discussions by creating a new issue' do it 'shows a button to resolve all threads by creating a new issue' do
within('.line-resolve-all-container') do within('.line-resolve-all-container') do
expect(page).to have_selector resolve_all_discussions_link_selector expect(page).to have_selector resolve_all_discussions_link_selector
end end
end end
context 'resolving the discussion' do context 'resolving the thread' do
before do before do
click_button 'Resolve discussion' click_button 'Resolve thread'
end end
it 'hides the link for creating a new issue' do it 'hides the link for creating a new issue' do
...@@ -35,15 +35,15 @@ describe 'Resolving all open discussions in a merge request from an issue', :js ...@@ -35,15 +35,15 @@ describe 'Resolving all open discussions in a merge request from an issue', :js
end end
end end
context 'creating an issue for discussions' do context 'creating an issue for threads' do
before do before do
find(resolve_all_discussions_link_selector).click find(resolve_all_discussions_link_selector).click
end end
it_behaves_like 'creating an issue for a discussion' it_behaves_like 'creating an issue for a thread'
end end
context 'for a project where all discussions need to be resolved before merging' do context 'for a project where all threads need to be resolved before merging' do
before do before do
project.update_attribute(:only_allow_merge_if_all_discussions_are_resolved, true) project.update_attribute(:only_allow_merge_if_all_discussions_are_resolved, true)
end end
...@@ -59,27 +59,27 @@ describe 'Resolving all open discussions in a merge request from an issue', :js ...@@ -59,27 +59,27 @@ describe 'Resolving all open discussions in a merge request from an issue', :js
end end
end end
context 'merge request has discussions that need to be resolved' do context 'merge request has threads that need to be resolved' do
before do before do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
it 'shows a warning that the merge request contains unresolved discussions' do it 'shows a warning that the merge request contains unresolved threads' do
expect(page).to have_content 'There are unresolved discussions.' expect(page).to have_content 'There are unresolved threads.'
end end
it 'has a link to resolve all discussions by creating an issue' do it 'has a link to resolve all threads by creating an issue' do
page.within '.mr-widget-body' do page.within '.mr-widget-body' do
expect(page).to have_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) expect(page).to have_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end end
end end
context 'creating an issue for discussions' do context 'creating an issue for threads' do
before do before do
page.click_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) page.click_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end end
it_behaves_like 'creating an issue for a discussion' it_behaves_like 'creating an issue for a thread'
end end
end end
end end
...@@ -92,8 +92,8 @@ describe 'Resolving all open discussions in a merge request from an issue', :js ...@@ -92,8 +92,8 @@ describe 'Resolving all open discussions in a merge request from an issue', :js
visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end end
it 'Shows a notice to ask someone else to resolve the discussions' do it 'Shows a notice to ask someone else to resolve the threads' do
expect(page).to have_content("The discussions at #{merge_request.to_reference} will stay unresolved. Ask someone with permission to resolve them.") expect(page).to have_content("The threads at #{merge_request.to_reference} will stay unresolved. Ask someone with permission to resolve them.")
end end
end end
end end
require 'rails_helper' require 'rails_helper'
describe 'Resolve an open discussion in a merge request by creating an issue', :js do describe 'Resolve an open thread in a merge request by creating an issue', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) } let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion }
def resolve_discussion_selector def resolve_discussion_selector
title = 'Resolve this discussion in a new issue' title = 'Resolve this thread in a new issue'
url = new_project_issue_path(project, discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid) url = new_project_issue_path(project, discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid)
"a[data-original-title=\"#{title}\"][href=\"#{url}\"]" "a[data-original-title=\"#{title}\"][href=\"#{url}\"]"
end end
...@@ -30,25 +30,25 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -30,25 +30,25 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
end end
end end
context 'resolving the discussion' do context 'resolving the thread' do
before do before do
click_button 'Resolve discussion' click_button 'Resolve thread'
end end
it 'hides the link for creating a new issue' do it 'hides the link for creating a new issue' do
expect(page).not_to have_css resolve_discussion_selector expect(page).not_to have_css resolve_discussion_selector
end end
it 'shows the link for creating a new issue when unresolving a discussion' do it 'shows the link for creating a new issue when unresolving a thread' do
page.within '.diff-content' do page.within '.diff-content' do
click_button 'Unresolve discussion' click_button 'Unresolve thread'
end end
expect(page).to have_css resolve_discussion_selector expect(page).to have_css resolve_discussion_selector
end end
end end
it 'has a link to create a new issue for a discussion' do it 'has a link to create a new issue for a thread' do
expect(page).to have_css resolve_discussion_selector expect(page).to have_css resolve_discussion_selector
end end
...@@ -57,13 +57,13 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -57,13 +57,13 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
find(resolve_discussion_selector, match: :first).click find(resolve_discussion_selector, match: :first).click
end end
it 'has a hidden field for the discussion' do it 'has a hidden field for the thread' do
discussion_field = find('#discussion_to_resolve', visible: false) discussion_field = find('#discussion_to_resolve', visible: false)
expect(discussion_field.value).to eq(discussion.id.to_s) expect(discussion_field.value).to eq(discussion.id.to_s)
end end
it_behaves_like 'creating an issue for a discussion' it_behaves_like 'creating an issue for a thread'
end end
end end
...@@ -75,8 +75,8 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -75,8 +75,8 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
discussion_to_resolve: discussion.id) discussion_to_resolve: discussion.id)
end end
it 'Shows a notice to ask someone else to resolve the discussions' do it 'Shows a notice to ask someone else to resolve the threads' do
expect(page).to have_content("The discussion at #{merge_request.to_reference}"\ expect(page).to have_content("The thread at #{merge_request.to_reference}"\
" (discussion #{discussion.first_note.id}) will stay unresolved."\ " (discussion #{discussion.first_note.id}) will stay unresolved."\
" Ask someone with permission to resolve it.") " Ask someone with permission to resolve it.")
end end
......
...@@ -37,7 +37,7 @@ describe 'User comments on a merge request', :js do ...@@ -37,7 +37,7 @@ describe 'User comments on a merge request', :js do
wait_for_requests wait_for_requests
page.within('.notes .discussion') do page.within('.notes .discussion') do
expect(page).to have_content("#{user.name} #{user.to_reference} started a discussion") expect(page).to have_content("#{user.name} #{user.to_reference} started a thread")
expect(page).to have_content(sample_commit.line_code_path) expect(page).to have_content(sample_commit.line_code_path)
expect(page).to have_content('Line is wrong') expect(page).to have_content('Line is wrong')
end end
......
require 'rails_helper' require 'rails_helper'
describe 'Merge request > User sees discussions', :js do describe 'Merge request > User sees threads', :js do
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
let(:user) { project.creator } let(:user) { project.creator }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
...@@ -30,7 +30,7 @@ describe 'Merge request > User sees discussions', :js do ...@@ -30,7 +30,7 @@ describe 'Merge request > User sees discussions', :js do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
context 'active discussions' do context 'active threads' do
it 'shows a link to the diff' do it 'shows a link to the diff' do
within(".discussion[data-discussion-id='#{active_discussion.id}']") do within(".discussion[data-discussion-id='#{active_discussion.id}']") do
path = diffs_project_merge_request_path(project, merge_request, anchor: active_discussion.line_code) path = diffs_project_merge_request_path(project, merge_request, anchor: active_discussion.line_code)
...@@ -39,7 +39,7 @@ describe 'Merge request > User sees discussions', :js do ...@@ -39,7 +39,7 @@ describe 'Merge request > User sees discussions', :js do
end end
end end
context 'outdated discussions' do context 'outdated threads' do
it 'shows a link to the outdated diff' do it 'shows a link to the outdated diff' do
within(".discussion[data-discussion-id='#{outdated_discussion.id}']") do within(".discussion[data-discussion-id='#{outdated_discussion.id}']") do
path = diffs_project_merge_request_path(project, merge_request, diff_id: old_merge_request_diff.id, anchor: outdated_discussion.line_code) path = diffs_project_merge_request_path(project, merge_request, diff_id: old_merge_request_diff.id, anchor: outdated_discussion.line_code)
...@@ -85,7 +85,7 @@ describe 'Merge request > User sees discussions', :js do ...@@ -85,7 +85,7 @@ describe 'Merge request > User sees discussions', :js do
it_behaves_like 'a functional discussion' it_behaves_like 'a functional discussion'
it 'displays correct header' do it 'displays correct header' do
expect(page).to have_content "started a discussion on commit #{note.commit_id[0...7]}" expect(page).to have_content "started a thread on commit #{note.commit_id[0...7]}"
end end
end end
......
require 'rails_helper' require 'rails_helper'
describe 'Merge request > User sees merge button depending on unresolved discussions', :js do describe 'Merge request > User sees merge button depending on unresolved threads', :js do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { project.creator } let(:user) { project.creator }
let!(:merge_request) { create(:merge_request_with_diff_notes, source_project: project, author: user) } let!(:merge_request) { create(:merge_request_with_diff_notes, source_project: project, author: user) }
...@@ -16,14 +16,14 @@ describe 'Merge request > User sees merge button depending on unresolved discuss ...@@ -16,14 +16,14 @@ describe 'Merge request > User sees merge button depending on unresolved discuss
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
context 'with unresolved discussions' do context 'with unresolved threads' do
it 'does not allow to merge' do it 'does not allow to merge' do
expect(page).not_to have_button 'Merge' expect(page).not_to have_button 'Merge'
expect(page).to have_content('There are unresolved discussions.') expect(page).to have_content('There are unresolved threads.')
end end
end end
context 'with all discussions resolved' do context 'with all threads resolved' do
before do before do
merge_request.discussions.each { |d| d.resolve!(user) } merge_request.discussions.each { |d| d.resolve!(user) }
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
...@@ -41,13 +41,13 @@ describe 'Merge request > User sees merge button depending on unresolved discuss ...@@ -41,13 +41,13 @@ describe 'Merge request > User sees merge button depending on unresolved discuss
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
context 'with unresolved discussions' do context 'with unresolved threads' do
it 'does not allow to merge' do it 'does not allow to merge' do
expect(page).to have_button 'Merge' expect(page).to have_button 'Merge'
end end
end end
context 'with all discussions resolved' do context 'with all threads resolved' do
before do before do
merge_request.discussions.each { |d| d.resolve!(user) } merge_request.discussions.each { |d| d.resolve!(user) }
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
......
...@@ -186,12 +186,12 @@ describe 'User comments on a diff', :js do ...@@ -186,12 +186,12 @@ describe 'User comments on a diff', :js do
it 'resolves discussion when applied' do it 'resolves discussion when applied' do
page.within('.diff-discussions') do page.within('.diff-discussions') do
expect(page).not_to have_content('Unresolve discussion') expect(page).not_to have_content('Unresolve thread')
click_button('Apply suggestion') click_button('Apply suggestion')
wait_for_requests wait_for_requests
expect(page).to have_content('Unresolve discussion') expect(page).to have_content('Unresolve thread')
end end
end end
end end
......
...@@ -45,11 +45,11 @@ describe('noteable_discussion component', () => { ...@@ -45,11 +45,11 @@ describe('noteable_discussion component', () => {
expect(wrapper.find('.user-avatar-link').exists()).toBe(true); expect(wrapper.find('.user-avatar-link').exists()).toBe(true);
}); });
it('should not render discussion header for non diff discussions', () => { it('should not render thread header for non diff threads', () => {
expect(wrapper.find('.discussion-header').exists()).toBe(false); expect(wrapper.find('.discussion-header').exists()).toBe(false);
}); });
it('should render discussion header', done => { it('should render thread header', done => {
const discussion = { ...discussionMock }; const discussion = { ...discussionMock };
discussion.diff_file = mockDiffFile; discussion.diff_file = mockDiffFile;
discussion.diff_discussion = true; discussion.diff_discussion = true;
...@@ -96,16 +96,16 @@ describe('noteable_discussion component', () => { ...@@ -96,16 +96,16 @@ describe('noteable_discussion component', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('does not render jump to discussion button', () => { it('does not render jump to thread button', () => {
expect( expect(wrapper.find('*[data-original-title="Jump to next unresolved thread"]').exists()).toBe(
wrapper.find('*[data-original-title="Jump to next unresolved discussion"]').exists(), false,
).toBe(false); );
}); });
}); });
describe('methods', () => { describe('methods', () => {
describe('jumpToNextDiscussion', () => { describe('jumpToNextDiscussion', () => {
it('expands next unresolved discussion', done => { it('expands next unresolved thread', done => {
const discussion2 = getJSONFixture(discussionWithTwoUnresolvedNotes)[0]; const discussion2 = getJSONFixture(discussionWithTwoUnresolvedNotes)[0];
discussion2.resolved = false; discussion2.resolved = false;
discussion2.active = true; discussion2.active = true;
...@@ -120,9 +120,7 @@ describe('noteable_discussion component', () => { ...@@ -120,9 +120,7 @@ describe('noteable_discussion component', () => {
const nextDiscussionId = discussion2.id; const nextDiscussionId = discussion2.id;
setFixtures(` setFixtures(`<div class="discussion" data-discussion-id="${nextDiscussionId}"></div>`);
<div class="discussion" data-discussion-id="${nextDiscussionId}"></div>
`);
wrapper.vm.jumpToNextDiscussion(); wrapper.vm.jumpToNextDiscussion();
...@@ -168,20 +166,20 @@ describe('noteable_discussion component', () => { ...@@ -168,20 +166,20 @@ describe('noteable_discussion component', () => {
.catch(done.fail); .catch(done.fail);
}); });
describe('for commit discussions', () => { describe('for commit threads', () => {
it('should display a monospace started a discussion on commit', () => { it('should display a monospace started a thread on commit', () => {
expect(wrapper.text()).toContain(`started a discussion on commit ${truncatedCommitId}`); expect(wrapper.text()).toContain(`started a thread on commit ${truncatedCommitId}`);
expect(commitElement.exists()).toBe(true); expect(commitElement.exists()).toBe(true);
expect(commitElement.text()).toContain(truncatedCommitId); expect(commitElement.text()).toContain(truncatedCommitId);
}); });
}); });
describe('for diff discussion with a commit id', () => { describe('for diff thread with a commit id', () => {
it('should display started discussion on commit header', done => { it('should display started thread on commit header', done => {
wrapper.vm.discussion.for_commit = false; wrapper.vm.discussion.for_commit = false;
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
expect(wrapper.text()).toContain(`started a discussion on commit ${truncatedCommitId}`); expect(wrapper.text()).toContain(`started a thread on commit ${truncatedCommitId}`);
expect(commitElement).not.toBe(null); expect(commitElement).not.toBe(null);
...@@ -195,7 +193,7 @@ describe('noteable_discussion component', () => { ...@@ -195,7 +193,7 @@ describe('noteable_discussion component', () => {
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
expect(wrapper.text()).toContain( expect(wrapper.text()).toContain(
`started a discussion on an outdated change in commit ${truncatedCommitId}`, `started a thread on an outdated change in commit ${truncatedCommitId}`,
); );
expect(commitElement).not.toBe(null); expect(commitElement).not.toBe(null);
...@@ -205,21 +203,21 @@ describe('noteable_discussion component', () => { ...@@ -205,21 +203,21 @@ describe('noteable_discussion component', () => {
}); });
}); });
describe('for diff discussions without a commit id', () => { describe('for diff threads without a commit id', () => {
it('should show started a discussion on the diff text', done => { it('should show started a thread on the diff text', done => {
Object.assign(wrapper.vm.discussion, { Object.assign(wrapper.vm.discussion, {
for_commit: false, for_commit: false,
commit_id: null, commit_id: null,
}); });
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
expect(wrapper.text()).toContain('started a discussion on the diff'); expect(wrapper.text()).toContain('started a thread on the diff');
done(); done();
}); });
}); });
it('should show discussion on older version text', done => { it('should show thread on older version text', done => {
Object.assign(wrapper.vm.discussion, { Object.assign(wrapper.vm.discussion, {
for_commit: false, for_commit: false,
commit_id: null, commit_id: null,
...@@ -227,7 +225,7 @@ describe('noteable_discussion component', () => { ...@@ -227,7 +225,7 @@ describe('noteable_discussion component', () => {
}); });
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
expect(wrapper.text()).toContain('started a discussion on an old version of the diff'); expect(wrapper.text()).toContain('started a thread on an old version of the diff');
done(); done();
}); });
...@@ -235,7 +233,7 @@ describe('noteable_discussion component', () => { ...@@ -235,7 +233,7 @@ describe('noteable_discussion component', () => {
}); });
}); });
describe('for resolved discussion', () => { describe('for resolved thread', () => {
beforeEach(() => { beforeEach(() => {
const discussion = getJSONFixture(discussionWithTwoUnresolvedNotes)[0]; const discussion = getJSONFixture(discussionWithTwoUnresolvedNotes)[0];
wrapper.setProps({ discussion }); wrapper.setProps({ discussion });
...@@ -248,7 +246,7 @@ describe('noteable_discussion component', () => { ...@@ -248,7 +246,7 @@ describe('noteable_discussion component', () => {
}); });
}); });
describe('for unresolved discussion', () => { describe('for unresolved thread', () => {
beforeEach(done => { beforeEach(done => {
const discussion = { const discussion = {
...getJSONFixture(discussionWithTwoUnresolvedNotes)[0], ...getJSONFixture(discussionWithTwoUnresolvedNotes)[0],
......
...@@ -10,7 +10,7 @@ describe('UnresolvedDiscussions', () => { ...@@ -10,7 +10,7 @@ describe('UnresolvedDiscussions', () => {
vm.$destroy(); vm.$destroy();
}); });
describe('with discussions path', () => { describe('with threads path', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponent(Component, { vm = mountComponent(Component, {
mr: { mr: {
...@@ -21,7 +21,7 @@ describe('UnresolvedDiscussions', () => { ...@@ -21,7 +21,7 @@ describe('UnresolvedDiscussions', () => {
it('should have correct elements', () => { it('should have correct elements', () => {
expect(vm.$el.innerText).toContain( expect(vm.$el.innerText).toContain(
'There are unresolved discussions. Please resolve these discussions', 'There are unresolved threads. Please resolve these threads',
); );
expect(vm.$el.innerText).toContain('Create an issue to resolve them later'); expect(vm.$el.innerText).toContain('Create an issue to resolve them later');
...@@ -29,14 +29,14 @@ describe('UnresolvedDiscussions', () => { ...@@ -29,14 +29,14 @@ describe('UnresolvedDiscussions', () => {
}); });
}); });
describe('without discussions path', () => { describe('without threads path', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponent(Component, { mr: {} }); vm = mountComponent(Component, { mr: {} });
}); });
it('should not show create issue link if user cannot create issue', () => { it('should not show create issue link if user cannot create issue', () => {
expect(vm.$el.innerText).toContain( expect(vm.$el.innerText).toContain(
'There are unresolved discussions. Please resolve these discussions', 'There are unresolved threads. Please resolve these threads',
); );
expect(vm.$el.querySelector('.js-create-issue')).toEqual(null); expect(vm.$el.querySelector('.js-create-issue')).toEqual(null);
......
...@@ -1148,7 +1148,7 @@ describe SystemNoteService do ...@@ -1148,7 +1148,7 @@ describe SystemNoteService do
end end
it 'sets the note text' do it 'sets the note text' do
expect(subject.note).to eq 'resolved all discussions' expect(subject.note).to eq 'resolved all threads'
end end
end end
......
shared_examples 'discussion comments' do |resource_name| shared_examples 'thread comments' do |resource_name|
let(:form_selector) { '.js-main-target-form' } let(:form_selector) { '.js-main-target-form' }
let(:dropdown_selector) { "#{form_selector} .comment-type-dropdown" } let(:dropdown_selector) { "#{form_selector} .comment-type-dropdown" }
let(:toggle_selector) { "#{dropdown_selector} .dropdown-toggle" } let(:toggle_selector) { "#{dropdown_selector} .dropdown-toggle" }
...@@ -48,7 +48,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -48,7 +48,7 @@ shared_examples 'discussion comments' do |resource_name|
find(toggle_selector).click find(toggle_selector).click
end end
it 'has a "Comment" item (selected by default) and "Start discussion" item' do it 'has a "Comment" item (selected by default) and "Start thread" item' do
expect(page).to have_selector menu_selector expect(page).to have_selector menu_selector
find("#{menu_selector} li", match: :first) find("#{menu_selector} li", match: :first)
...@@ -59,7 +59,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -59,7 +59,7 @@ shared_examples 'discussion comments' do |resource_name|
expect(items.first).to have_selector '.fa-check' expect(items.first).to have_selector '.fa-check'
expect(items.first['class']).to match 'droplab-item-selected' expect(items.first['class']).to match 'droplab-item-selected'
expect(items.last).to have_content 'Start discussion' expect(items.last).to have_content 'Start thread'
expect(items.last).to have_content "Discuss a specific suggestion or question#{' that needs to be resolved' if resource_name == 'merge request'}." expect(items.last).to have_content "Discuss a specific suggestion or question#{' that needs to be resolved' if resource_name == 'merge request'}."
expect(items.last).not_to have_selector '.fa-check' expect(items.last).not_to have_selector '.fa-check'
expect(items.last['class']).not_to match 'droplab-item-selected' expect(items.last['class']).not_to match 'droplab-item-selected'
...@@ -103,7 +103,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -103,7 +103,7 @@ shared_examples 'discussion comments' do |resource_name|
expect(find(dropdown_selector)).to have_content 'Comment' expect(find(dropdown_selector)).to have_content 'Comment'
end end
describe 'when selecting "Start discussion"' do describe 'when selecting "Start thread"' do
before do before do
find("#{menu_selector} li", match: :first) find("#{menu_selector} li", match: :first)
all("#{menu_selector} li").last.click all("#{menu_selector} li").last.click
...@@ -114,9 +114,9 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -114,9 +114,9 @@ shared_examples 'discussion comments' do |resource_name|
# on issues page, the submit input is a <button>, on other pages it is <input> # on issues page, the submit input is a <button>, on other pages it is <input>
if button.tag_name == 'button' if button.tag_name == 'button'
expect(find(submit_selector)).to have_content 'Start discussion' expect(find(submit_selector)).to have_content 'Start thread'
else else
expect(find(submit_selector).value).to eq 'Start discussion' expect(find(submit_selector).value).to eq 'Start thread'
end end
expect(page).not_to have_selector menu_selector expect(page).not_to have_selector menu_selector
...@@ -124,17 +124,17 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -124,17 +124,17 @@ shared_examples 'discussion comments' do |resource_name|
if resource_name =~ /(issue|merge request)/ if resource_name =~ /(issue|merge request)/
it 'updates the close button text' do it 'updates the close button text' do
expect(find(close_selector)).to have_content "Start discussion & close #{resource_name}" expect(find(close_selector)).to have_content "Start thread & close #{resource_name}"
end end
it 'typing does not change the close button text' do it 'typing does not change the close button text' do
find("#{form_selector} .note-textarea").send_keys('b') find("#{form_selector} .note-textarea").send_keys('b')
expect(find(close_selector)).to have_content "Start discussion & close #{resource_name}" expect(find(close_selector)).to have_content "Start thread & close #{resource_name}"
end end
end end
describe 'creating a discussion' do describe 'creating a thread' do
before do before do
find(submit_selector).click find(submit_selector).click
wait_for_requests wait_for_requests
...@@ -150,7 +150,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -150,7 +150,7 @@ shared_examples 'discussion comments' do |resource_name|
wait_for_requests wait_for_requests
end end
it 'clicking "Start discussion" will post a discussion' do it 'clicking "Start thread" will post a thread' do
new_comment = all(comments_selector).last new_comment = all(comments_selector).last
expect(new_comment).to have_content 'a' expect(new_comment).to have_content 'a'
...@@ -179,7 +179,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -179,7 +179,7 @@ shared_examples 'discussion comments' do |resource_name|
let(:reply_id) { find("#{comments_selector} .note:last-of-type", match: :first)['data-note-id'] } let(:reply_id) { find("#{comments_selector} .note:last-of-type", match: :first)['data-note-id'] }
it 'can be replied to after resolving' do it 'can be replied to after resolving' do
click_button "Resolve discussion" click_button "Resolve thread"
wait_for_requests wait_for_requests
refresh refresh
...@@ -188,10 +188,10 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -188,10 +188,10 @@ shared_examples 'discussion comments' do |resource_name|
submit_reply('to reply or not reply') submit_reply('to reply or not reply')
end end
it 'shows resolved discussion when toggled' do it 'shows resolved thread when toggled' do
submit_reply('a') submit_reply('a')
click_button "Resolve discussion" click_button "Resolve thread"
wait_for_requests wait_for_requests
expect(page).to have_selector(".note-row-#{note_id}", visible: true) expect(page).to have_selector(".note-row-#{note_id}", visible: true)
...@@ -205,7 +205,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -205,7 +205,7 @@ shared_examples 'discussion comments' do |resource_name|
end end
if resource_name == 'issue' if resource_name == 'issue'
it "clicking 'Start discussion & close #{resource_name}' will post a discussion and close the #{resource_name}" do it "clicking 'Start thread & close #{resource_name}' will post a thread and close the #{resource_name}" do
find(close_selector).click find(close_selector).click
find(comments_selector, match: :first) find(comments_selector, match: :first)
...@@ -224,7 +224,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -224,7 +224,7 @@ shared_examples 'discussion comments' do |resource_name|
find(toggle_selector).click find(toggle_selector).click
end end
it 'has "Start discussion" selected' do it 'has "Start thread" selected' do
find("#{menu_selector} li", match: :first) find("#{menu_selector} li", match: :first)
items = all("#{menu_selector} li") items = all("#{menu_selector} li")
...@@ -232,7 +232,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -232,7 +232,7 @@ shared_examples 'discussion comments' do |resource_name|
expect(items.first).not_to have_selector '.fa-check' expect(items.first).not_to have_selector '.fa-check'
expect(items.first['class']).not_to match 'droplab-item-selected' expect(items.first['class']).not_to match 'droplab-item-selected'
expect(items.last).to have_content 'Start discussion' expect(items.last).to have_content 'Start thread'
expect(items.last).to have_selector '.fa-check' expect(items.last).to have_selector '.fa-check'
expect(items.last['class']).to match 'droplab-item-selected' expect(items.last['class']).to match 'droplab-item-selected'
end end
...@@ -277,7 +277,7 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -277,7 +277,7 @@ shared_examples 'discussion comments' do |resource_name|
expect(items.first).to have_selector '.fa-check' expect(items.first).to have_selector '.fa-check'
expect(items.first['class']).to match 'droplab-item-selected' expect(items.first['class']).to match 'droplab-item-selected'
expect(items.last).to have_content 'Start discussion' expect(items.last).to have_content 'Start thread'
expect(items.last).not_to have_selector '.fa-check' expect(items.last).not_to have_selector '.fa-check'
expect(items.last['class']).not_to match 'droplab-item-selected' expect(items.last['class']).not_to match 'droplab-item-selected'
end end
...@@ -299,13 +299,13 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -299,13 +299,13 @@ shared_examples 'discussion comments' do |resource_name|
expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Comment & reopen #{resource_name}" expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Comment & reopen #{resource_name}"
end end
it "should show a 'Start discussion & reopen #{resource_name}' button when 'Start discussion' is selected" do it "should show a 'Start thread & reopen #{resource_name}' button when 'Start thread' is selected" do
find(toggle_selector).click find(toggle_selector).click
find("#{menu_selector} li", match: :first) find("#{menu_selector} li", match: :first)
all("#{menu_selector} li").last.click all("#{menu_selector} li").last.click
expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Start discussion & reopen #{resource_name}" expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Start thread & reopen #{resource_name}"
end end
end end
end end
......
shared_examples 'creating an issue for a discussion' do shared_examples 'creating an issue for a thread' do
it 'shows an issue with the title filled in' do it 'shows an issue with the title filled in' do
title_field = page.find_field('issue[title]') title_field = page.find_field('issue[title]')
......
...@@ -16,7 +16,7 @@ shared_examples 'comment on merge request file' do ...@@ -16,7 +16,7 @@ shared_examples 'comment on merge request file' do
visit(merge_request_path(merge_request)) visit(merge_request_path(merge_request))
page.within('.notes .discussion') do page.within('.notes .discussion') do
expect(page).to have_content("#{user.name} #{user.to_reference} started a discussion") expect(page).to have_content("#{user.name} #{user.to_reference} started a thread")
expect(page).to have_content(sample_commit.line_code_path) expect(page).to have_content(sample_commit.line_code_path)
expect(page).to have_content('Line is wrong') expect(page).to have_content('Line is wrong')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment