Commit fc7e5768 authored by Mark Florian's avatar Mark Florian

Merge branch '222346-remove-issue-note-from-vulnerability-details' into 'master'

Remove issue note from vulnerability details

See merge request gitlab-org/gitlab!40686
parents a875925c 3b146415
<script> <script>
import Visibility from 'visibilityjs'; import Visibility from 'visibilityjs';
import IssueNote from 'ee/vue_shared/security_reports/components/issue_note.vue';
import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card.vue'; import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card.vue';
import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_request_note.vue'; import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_request_note.vue';
import Api from 'ee/api'; import Api from 'ee/api';
...@@ -18,7 +17,6 @@ import initUserPopovers from '~/user_popovers'; ...@@ -18,7 +17,6 @@ import initUserPopovers from '~/user_popovers';
export default { export default {
name: 'VulnerabilityFooter', name: 'VulnerabilityFooter',
components: { components: {
IssueNote,
SolutionCard, SolutionCard,
MergeRequestNote, MergeRequestNote,
HistoryEntry, HistoryEntry,
...@@ -208,18 +206,8 @@ export default { ...@@ -208,18 +206,8 @@ export default {
<div data-qa-selector="vulnerability_footer"> <div data-qa-selector="vulnerability_footer">
<solution-card v-if="hasSolution" v-bind="solutionInfo" /> <solution-card v-if="hasSolution" v-bind="solutionInfo" />
<div <div v-if="vulnerability.merge_request_feedback" class="card gl-mt-5">
v-if="vulnerability.issue_feedback || vulnerability.merge_request_feedback"
class="card gl-mt-5"
>
<issue-note
v-if="vulnerability.issue_feedback"
:feedback="vulnerability.issue_feedback"
:project="project"
class="card-body"
/>
<merge-request-note <merge-request-note
v-if="vulnerability.merge_request_feedback"
:feedback="vulnerability.merge_request_feedback" :feedback="vulnerability.merge_request_feedback"
:project="project" :project="project"
class="card-body" class="card-body"
......
---
title: Remove issue note from vulnerability details
merge_request: 40686
author:
type: changed
...@@ -6,7 +6,6 @@ import RelatedIssues from 'ee/vulnerabilities/components/related_issues.vue'; ...@@ -6,7 +6,6 @@ import RelatedIssues from 'ee/vulnerabilities/components/related_issues.vue';
import StatusDescription from 'ee/vulnerabilities/components/status_description.vue'; import StatusDescription from 'ee/vulnerabilities/components/status_description.vue';
import { VULNERABILITY_STATES } from 'ee/vulnerabilities/constants'; import { VULNERABILITY_STATES } from 'ee/vulnerabilities/constants';
import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card.vue'; import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card.vue';
import IssueNote from 'ee/vue_shared/security_reports/components/issue_note.vue';
import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_request_note.vue'; import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_request_note.vue';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -81,23 +80,21 @@ describe('Vulnerability Footer', () => { ...@@ -81,23 +80,21 @@ describe('Vulnerability Footer', () => {
}); });
}); });
describe.each` describe('merge request note', () => {
type | prop | component const mergeRequestNote = () => wrapper.find(MergeRequestNote);
${'issue'} | ${'issue_feedback'} | ${IssueNote}
${'merge request'} | ${'merge_request_feedback'} | ${MergeRequestNote}
`('$type note', ({ prop, component }) => {
// The object itself does not matter, we just want to make sure it's passed to the issue note.
const feedback = {};
it('shows issue note when an issue exists for the vulnerability', () => {
createWrapper({ [prop]: feedback });
expect(wrapper.find(component).exists()).toBe(true);
expect(wrapper.find(component).props('feedback')).toBe(feedback);
});
it('does not show issue note when there is no issue for the vulnerability', () => { it('does not show merge request note when a merge request does not exist for the vulnerability', () => {
createWrapper(); createWrapper();
expect(wrapper.find(component).exists()).toBe(false); expect(mergeRequestNote().exists()).toBe(false);
});
it('shows merge request note when a merge request exists for the vulnerability', () => {
// The object itself does not matter, we just want to make sure it's passed to the issue note.
const mergeRequestFeedback = {};
createWrapper({ merge_request_feedback: mergeRequestFeedback });
expect(mergeRequestNote().exists()).toBe(true);
expect(mergeRequestNote().props('feedback')).toBe(mergeRequestFeedback);
}); });
}); });
......
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