Commit db12e729 authored by Nick Thomas's avatar Nick Thomas

Merge branch '58644-remove-reply_to_individual_notes-feature-flag' into 'master'

Remove reply_to_individual_notes feature flag

Closes #58644

See merge request gitlab-org/gitlab-ce!26889
parents dd7e927b c17b7afa
...@@ -86,9 +86,6 @@ export default { ...@@ -86,9 +86,6 @@ export default {
}, },
computed: { computed: {
...mapGetters(['getUserDataByProp']), ...mapGetters(['getUserDataByProp']),
showReplyButton() {
return gon.features && gon.features.replyToIndividualNotes && this.showReply;
},
shouldShowActionsDropdown() { shouldShowActionsDropdown() {
return this.currentUserId && (this.canEdit || this.canReportAsAbuse); return this.currentUserId && (this.canEdit || this.canReportAsAbuse);
}, },
...@@ -167,7 +164,7 @@ export default { ...@@ -167,7 +164,7 @@ export default {
</a> </a>
</div> </div>
<reply-button <reply-button
v-if="showReplyButton" v-if="showReply"
ref="replyButton" ref="replyButton"
class="js-reply-button" class="js-reply-button"
@startReplying="$emit('startReplying')" @startReplying="$emit('startReplying')"
......
...@@ -7,9 +7,6 @@ module IssuableActions ...@@ -7,9 +7,6 @@ module IssuableActions
included do included do
before_action :authorize_destroy_issuable!, only: :destroy before_action :authorize_destroy_issuable!, only: :destroy
before_action :authorize_admin_issuable!, only: :bulk_update before_action :authorize_admin_issuable!, only: :bulk_update
before_action only: :show do
push_frontend_feature_flag(:reply_to_individual_notes, default_enabled: true)
end
end end
def permitted_keys def permitted_keys
......
...@@ -14,7 +14,7 @@ class IndividualNoteDiscussion < Discussion ...@@ -14,7 +14,7 @@ class IndividualNoteDiscussion < Discussion
end end
def can_convert_to_discussion? def can_convert_to_discussion?
noteable.supports_replying_to_individual_notes? && Feature.enabled?(:reply_to_individual_notes, default_enabled: true) noteable.supports_replying_to_individual_notes?
end end
def convert_to_discussion!(save: false) def convert_to_discussion!(save: false)
......
...@@ -67,18 +67,7 @@ describe 'Merge request > User posts notes', :js do ...@@ -67,18 +67,7 @@ describe 'Merge request > User posts notes', :js do
end end
end end
describe 'when reply_to_individual_notes feature flag is disabled' do describe 'reply button' do
before do
stub_feature_flags(reply_to_individual_notes: false)
visit project_merge_request_path(project, merge_request)
end
it 'does not show a reply button' do
expect(page).to have_no_selector('.js-reply-button')
end
end
describe 'when reply_to_individual_notes feature flag is not set' do
before do before do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
......
...@@ -128,17 +128,6 @@ describe('noteActions', () => { ...@@ -128,17 +128,6 @@ describe('noteActions', () => {
}); });
}); });
describe('with feature flag replyToIndividualNotes enabled', () => {
beforeEach(() => {
gon.features = {
replyToIndividualNotes: true,
};
});
afterEach(() => {
gon.features = {};
});
describe('for showReply = true', () => { describe('for showReply = true', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMountNoteActions({ wrapper = shallowMountNoteActions({
...@@ -168,47 +157,4 @@ describe('noteActions', () => { ...@@ -168,47 +157,4 @@ describe('noteActions', () => {
expect(replyButton.exists()).toBe(false); expect(replyButton.exists()).toBe(false);
}); });
}); });
});
describe('with feature flag replyToIndividualNotes disabled', () => {
beforeEach(() => {
gon.features = {
replyToIndividualNotes: false,
};
});
afterEach(() => {
gon.features = {};
});
describe('for showReply = true', () => {
beforeEach(() => {
wrapper = shallowMountNoteActions({
...props,
showReply: true,
});
});
it('does not show a reply button', () => {
const replyButton = wrapper.find({ ref: 'replyButton' });
expect(replyButton.exists()).toBe(false);
});
});
describe('for showReply = false', () => {
beforeEach(() => {
wrapper = shallowMountNoteActions({
...props,
showReply: false,
});
});
it('does not show a reply button', () => {
const replyButton = wrapper.find({ ref: 'replyButton' });
expect(replyButton.exists()).toBe(false);
});
});
});
}); });
...@@ -128,27 +128,6 @@ describe Notes::BuildService do ...@@ -128,27 +128,6 @@ describe Notes::BuildService do
subject { described_class.new(project, author, note: 'Test', in_reply_to_discussion_id: note.discussion_id).execute } subject { described_class.new(project, author, note: 'Test', in_reply_to_discussion_id: note.discussion_id).execute }
shared_examples 'an individual note reply' do
it 'builds another individual note' do
expect(subject).to be_valid
expect(subject).to be_a(Note)
expect(subject.discussion_id).not_to eq(note.discussion_id)
end
end
context 'when reply_to_individual_notes is disabled' do
before do
stub_feature_flags(reply_to_individual_notes: false)
end
it_behaves_like 'an individual note reply'
end
context 'when reply_to_individual_notes is enabled' do
before do
stub_feature_flags(reply_to_individual_notes: true)
end
it 'sets the note up to be in reply to that note' do it 'sets the note up to be in reply to that note' do
expect(subject).to be_valid expect(subject).to be_valid
expect(subject).to be_a(DiscussionNote) expect(subject).to be_a(DiscussionNote)
...@@ -158,7 +137,10 @@ describe Notes::BuildService do ...@@ -158,7 +137,10 @@ describe Notes::BuildService do
context 'when noteable does not support replies' do context 'when noteable does not support replies' do
let(:note) { create(:note_on_commit) } let(:note) { create(:note_on_commit) }
it_behaves_like 'an individual note reply' it 'builds another individual note' do
expect(subject).to be_valid
expect(subject).to be_a(Note)
expect(subject.discussion_id).not_to eq(note.discussion_id)
end end
end end
end end
......
...@@ -298,26 +298,6 @@ describe Notes::CreateService do ...@@ -298,26 +298,6 @@ describe Notes::CreateService do
subject { described_class.new(project, user, reply_opts).execute } subject { described_class.new(project, user, reply_opts).execute }
context 'when reply_to_individual_notes is disabled' do
before do
stub_feature_flags(reply_to_individual_notes: false)
end
it 'creates an individual note' do
expect(subject.type).to eq(nil)
expect(subject.discussion_id).not_to eq(existing_note.discussion_id)
end
it 'does not convert existing note' do
expect { subject }.not_to change { existing_note.reload.type }
end
end
context 'when reply_to_individual_notes is enabled' do
before do
stub_feature_flags(reply_to_individual_notes: true)
end
it 'creates a DiscussionNote in reply to existing note' do it 'creates a DiscussionNote in reply to existing note' do
expect(subject).to be_a(DiscussionNote) expect(subject).to be_a(DiscussionNote)
expect(subject.discussion_id).to eq(existing_note.discussion_id) expect(subject.discussion_id).to eq(existing_note.discussion_id)
...@@ -335,5 +315,4 @@ describe Notes::CreateService do ...@@ -335,5 +315,4 @@ describe Notes::CreateService do
end end
end end
end end
end
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