Commit 713188ff authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'revert-30570' into 'master'

Revert 30570

See merge request gitlab-org/gitlab!31681
parents c76d3e2e 57523d68
...@@ -3,15 +3,7 @@ import $ from 'jquery'; ...@@ -3,15 +3,7 @@ import $ from 'jquery';
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import Autosize from 'autosize'; import Autosize from 'autosize';
import { import { GlAlert, GlIntersperse, GlLink, GlSprintf } from '@gitlab/ui';
GlAlert,
GlFormCheckbox,
GlIcon,
GlIntersperse,
GlLink,
GlSprintf,
GlTooltipDirective,
} from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
import Flash from '../../flash'; import Flash from '../../flash';
...@@ -32,7 +24,6 @@ import loadingButton from '../../vue_shared/components/loading_button.vue'; ...@@ -32,7 +24,6 @@ import loadingButton from '../../vue_shared/components/loading_button.vue';
import noteSignedOutWidget from './note_signed_out_widget.vue'; import noteSignedOutWidget from './note_signed_out_widget.vue';
import discussionLockedWidget from './discussion_locked_widget.vue'; import discussionLockedWidget from './discussion_locked_widget.vue';
import issuableStateMixin from '../mixins/issuable_state'; import issuableStateMixin from '../mixins/issuable_state';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default { export default {
name: 'CommentForm', name: 'CommentForm',
...@@ -45,16 +36,11 @@ export default { ...@@ -45,16 +36,11 @@ export default {
loadingButton, loadingButton,
TimelineEntryItem, TimelineEntryItem,
GlAlert, GlAlert,
GlFormCheckbox,
GlIcon,
GlIntersperse, GlIntersperse,
GlLink, GlLink,
GlSprintf, GlSprintf,
}, },
directives: { mixins: [issuableStateMixin],
GlTooltip: GlTooltipDirective,
},
mixins: [issuableStateMixin, glFeatureFlagsMixin()],
props: { props: {
noteableType: { noteableType: {
type: String, type: String,
...@@ -65,7 +51,6 @@ export default { ...@@ -65,7 +51,6 @@ export default {
return { return {
note: '', note: '',
noteType: constants.COMMENT, noteType: constants.COMMENT,
noteIsConfidential: false,
isSubmitting: false, isSubmitting: false,
isSubmitButtonDisabled: true, isSubmitButtonDisabled: true,
}; };
...@@ -153,9 +138,6 @@ export default { ...@@ -153,9 +138,6 @@ export default {
trackingLabel() { trackingLabel() {
return slugifyWithUnderscore(`${this.commentButtonTitle} button`); return slugifyWithUnderscore(`${this.commentButtonTitle} button`);
}, },
confidentialNotesEnabled() {
return Boolean(this.glFeatures.confidentialNotes);
},
}, },
watch: { watch: {
note(newNote) { note(newNote) {
...@@ -203,7 +185,6 @@ export default { ...@@ -203,7 +185,6 @@ export default {
note: { note: {
noteable_type: this.noteableType, noteable_type: this.noteableType,
noteable_id: this.getNoteableData.id, noteable_id: this.getNoteableData.id,
confidential: this.noteIsConfidential,
note: this.note, note: this.note,
}, },
merge_request_diff_head_sha: this.getNoteableData.diff_head_sha, merge_request_diff_head_sha: this.getNoteableData.diff_head_sha,
...@@ -304,7 +285,6 @@ export default { ...@@ -304,7 +285,6 @@ export default {
if (shouldClear) { if (shouldClear) {
this.note = ''; this.note = '';
this.noteIsConfidential = false;
this.resizeTextarea(); this.resizeTextarea();
this.$refs.markdownField.previewMarkdown = false; this.$refs.markdownField.previewMarkdown = false;
} }
...@@ -431,19 +411,6 @@ js-gfm-input js-autosize markdown-area js-vue-textarea qa-comment-input" ...@@ -431,19 +411,6 @@ js-gfm-input js-autosize markdown-area js-vue-textarea qa-comment-input"
</p> </p>
</gl-alert> </gl-alert>
<div class="note-form-actions"> <div class="note-form-actions">
<div v-if="confidentialNotesEnabled" class="js-confidential-note-toggle mb-4">
<gl-form-checkbox v-model="noteIsConfidential">
<gl-icon name="eye-slash" :size="12" />
{{ __('Mark this comment as private') }}
<gl-icon
v-gl-tooltip:tooltipcontainer.bottom
name="question"
:size="12"
:title="__('Private comments are accessible by internal staff only')"
class="gl-text-gray-800"
/>
</gl-form-checkbox>
</div>
<div <div
class="float-left btn-group class="float-left btn-group
append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown" append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown"
......
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import timeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import timeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import GitlabTeamMemberBadge from '~/vue_shared/components/user_avatar/badges/gitlab_team_member_badge.vue'; import GitlabTeamMemberBadge from '~/vue_shared/components/user_avatar/badges/gitlab_team_member_badge.vue';
...@@ -8,10 +7,6 @@ export default { ...@@ -8,10 +7,6 @@ export default {
components: { components: {
timeAgoTooltip, timeAgoTooltip,
GitlabTeamMemberBadge, GitlabTeamMemberBadge,
GlIcon,
},
directives: {
GlTooltip: GlTooltipDirective,
}, },
props: { props: {
author: { author: {
...@@ -49,11 +44,6 @@ export default { ...@@ -49,11 +44,6 @@ export default {
required: false, required: false,
default: true, default: true,
}, },
isConfidential: {
type: Boolean,
required: false,
default: false,
},
}, },
data() { data() {
return { return {
...@@ -170,32 +160,23 @@ export default { ...@@ -170,32 +160,23 @@ export default {
</span> </span>
</template> </template>
<span v-else>{{ __('A deleted user') }}</span> <span v-else>{{ __('A deleted user') }}</span>
<span class="note-headline-light note-headline-meta d-sm-inline-flex align-items-center"> <span class="note-headline-light note-headline-meta">
<span class="system-note-message"> <slot></slot> </span> <span class="system-note-message"> <slot></slot> </span>
<template v-if="createdAt"> <template v-if="createdAt">
<span ref="actionText" class="system-note-separator ml-1"> <span ref="actionText" class="system-note-separator">
<template v-if="actionText">{{ actionText }}</template> <template v-if="actionText">{{ actionText }}</template>
</span> </span>
<a <a
v-if="noteTimestampLink" v-if="noteTimestampLink"
ref="noteTimestampLink" ref="noteTimestampLink"
:href="noteTimestampLink" :href="noteTimestampLink"
class="note-timestamp system-note-separator mr-1" class="note-timestamp system-note-separator"
@click="updateTargetNoteHash" @click="updateTargetNoteHash"
> >
<time-ago-tooltip :time="createdAt" tooltip-placement="bottom" /> <time-ago-tooltip :time="createdAt" tooltip-placement="bottom" />
</a> </a>
<time-ago-tooltip v-else ref="noteTimestamp" :time="createdAt" tooltip-placement="bottom" /> <time-ago-tooltip v-else ref="noteTimestamp" :time="createdAt" tooltip-placement="bottom" />
</template> </template>
<gl-icon
v-if="isConfidential"
ref="confidentialIndicator"
v-gl-tooltip:tooltipcontainer.bottom
name="eye-slash"
:size="14"
:title="__('Private comments are accessible by internal staff only')"
class="mx-1 gl-text-gray-800"
/>
<slot name="extra-controls"></slot> <slot name="extra-controls"></slot>
<i <i
v-if="showSpinner" v-if="showSpinner"
......
...@@ -255,13 +255,7 @@ export default { ...@@ -255,13 +255,7 @@ export default {
</div> </div>
<div class="timeline-content"> <div class="timeline-content">
<div class="note-header"> <div class="note-header">
<note-header <note-header v-once :author="author" :created-at="note.created_at" :note-id="note.id">
v-once
:author="author"
:created-at="note.created_at"
:note-id="note.id"
:is-confidential="note.confidential"
>
<slot slot="note-header-info" name="note-header-info"></slot> <slot slot="note-header-info" name="note-header-info"></slot>
<span v-if="commit" v-html="actionText"></span> <span v-if="commit" v-html="actionText"></span>
<span v-else class="d-none d-sm-inline">&middot;</span> <span v-else class="d-none d-sm-inline">&middot;</span>
......
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
<span v-html="actionTextHtml"></span> <span v-html="actionTextHtml"></span>
<template v-if="canSeeDescriptionVersion" slot="extra-controls"> <template v-if="canSeeDescriptionVersion" slot="extra-controls">
&middot; &middot;
<button type="button" class="btn-blank btn-link ml-1" @click="toggleDescriptionVersion"> <button type="button" class="btn-blank btn-link" @click="toggleDescriptionVersion">
{{ __('Compare with previous version') }} {{ __('Compare with previous version') }}
<icon :name="descriptionVersionToggleIcon" :size="12" class="append-left-5" /> <icon :name="descriptionVersionToggleIcon" :size="12" class="append-left-5" />
</button> </button>
......
...@@ -660,6 +660,10 @@ $note-form-margin-left: 72px; ...@@ -660,6 +660,10 @@ $note-form-margin-left: 72px;
padding-bottom: 0; padding-bottom: 0;
} }
.note-headline-light {
display: inline;
}
.note-headline-light, .note-headline-light,
.discussion-headline-light { .discussion-headline-light {
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
......
...@@ -51,7 +51,6 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -51,7 +51,6 @@ class Projects::IssuesController < Projects::ApplicationController
before_action only: :show do before_action only: :show do
push_frontend_feature_flag(:real_time_issue_sidebar, @project) push_frontend_feature_flag(:real_time_issue_sidebar, @project)
push_frontend_feature_flag(:confidential_notes, @project)
end end
around_action :allow_gitaly_ref_name_caching, only: [:discussions] around_action :allow_gitaly_ref_name_caching, only: [:discussions]
......
---
title: Add confidential status support for new comments
merge_request: 30570
author:
type: added
---
title: Fix missing space on system notes
merge_request: 31598
author:
type: fixed
...@@ -12788,9 +12788,6 @@ msgstr "" ...@@ -12788,9 +12788,6 @@ msgstr ""
msgid "Mark comment as resolved" msgid "Mark comment as resolved"
msgstr "" msgstr ""
msgid "Mark this comment as private"
msgstr ""
msgid "Mark this issue as a duplicate of another issue" msgid "Mark this issue as a duplicate of another issue"
msgstr "" msgstr ""
...@@ -15592,9 +15589,6 @@ msgstr "" ...@@ -15592,9 +15589,6 @@ msgstr ""
msgid "Private - The group and its projects can only be viewed by members." msgid "Private - The group and its projects can only be viewed by members."
msgstr "" msgstr ""
msgid "Private comments are accessible by internal staff only"
msgstr ""
msgid "Private group(s)" msgid "Private group(s)"
msgstr "" msgstr ""
......
...@@ -24,7 +24,6 @@ describe('issue_comment_form component', () => { ...@@ -24,7 +24,6 @@ describe('issue_comment_form component', () => {
let store; let store;
let wrapper; let wrapper;
let axiosMock; let axiosMock;
let features = {};
const setupStore = (userData, noteableData) => { const setupStore = (userData, noteableData) => {
store.dispatch('setUserData', userData); store.dispatch('setUserData', userData);
...@@ -38,16 +37,12 @@ describe('issue_comment_form component', () => { ...@@ -38,16 +37,12 @@ describe('issue_comment_form component', () => {
noteableType, noteableType,
}, },
store, store,
provide: {
glFeatures: features,
},
}); });
}; };
beforeEach(() => { beforeEach(() => {
axiosMock = new MockAdapter(axios); axiosMock = new MockAdapter(axios);
store = createStore(); store = createStore();
features = {};
}); });
afterEach(() => { afterEach(() => {
...@@ -303,32 +298,6 @@ describe('issue_comment_form component', () => { ...@@ -303,32 +298,6 @@ describe('issue_comment_form component', () => {
}); });
}); });
}); });
describe('when note can be confidential', () => {
it('appends confidential status to note payload when saving', () => {
jest.spyOn(wrapper.vm, 'saveNote').mockReturnValue(new Promise(() => {}));
wrapper.vm.note = 'confidential note';
return wrapper.vm.$nextTick().then(() => {
wrapper.find('.js-comment-submit-button').trigger('click');
const [providedData] = wrapper.vm.saveNote.mock.calls[0];
expect(providedData.data.note.confidential).toBe(false);
});
});
it('should render confidential toggle as false', () => {
features = { confidentialNotes: true };
mountComponent();
const input = wrapper.find('.js-confidential-note-toggle .form-check-input');
expect(input.exists()).toBe(true);
expect(input.attributes('checked')).toBeFalsy();
});
});
}); });
describe('issue is confidential', () => { describe('issue is confidential', () => {
......
...@@ -19,7 +19,6 @@ describe('NoteHeader component', () => { ...@@ -19,7 +19,6 @@ describe('NoteHeader component', () => {
const findActionText = () => wrapper.find({ ref: 'actionText' }); const findActionText = () => wrapper.find({ ref: 'actionText' });
const findTimestampLink = () => wrapper.find({ ref: 'noteTimestampLink' }); const findTimestampLink = () => wrapper.find({ ref: 'noteTimestampLink' });
const findTimestamp = () => wrapper.find({ ref: 'noteTimestamp' }); const findTimestamp = () => wrapper.find({ ref: 'noteTimestamp' });
const findConfidentialIndicator = () => wrapper.find({ ref: 'confidentialIndicator' });
const findSpinner = () => wrapper.find({ ref: 'spinner' }); const findSpinner = () => wrapper.find({ ref: 'spinner' });
const author = { const author = {
...@@ -247,15 +246,4 @@ describe('NoteHeader component', () => { ...@@ -247,15 +246,4 @@ describe('NoteHeader component', () => {
}); });
}); });
}); });
describe('with confidentiality indicator', () => {
it.each`
status | condition
${true} | ${'shows'}
${false} | ${'hides'}
`('$condition icon indicator when isConfidential is $status', ({ status }) => {
createComponent({ isConfidential: status });
expect(findConfidentialIndicator().exists()).toBe(status);
});
});
}); });
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