Skip to content
Snippets Groups Projects
Commit 08189dc9 authored by Kushal Pandya's avatar Kushal Pandya
Browse files

Rename confidential refs to internal

Rename confidential note references to internal
as notes are internal and not confidential.

Changelog: other
EE: true
parent e7288437
No related branches found
No related tags found
1 merge request!89140Rename confidential note references to internal notes
Pipeline #554916626 passed
Pipeline: GitLab

#554931047

    Showing
    with 74 additions and 70 deletions
    ......@@ -14,7 +14,7 @@ export default {
    type: Object,
    required: true,
    },
    noteIsConfidential: {
    isInternalNote: {
    type: Boolean,
    required: false,
    default: false,
    ......@@ -44,7 +44,7 @@ export default {
    return this.noteableData.issue_email_participants?.map(({ email }) => email) || [];
    },
    showEmailParticipantsWarning() {
    return this.emailParticipants.length && !this.noteIsConfidential;
    return this.emailParticipants.length && !this.isInternalNote;
    },
    },
    };
    ......
    ......@@ -60,7 +60,7 @@ export default {
    note: '',
    noteType: constants.COMMENT,
    errors: [],
    noteIsConfidential: false,
    noteIsInternal: false,
    isSubmitting: false,
    };
    },
    ......@@ -91,13 +91,13 @@ export default {
    },
    commentButtonTitle() {
    const { comment, internalComment, startThread, startInternalThread } = this.$options.i18n;
    if (this.noteIsConfidential) {
    if (this.noteIsInternal) {
    return this.noteType === constants.COMMENT ? internalComment : startInternalThread;
    }
    return this.noteType === constants.COMMENT ? comment : startThread;
    },
    textareaPlaceholder() {
    return this.noteIsConfidential
    return this.noteIsInternal
    ? this.$options.i18n.bodyPlaceholderInternal
    : this.$options.i18n.bodyPlaceholder;
    },
    ......@@ -110,7 +110,7 @@ export default {
    canCreateNote() {
    return this.getNoteableData.current_user.can_create_note;
    },
    canSetConfidential() {
    canSetInternalNote() {
    return this.getNoteableData.current_user.can_update && (this.isIssue || this.isEpic);
    },
    issueActionButtonTitle() {
    ......@@ -172,7 +172,7 @@ export default {
    trackingLabel() {
    return slugifyWithUnderscore(`${this.commentButtonTitle} button`);
    },
    confidentialNotesEnabled() {
    internalNotesEnabled() {
    return Boolean(this.glFeatures.confidentialNotes);
    },
    disableSubmitButton() {
    ......@@ -217,7 +217,11 @@ export default {
    note: {
    noteable_type: this.noteableType,
    noteable_id: this.getNoteableData.id,
    confidential: this.noteIsConfidential,
    // Internal notes were identified as `confidential`
    // before we decided to treat them as _internal_
    // so now until API is updated we need to use `confidential`
    // in request payload.
    confidential: this.noteIsInternal,
    note: this.note,
    },
    merge_request_diff_head_sha: this.getNoteableData.diff_head_sha,
    ......@@ -292,7 +296,7 @@ export default {
    if (shouldClear) {
    this.note = '';
    this.noteIsConfidential = false;
    this.noteIsInternal = false;
    this.resizeTextarea();
    this.$refs.markdownField.previewMarkdown = false;
    }
    ......@@ -356,7 +360,7 @@ export default {
    <comment-field-layout
    :with-alert-container="true"
    :noteable-data="getNoteableData"
    :note-is-confidential="noteIsConfidential"
    :is-internal-note="noteIsInternal"
    :noteable-type="noteableType"
    >
    <markdown-field
    ......@@ -410,17 +414,17 @@ export default {
    </template>
    <template v-else>
    <gl-form-checkbox
    v-if="confidentialNotesEnabled && canSetConfidential"
    v-model="noteIsConfidential"
    v-if="internalNotesEnabled && canSetInternalNote"
    v-model="noteIsInternal"
    class="gl-mb-6"
    data-testid="confidential-note-checkbox"
    data-testid="internal-note-checkbox"
    >
    {{ $options.i18n.confidential }}
    {{ $options.i18n.internal }}
    <gl-icon
    v-gl-tooltip:tooltipcontainer.bottom
    name="question"
    :size="16"
    :title="$options.i18n.confidentialVisibility"
    :title="$options.i18n.internalVisibility"
    class="gl-text-gray-500"
    />
    </gl-form-checkbox>
    ......@@ -429,7 +433,7 @@ export default {
    class="gl-mr-3"
    :disabled="disableSubmitButton"
    :tracking-label="trackingLabel"
    :is-internal-note="noteIsConfidential"
    :is-internal-note="noteIsInternal"
    :noteable-display-name="noteableDisplayName"
    :discussions-require-resolution="discussionsRequireResolution"
    @click="handleSave"
    ......
    ......@@ -8,7 +8,7 @@ import { __ } from '~/locale';
    import '~/behaviors/markdown/render_gfm';
    import Suggestions from '~/vue_shared/components/markdown/suggestions.vue';
    import autosave from '../mixins/autosave';
    import { CONFIDENTIAL_CLASSES } from '../constants';
    import { INTERNAL_NOTE_CLASSES } from '../constants';
    import noteAttachment from './note_attachment.vue';
    import noteAwardsList from './note_awards_list.vue';
    import noteEditedText from './note_edited_text.vue';
    ......@@ -55,7 +55,7 @@ export default {
    required: false,
    default: '',
    },
    isConfidential: {
    isInternalNote: {
    type: Boolean,
    required: false,
    default: false,
    ......@@ -101,9 +101,9 @@ export default {
    return escape(suggestion);
    },
    confidentialContainerClasses() {
    if (this.isConfidential && !this.isEditing) {
    return CONFIDENTIAL_CLASSES;
    internalNoteContainerClasses() {
    if (this.isInternalNote && !this.isEditing) {
    return INTERNAL_NOTE_CLASSES;
    }
    return '';
    },
    ......@@ -179,7 +179,7 @@ export default {
    }"
    class="note-body"
    >
    <div :class="confidentialContainerClasses" data-testid="note-confidential-container">
    <div :class="internalNoteContainerClasses" data-testid="note-internal-container">
    <suggestions
    v-if="hasSuggestion && !isEditing"
    :suggestions="note.suggestions"
    ......
    ......@@ -329,7 +329,7 @@ export default {
    <form :data-line-code="lineCode" class="edit-note common-note-form js-quick-submit gfm-form">
    <comment-field-layout
    :noteable-data="getNoteableData"
    :note-is-confidential="discussion.confidential"
    :is-internal-note="discussion.confidential"
    >
    <markdown-field
    :markdown-preview-path="markdownPreviewPath"
    ......
    ......@@ -67,7 +67,7 @@ export default {
    required: false,
    default: true,
    },
    isConfidential: {
    isInternalNote: {
    type: Boolean,
    required: false,
    default: false,
    ......@@ -110,7 +110,7 @@ export default {
    authorName() {
    return this.author.name;
    },
    noteConfidentialityTooltip() {
    internalNoteTooltip() {
    return s__('Notes|This internal note will always remain confidential');
    },
    },
    ......@@ -231,13 +231,13 @@ export default {
    <time-ago-tooltip v-else ref="noteTimestamp" :time="createdAt" tooltip-placement="bottom" />
    </template>
    <gl-badge
    v-if="isConfidential"
    v-if="isInternalNote"
    v-gl-tooltip:tooltipcontainer.bottom
    data-testid="internalNoteIndicator"
    variant="warning"
    size="sm"
    class="gl-mb-3 gl-ml-2"
    :title="noteConfidentialityTooltip"
    :title="internalNoteTooltip"
    >
    {{ __('Internal note') }}
    </gl-badge>
    ......
    ......@@ -447,7 +447,7 @@ export default {
    :author="author"
    :created-at="note.created_at"
    :note-id="note.id"
    :is-confidential="note.confidential"
    :is-internal-note="note.confidential"
    :noteable-type="noteableType"
    >
    <template #note-header-info>
    ......@@ -494,7 +494,7 @@ export default {
    ref="noteBody"
    :note="note"
    :can-edit="note.current_user.can_edit"
    :is-confidential="note.confidential"
    :is-internal-note="note.confidential"
    :line="line"
    :file="diffFile"
    :is-editing="isEditing"
    ......
    ......@@ -52,4 +52,4 @@ export const toggleStateErrorMessage = {
    },
    };
    export const CONFIDENTIAL_CLASSES = ['gl-bg-orange-50', 'gl-px-4', 'gl-py-2'];
    export const INTERNAL_NOTE_CLASSES = ['gl-bg-orange-50', 'gl-px-4', 'gl-py-2'];
    ......@@ -14,8 +14,8 @@ export const COMMENT_FORM = {
    epic: __('epic'),
    bodyPlaceholder: __('Write a comment or drag your files here…'),
    bodyPlaceholderInternal: __('Write an internal note or drag your files here…'),
    confidential: s__('Notes|Make this an internal note'),
    confidentialVisibility: s__(
    internal: s__('Notes|Make this an internal note'),
    internalVisibility: s__(
    'Notes|Internal notes are only visible to the author, assignees, and members with the role of Reporter or higher',
    ),
    discussionThatNeedsResolution: __(
    ......
    ......@@ -48,8 +48,8 @@ describe('NoteHeader component', () => {
    },
    );
    it('shows confidential indicator tooltip for group context when isConfidential is true for epics', () => {
    createComponent({ isConfidential: true, noteableType: 'epic' });
    it('shows internal note badge tooltip for group context when isInternalNote is true for epics', () => {
    createComponent({ isInternalNote: true, noteableType: 'epic' });
    expect(wrapper.findByTestId('internalNoteIndicator').attributes('title')).toBe(
    'This internal note will always remain confidential',
    ......
    ......@@ -135,14 +135,14 @@ describe('Comment Field Layout Component', () => {
    });
    });
    describe('issue has email participants, but note is confidential', () => {
    describe('issue has email participants, but note is internal', () => {
    it('does not show EmailParticipantsWarning', () => {
    createWrapper({
    noteableData: {
    ...noteableDataMock,
    issue_email_participants: [{ email: 'someone@gitlab.com' }],
    },
    noteIsConfidential: true,
    isInternalNote: true,
    });
    expect(findEmailParticipantsWarning().exists()).toBe(false);
    ......
    ......@@ -32,7 +32,7 @@ describe('issue_comment_form component', () => {
    const findTextArea = () => wrapper.findByTestId('comment-field');
    const findAddToReviewButton = () => wrapper.findByTestId('add-to-review-button');
    const findAddCommentNowButton = () => wrapper.findByTestId('add-comment-now-button');
    const findConfidentialNoteCheckbox = () => wrapper.findByTestId('confidential-note-checkbox');
    const findConfidentialNoteCheckbox = () => wrapper.findByTestId('internal-note-checkbox');
    const findCommentTypeDropdown = () => wrapper.findComponent(CommentTypeDropdown);
    const findCommentButton = () => findCommentTypeDropdown().find('button');
    const findErrorAlerts = () => wrapper.findAllComponents(GlAlert).wrappers;
    ......@@ -249,15 +249,15 @@ describe('issue_comment_form component', () => {
    describe('textarea', () => {
    describe('general', () => {
    it.each`
    noteType | confidential | placeholder
    ${'comment'} | ${false} | ${'Write a comment or drag your files here…'}
    ${'internal note'} | ${true} | ${'Write an internal note or drag your files here…'}
    noteType | noteIsInternal | placeholder
    ${'comment'} | ${false} | ${'Write a comment or drag your files here…'}
    ${'internal note'} | ${true} | ${'Write an internal note or drag your files here…'}
    `(
    'should render textarea with placeholder for $noteType',
    ({ confidential, placeholder }) => {
    ({ noteIsInternal, placeholder }) => {
    mountComponent({
    mountFunction: mount,
    initialData: { noteIsConfidential: confidential },
    initialData: { noteIsInternal },
    });
    expect(findTextArea().attributes('placeholder')).toBe(placeholder);
    ......@@ -389,14 +389,14 @@ describe('issue_comment_form component', () => {
    });
    it.each`
    confidential | buttonText
    ${false} | ${'Comment'}
    ${true} | ${'Add internal note'}
    `('renders comment button with text "$buttonText"', ({ confidential, buttonText }) => {
    noteIsInternal | buttonText
    ${false} | ${'Comment'}
    ${true} | ${'Add internal note'}
    `('renders comment button with text "$buttonText"', ({ noteIsInternal, buttonText }) => {
    mountComponent({
    mountFunction: mount,
    noteableData: createNotableDataMock({ confidential }),
    initialData: { noteIsConfidential: confidential },
    noteableData: createNotableDataMock({ confidential: noteIsInternal }),
    initialData: { noteIsInternal },
    });
    expect(findCommentButton().text()).toBe(buttonText);
    ......
    ......@@ -7,7 +7,7 @@ import NoteAwardsList from '~/notes/components/note_awards_list.vue';
    import NoteForm from '~/notes/components/note_form.vue';
    import createStore from '~/notes/stores';
    import notes from '~/notes/stores/modules/index';
    import { CONFIDENTIAL_CLASSES } from '~/notes/constants';
    import { INTERNAL_NOTE_CLASSES } from '~/notes/constants';
    import Suggestions from '~/vue_shared/components/markdown/suggestions.vue';
    ......@@ -59,20 +59,20 @@ describe('issue_note_body component', () => {
    expect(wrapper.findComponent(NoteAwardsList).exists()).toBe(true);
    });
    it('should not have confidential classes', () => {
    expect(wrapper.findByTestId('note-confidential-container').classes()).not.toEqual(
    CONFIDENTIAL_CLASSES,
    it('should not have internal note classes', () => {
    expect(wrapper.findByTestId('note-internal-container').classes()).not.toEqual(
    INTERNAL_NOTE_CLASSES,
    );
    });
    describe('isConfidential', () => {
    describe('isInternalNote', () => {
    beforeEach(() => {
    wrapper = createComponent({ props: { isConfidential: true } });
    wrapper = createComponent({ props: { isInternalNote: true } });
    });
    it('should have confidential classes', () => {
    expect(wrapper.findByTestId('note-confidential-container').classes()).toEqual(
    CONFIDENTIAL_CLASSES,
    it('should have internal note classes', () => {
    expect(wrapper.findByTestId('note-internal-container').classes()).toEqual(
    INTERNAL_NOTE_CLASSES,
    );
    });
    });
    ......@@ -106,14 +106,14 @@ describe('issue_note_body component', () => {
    expect(wrapper.vm.autosave.key).toEqual(autosaveKey);
    });
    describe('isConfidential', () => {
    describe('isInternalNote', () => {
    beforeEach(() => {
    wrapper.setProps({ isConfidential: true });
    wrapper.setProps({ isInternalNote: true });
    });
    it('should not have confidential classes', () => {
    expect(wrapper.findByTestId('note-confidential-container').classes()).not.toEqual(
    CONFIDENTIAL_CLASSES,
    it('should not have internal note classes', () => {
    expect(wrapper.findByTestId('note-internal-container').classes()).not.toEqual(
    INTERNAL_NOTE_CLASSES,
    );
    });
    });
    ......
    ......@@ -21,7 +21,7 @@ describe('NoteHeader component', () => {
    const findActionText = () => wrapper.find({ ref: 'actionText' });
    const findTimestampLink = () => wrapper.find({ ref: 'noteTimestampLink' });
    const findTimestamp = () => wrapper.find({ ref: 'noteTimestamp' });
    const findConfidentialIndicator = () => wrapper.findByTestId('internalNoteIndicator');
    const findInternalNoteIndicator = () => wrapper.findByTestId('internalNoteIndicator');
    const findSpinner = () => wrapper.find({ ref: 'spinner' });
    const findAuthorStatus = () => wrapper.find({ ref: 'authorStatus' });
    ......@@ -283,20 +283,20 @@ describe('NoteHeader component', () => {
    });
    });
    describe('with confidentiality indicator', () => {
    describe('with internal note badge', () => {
    it.each`
    status | condition
    ${true} | ${'shows'}
    ${false} | ${'hides'}
    `('$condition icon indicator when isConfidential is $status', ({ status }) => {
    createComponent({ isConfidential: status });
    expect(findConfidentialIndicator().exists()).toBe(status);
    `('$condition badge when isInternalNote is $status', ({ status }) => {
    createComponent({ isInternalNote: status });
    expect(findInternalNoteIndicator().exists()).toBe(status);
    });
    it('shows confidential indicator tooltip for project context', () => {
    createComponent({ isConfidential: true, noteableType: 'issue' });
    it('shows internal note badge tooltip for project context', () => {
    createComponent({ isInternalNote: true, noteableType: 'issue' });
    expect(findConfidentialIndicator().attributes('title')).toBe(
    expect(findInternalNoteIndicator().attributes('title')).toBe(
    'This internal note will always remain confidential',
    );
    });
    ......
    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