Commit b91d3f8e authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '223279-confidential-warning-doesnt-show-the-issuable-type' into 'master'

Resolve "Confidential warning doesnt show the issuable type"

See merge request gitlab-org/gitlab!34988
parents 60a366b0 327bc236
...@@ -8,16 +8,10 @@ function buildDocsLinkStart(path) { ...@@ -8,16 +8,10 @@ function buildDocsLinkStart(path) {
return `<a href="${escape(path)}" target="_blank" rel="noopener noreferrer">`; return `<a href="${escape(path)}" target="_blank" rel="noopener noreferrer">`;
} }
const NoteableType = {
Issue: 'issue',
Epic: 'epic',
MergeRequest: 'merge_request',
};
const NoteableTypeText = { const NoteableTypeText = {
[NoteableType.Issue]: __('issue'), Issue: __('issue'),
[NoteableType.Epic]: __('epic'), Epic: __('epic'),
[NoteableType.MergeRequest]: __('merge request'), MergeRequest: __('merge request'),
}; };
export default { export default {
...@@ -39,7 +33,8 @@ export default { ...@@ -39,7 +33,8 @@ export default {
noteableType: { noteableType: {
type: String, type: String,
required: false, required: false,
default: NoteableType.Issue, // eslint-disable-next-line @gitlab/require-i18n-strings
default: 'Issue',
}, },
lockedNoteableDocsPath: { lockedNoteableDocsPath: {
type: String, type: String,
......
---
title: Fix confidential warning not showing the issuable type
merge_request: 34988
author:
type: fixed
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
#js-vue-notes{ data: { notes_data: notes_data(@epic).to_json, #js-vue-notes{ data: { notes_data: notes_data(@epic).to_json,
noteable_data: EpicSerializer.new(current_user: current_user).represent(@epic).to_json, noteable_data: EpicSerializer.new(current_user: current_user).represent(@epic).to_json,
current_user_data: UserSerializer.new.represent(current_user, { only_path: true }, CurrentUserEntity).to_json, current_user_data: UserSerializer.new.represent(current_user, { only_path: true }, CurrentUserEntity).to_json,
noteable_type: 'epic' } } noteable_type: 'Epic' } }
...@@ -60,9 +60,12 @@ describe('Issue Warning Component', () => { ...@@ -60,9 +60,12 @@ describe('Issue Warning Component', () => {
}); });
}); });
it('renders information about confidential issue', () => { it('renders information about confidential issue', async () => {
expect(findConfidentialBlock().exists()).toBe(true); expect(findConfidentialBlock().exists()).toBe(true);
expect(findConfidentialBlock().element).toMatchSnapshot(); expect(findConfidentialBlock().element).toMatchSnapshot();
await wrapper.vm.$nextTick();
expect(findConfidentialBlock(wrapper).text()).toContain('This is a confidential issue.');
}); });
it('renders warning icon', () => { it('renders warning icon', () => {
...@@ -142,13 +145,13 @@ describe('Issue Warning Component', () => { ...@@ -142,13 +145,13 @@ describe('Issue Warning Component', () => {
it('renders confidential & locked messages with noteable "epic"', async () => { it('renders confidential & locked messages with noteable "epic"', async () => {
wrapperLocked.setProps({ wrapperLocked.setProps({
noteableType: 'epic', noteableType: 'Epic',
}); });
wrapperConfidential.setProps({ wrapperConfidential.setProps({
noteableType: 'epic', noteableType: 'Epic',
}); });
wrapperLockedAndConfidential.setProps({ wrapperLockedAndConfidential.setProps({
noteableType: 'epic', noteableType: 'Epic',
}); });
await wrapperLocked.vm.$nextTick(); await wrapperLocked.vm.$nextTick();
...@@ -167,13 +170,13 @@ describe('Issue Warning Component', () => { ...@@ -167,13 +170,13 @@ describe('Issue Warning Component', () => {
it('renders confidential & locked messages with noteable "merge request"', async () => { it('renders confidential & locked messages with noteable "merge request"', async () => {
wrapperLocked.setProps({ wrapperLocked.setProps({
noteableType: 'merge_request', noteableType: 'MergeRequest',
}); });
wrapperConfidential.setProps({ wrapperConfidential.setProps({
noteableType: 'merge_request', noteableType: 'MergeRequest',
}); });
wrapperLockedAndConfidential.setProps({ wrapperLockedAndConfidential.setProps({
noteableType: 'merge_request', noteableType: 'MergeRequest',
}); });
await wrapperLocked.vm.$nextTick(); await wrapperLocked.vm.$nextTick();
......
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