Skip to content
Snippets Groups Projects
Commit 35487713 authored by Eugenia Grieff's avatar Eugenia Grieff :two:
Browse files

Clean up confidential_notes feature flag

Update doccumentation
Remove references to confidentialNotes feature in comment_form

Changelog: other
parent 192209cc
No related branches found
No related tags found
1 merge request!92542Remove confidential_notes feature flag
......@@ -172,9 +172,6 @@ export default {
trackingLabel() {
return slugifyWithUnderscore(`${this.commentButtonTitle} button`);
},
internalNotesEnabled() {
return Boolean(this.glFeatures.confidentialNotes);
},
disableSubmitButton() {
return this.note.length === 0 || this.isSubmitting;
},
......@@ -414,7 +411,7 @@ export default {
</template>
<template v-else>
<gl-form-checkbox
v-if="internalNotesEnabled && canSetInternalNote"
v-if="canSetInternalNote"
v-model="noteIsInternal"
class="gl-mb-2"
data-testid="internal-note-checkbox"
......
......@@ -45,7 +45,6 @@ class Projects::IssuesController < Projects::ApplicationController
end
before_action only: :show do
push_frontend_feature_flag(:confidential_notes, project&.group)
push_frontend_feature_flag(:issue_assignees_widget, project)
push_frontend_feature_flag(:realtime_labels, project)
push_force_frontend_feature_flag(:work_items, project&.work_items_feature_flag_enabled?)
......
......@@ -34,7 +34,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action only: [:show] do
push_frontend_feature_flag(:merge_request_widget_graphql, project)
push_frontend_feature_flag(:core_security_mr_widget_counts, project)
push_frontend_feature_flag(:confidential_notes, project)
push_frontend_feature_flag(:restructured_mr_widget, project)
push_frontend_feature_flag(:refactor_mr_widgets_extensions, project)
push_frontend_feature_flag(:refactor_code_quality_extension, project)
......
---
name: confidential_notes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52949
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/207474
milestone: '13.9'
type: development
group: group::product planning
default_enabled: true
......@@ -154,11 +154,7 @@ If an issue or merge request is locked and closed, you cannot reopen it.
> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/351143) in GitLab 14.10: you can only mark comments in issues and epics as confidential. Previously, it was also possible for comments in merge requests and snippets.
> - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87403) from "confidential comments" to "internal notes" in GitLab 15.0.
> - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87383) in GitLab 15.0.
FLAG:
On self-managed GitLab, by default this feature is available. To hide the feature,
ask an administrator to [disable the feature flag](../../administration/feature_flags.md) named `confidential_notes`.
On GitLab.com, this feature is available.
> - [Feature flag `confidential_notes`](https://gitlab.com/gitlab-org/gitlab/-/issues/362712) removed in GitLab 15.2.
You can add an internal note **to an issue or an epic**. It's then visible only to the following people:
......
......@@ -17,7 +17,6 @@ class Groups::EpicsController < Groups::ApplicationController
after_action :log_epic_show, only: :show
before_action do
push_frontend_feature_flag(:confidential_notes, @group, type: :development)
push_frontend_feature_flag(:realtime_labels, group)
push_frontend_feature_flag(:epic_color_highlight, @group)
end
......
......@@ -550,98 +550,74 @@ describe('issue_comment_form component', () => {
});
describe('confidential notes checkbox', () => {
describe('when confidentialNotes feature flag is `false`', () => {
const features = { confidentialNotes: false };
it('should render checkbox as unchecked by default', () => {
mountComponent({
mountFunction: mount,
initialData: { note: 'confidential note' },
noteableData: { ...notableDataMockCanUpdateIssuable },
});
it('should not render checkbox', () => {
const checkbox = findConfidentialNoteCheckbox();
expect(checkbox.exists()).toBe(true);
expect(checkbox.element.checked).toBe(false);
});
it.each`
noteableType | rendered | message
${'Issue'} | ${true} | ${'render'}
${'Epic'} | ${true} | ${'render'}
${'MergeRequest'} | ${false} | ${'not render'}
`(
'should $message checkbox when noteableType is $noteableType',
({ noteableType, rendered }) => {
mountComponent({
mountFunction: mount,
initialData: { note: 'confidential note' },
noteableData: { ...notableDataMockCanUpdateIssuable },
features,
noteableType,
initialData: { note: 'internal note' },
noteableData: { ...notableDataMockCanUpdateIssuable, noteableType },
});
const checkbox = findConfidentialNoteCheckbox();
expect(checkbox.exists()).toBe(false);
});
});
describe('when confidentialNotes feature flag is `true`', () => {
const features = { confidentialNotes: true };
expect(findConfidentialNoteCheckbox().exists()).toBe(rendered);
},
);
it('should render checkbox as unchecked by default', () => {
describe.each`
shouldCheckboxBeChecked
${true}
${false}
`('when checkbox value is `$shouldCheckboxBeChecked`', ({ shouldCheckboxBeChecked }) => {
it(`sets \`confidential\` to \`${shouldCheckboxBeChecked}\``, async () => {
mountComponent({
mountFunction: mount,
initialData: { note: 'confidential note' },
noteableData: { ...notableDataMockCanUpdateIssuable },
features,
});
const checkbox = findConfidentialNoteCheckbox();
expect(checkbox.exists()).toBe(true);
expect(checkbox.element.checked).toBe(false);
});
jest.spyOn(wrapper.vm, 'saveNote').mockResolvedValue({});
it.each`
noteableType | rendered | message
${'Issue'} | ${true} | ${'render'}
${'Epic'} | ${true} | ${'render'}
${'MergeRequest'} | ${false} | ${'not render'}
`(
'should $message checkbox when noteableType is $noteableType',
({ noteableType, rendered }) => {
mountComponent({
mountFunction: mount,
noteableType,
initialData: { note: 'internal note' },
noteableData: { ...notableDataMockCanUpdateIssuable, noteableType },
features,
});
expect(findConfidentialNoteCheckbox().exists()).toBe(rendered);
},
);
describe.each`
shouldCheckboxBeChecked
${true}
${false}
`('when checkbox value is `$shouldCheckboxBeChecked`', ({ shouldCheckboxBeChecked }) => {
it(`sets \`confidential\` to \`${shouldCheckboxBeChecked}\``, async () => {
mountComponent({
mountFunction: mount,
initialData: { note: 'confidential note' },
noteableData: { ...notableDataMockCanUpdateIssuable },
features,
});
jest.spyOn(wrapper.vm, 'saveNote').mockResolvedValue({});
const checkbox = findConfidentialNoteCheckbox();
const checkbox = findConfidentialNoteCheckbox();
// check checkbox
checkbox.element.checked = shouldCheckboxBeChecked;
checkbox.trigger('change');
await nextTick();
// check checkbox
checkbox.element.checked = shouldCheckboxBeChecked;
checkbox.trigger('change');
await nextTick();
// submit comment
findCommentButton().trigger('click');
// submit comment
findCommentButton().trigger('click');
const [providedData] = wrapper.vm.saveNote.mock.calls[0];
expect(providedData.data.note.confidential).toBe(shouldCheckboxBeChecked);
});
const [providedData] = wrapper.vm.saveNote.mock.calls[0];
expect(providedData.data.note.confidential).toBe(shouldCheckboxBeChecked);
});
});
describe('when user cannot update issuable', () => {
it('should not render checkbox', () => {
mountComponent({
mountFunction: mount,
noteableData: { ...notableDataMockCannotUpdateIssuable },
features,
});
expect(findConfidentialNoteCheckbox().exists()).toBe(false);
describe('when user cannot update issuable', () => {
it('should not render checkbox', () => {
mountComponent({
mountFunction: mount,
noteableData: { ...notableDataMockCannotUpdateIssuable },
});
expect(findConfidentialNoteCheckbox().exists()).toBe(false);
});
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment