Commit d5c8479f authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'issue_233813' into 'master'

Issue 233813 - Remove confusing text and url on vulnerability finding modal

See merge request gitlab-org/gitlab!43698
parents 5262e3b1 26a9a600
...@@ -64,10 +64,6 @@ export default { ...@@ -64,10 +64,6 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
vulnerabilityFeedbackHelpPath: {
type: String,
required: true,
},
loadingErrorIllustrations: { loadingErrorIllustrations: {
type: Object, type: Object,
required: true, required: true,
...@@ -117,7 +113,6 @@ export default { ...@@ -117,7 +113,6 @@ export default {
/> />
<security-dashboard <security-dashboard
:vulnerabilities-endpoint="vulnerabilitiesEndpoint" :vulnerabilities-endpoint="vulnerabilitiesEndpoint"
:vulnerability-feedback-help-path="vulnerabilityFeedbackHelpPath"
:lock-to-project="{ id: projectId }" :lock-to-project="{ id: projectId }"
:pipeline-id="pipelineId" :pipeline-id="pipelineId"
:loading-error-illustrations="loadingErrorIllustrations" :loading-error-illustrations="loadingErrorIllustrations"
......
...@@ -38,10 +38,6 @@ export default { ...@@ -38,10 +38,6 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
vulnerabilityFeedbackHelpPath: {
type: String,
required: true,
},
vulnerableProjectsEndpoint: { vulnerableProjectsEndpoint: {
type: String, type: String,
required: false, required: false,
...@@ -193,7 +189,6 @@ export default { ...@@ -193,7 +189,6 @@ export default {
<issue-modal <issue-modal
:modal="modal" :modal="modal"
:vulnerability-feedback-help-path="vulnerabilityFeedbackHelpPath"
:can-create-issue="canCreateIssue" :can-create-issue="canCreateIssue"
:can-create-merge-request="canCreateMergeRequest" :can-create-merge-request="canCreateMergeRequest"
:can-dismiss-vulnerability="canDismissVulnerability" :can-dismiss-vulnerability="canDismissVulnerability"
......
...@@ -20,7 +20,6 @@ export default () => { ...@@ -20,7 +20,6 @@ export default () => {
projectId, projectId,
sourceBranch, sourceBranch,
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
vulnerabilityFeedbackHelpPath,
emptyStateUnauthorizedSvgPath, emptyStateUnauthorizedSvgPath,
emptyStateForbiddenSvgPath, emptyStateForbiddenSvgPath,
projectFullPath, projectFullPath,
...@@ -45,7 +44,6 @@ export default () => { ...@@ -45,7 +44,6 @@ export default () => {
pipelineId: parseInt(pipelineId, 10), pipelineId: parseInt(pipelineId, 10),
pipelineIid: parseInt(pipelineIid, 10), pipelineIid: parseInt(pipelineIid, 10),
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
vulnerabilityFeedbackHelpPath,
sourceBranch, sourceBranch,
dashboardDocumentation, dashboardDocumentation,
emptyStateSvgPath, emptyStateSvgPath,
......
...@@ -27,11 +27,6 @@ export default { ...@@ -27,11 +27,6 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
vulnerabilityFeedbackHelpPath: {
type: String,
required: false,
default: '',
},
canCreateIssue: { canCreateIssue: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -205,7 +200,6 @@ export default { ...@@ -205,7 +200,6 @@ export default {
:remediation="remediation" :remediation="remediation"
:has-mr="vulnerability.hasMergeRequest" :has-mr="vulnerability.hasMergeRequest"
:has-download="canDownloadPatchForThisVulnerability" :has-download="canDownloadPatchForThisVulnerability"
:vulnerability-feedback-help-path="vulnerabilityFeedbackHelpPath"
/> />
<div v-if="showFeedbackNotes" class="card my-4"> <div v-if="showFeedbackNotes" class="card my-4">
......
<script> <script>
import { GlIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import { setUrlFragment } from '~/lib/utils/url_utility';
export default { export default {
name: 'SolutionCard', name: 'SolutionCard',
...@@ -26,11 +25,6 @@ export default { ...@@ -26,11 +25,6 @@ export default {
default: false, default: false,
required: false, required: false,
}, },
vulnerabilityFeedbackHelpPath: {
type: String,
default: '',
required: false,
},
isStandaloneVulnerability: { isStandaloneVulnerability: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -41,24 +35,9 @@ export default { ...@@ -41,24 +35,9 @@ export default {
solutionText() { solutionText() {
return (this.remediation && this.remediation.summary) || this.solution; return (this.remediation && this.remediation.summary) || this.solution;
}, },
helpPath() {
return setUrlFragment(
this.vulnerabilityFeedbackHelpPath,
'solutions-for-vulnerabilities-auto-remediation',
);
},
showCreateMergeRequestMsg() { showCreateMergeRequestMsg() {
return !this.hasMr && Boolean(this.remediation) && this.hasDownload; return !this.hasMr && Boolean(this.remediation) && this.hasDownload;
}, },
showLearnAboutRemedationMsg() {
return !this.hasMr;
},
showMsg() {
return (
this.vulnerabilityFeedbackHelpPath &&
(this.showCreateMergeRequestMsg || this.showLearnAboutRemedationMsg)
);
},
}, },
}; };
</script> </script>
...@@ -76,25 +55,14 @@ export default { ...@@ -76,25 +55,14 @@ export default {
solutionText solutionText
}}</span> }}</span>
</div> </div>
<template v-if="showMsg"> <template v-if="showCreateMergeRequestMsg">
<div class="card-footer" :class="{ 'border-0': !solutionText }"> <div class="card-footer" :class="{ 'border-0': !solutionText }">
<em class="text-secondary"> <em class="text-secondary">
<template v-if="showCreateMergeRequestMsg">
{{ {{
s__( s__(
'ciReport|Create a merge request to implement this solution, or download and apply the patch manually.', 'ciReport|Create a merge request to implement this solution, or download and apply the patch manually.',
) )
}} }}
</template>
<a
v-if="showLearnAboutRemedationMsg"
:href="helpPath"
class="js-link-vulnerabilityFeedbackHelpPath"
>
{{ s__('ciReport|Learn more about interacting with security reports') }}
<gl-icon :size="16" name="external-link" class="align-text-top" />
</a>
</em> </em>
</div> </div>
</template> </template>
......
...@@ -55,13 +55,7 @@ export default { ...@@ -55,13 +55,7 @@ export default {
}; };
}, },
solutionInfo() { solutionInfo() {
const { const { solution, has_mr: hasMr, remediations, state } = this.vulnerability;
solution,
has_mr: hasMr,
vulnerability_feedback_help_path: vulnerabilityFeedbackHelpPath,
remediations,
state,
} = this.vulnerability;
const remediation = remediations?.[0]; const remediation = remediations?.[0];
const hasDownload = Boolean( const hasDownload = Boolean(
...@@ -73,7 +67,6 @@ export default { ...@@ -73,7 +67,6 @@ export default {
remediation, remediation,
hasDownload, hasDownload,
hasMr, hasMr,
vulnerabilityFeedbackHelpPath,
isStandaloneVulnerability: true, isStandaloneVulnerability: true,
}; };
}, },
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
pipeline_jobs_path: expose_path(api_v4_projects_pipelines_jobs_path(id: project.id, pipeline_id: pipeline.id)), pipeline_jobs_path: expose_path(api_v4_projects_pipelines_jobs_path(id: project.id, pipeline_id: pipeline.id)),
vulnerabilities_endpoint: vulnerabilities_endpoint_path, vulnerabilities_endpoint: vulnerabilities_endpoint_path,
vulnerability_exports_endpoint: vulnerability_exports_endpoint_path, vulnerability_exports_endpoint: vulnerability_exports_endpoint_path,
vulnerability_feedback_help_path: help_page_path('user/application_security/index'),
empty_state_unauthorized_svg_path: image_path('illustrations/user-not-logged-in.svg'), empty_state_unauthorized_svg_path: image_path('illustrations/user-not-logged-in.svg'),
empty_state_forbidden_svg_path: image_path('illustrations/lock_promotion.svg'), empty_state_forbidden_svg_path: image_path('illustrations/lock_promotion.svg'),
project_full_path: project.path_with_namespace } } project_full_path: project.path_with_namespace } }
......
---
title: Issue 233813 - Remove confusing text and url on vulnerability finding modal
merge_request: 43698
author: Judith Weiss
type: removed
...@@ -15,7 +15,6 @@ const pipelineIid = 4321; ...@@ -15,7 +15,6 @@ const pipelineIid = 4321;
const projectId = 5678; const projectId = 5678;
const sourceBranch = 'feature-branch-1'; const sourceBranch = 'feature-branch-1';
const vulnerabilitiesEndpoint = '/vulnerabilities'; const vulnerabilitiesEndpoint = '/vulnerabilities';
const vulnerabilityFeedbackHelpPath = '/vulnerabilities_feedback_help';
const loadingErrorIllustrations = { const loadingErrorIllustrations = {
401: '/401.svg', 401: '/401.svg',
403: '/403.svg', 403: '/403.svg',
...@@ -56,7 +55,6 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -56,7 +55,6 @@ describe('Pipeline Security Dashboard component', () => {
projectId, projectId,
sourceBranch, sourceBranch,
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
vulnerabilityFeedbackHelpPath,
loadingErrorIllustrations, loadingErrorIllustrations,
}, },
...options, ...options,
...@@ -93,7 +91,6 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -93,7 +91,6 @@ describe('Pipeline Security Dashboard component', () => {
lockToProject: { id: projectId }, lockToProject: { id: projectId },
pipelineId, pipelineId,
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
vulnerabilityFeedbackHelpPath,
}); });
}); });
}); });
......
...@@ -21,7 +21,6 @@ const vulnerabilitiesEndpoint = `${TEST_HOST}/vulnerabilities`; ...@@ -21,7 +21,6 @@ const vulnerabilitiesEndpoint = `${TEST_HOST}/vulnerabilities`;
const vulnerabilitiesCountEndpoint = `${TEST_HOST}/vulnerabilities_summary`; const vulnerabilitiesCountEndpoint = `${TEST_HOST}/vulnerabilities_summary`;
const vulnerabilitiesHistoryEndpoint = `${TEST_HOST}/vulnerabilities_history`; const vulnerabilitiesHistoryEndpoint = `${TEST_HOST}/vulnerabilities_history`;
const vulnerableProjectsEndpoint = `${TEST_HOST}/vulnerable_projects`; const vulnerableProjectsEndpoint = `${TEST_HOST}/vulnerable_projects`;
const vulnerabilityFeedbackHelpPath = `${TEST_HOST}/vulnerabilities_feedback_help`;
jest.mock('~/lib/utils/url_utility', () => ({ jest.mock('~/lib/utils/url_utility', () => ({
getParameterValues: jest.fn().mockReturnValue([]), getParameterValues: jest.fn().mockReturnValue([]),
...@@ -53,7 +52,6 @@ describe('Security Dashboard component', () => { ...@@ -53,7 +52,6 @@ describe('Security Dashboard component', () => {
vulnerabilitiesHistoryEndpoint, vulnerabilitiesHistoryEndpoint,
vulnerableProjectsEndpoint, vulnerableProjectsEndpoint,
pipelineId, pipelineId,
vulnerabilityFeedbackHelpPath,
...props, ...props,
}, },
}); });
...@@ -127,12 +125,6 @@ describe('Security Dashboard component', () => { ...@@ -127,12 +125,6 @@ describe('Security Dashboard component', () => {
expect(wrapper.find(IssueModal).exists()).toBe(true); expect(wrapper.find(IssueModal).exists()).toBe(true);
}); });
it('passes the "vulnerabilityFeedbackHelpPath" prop to the issue modal', () => {
expect(wrapper.find(IssueModal).props('vulnerabilityFeedbackHelpPath')).toBe(
vulnerabilityFeedbackHelpPath,
);
});
it.each` it.each`
emittedModalEvent | eventPayload | expectedDispatchedAction | expectedActionPayload emittedModalEvent | eventPayload | expectedDispatchedAction | expectedActionPayload
${'addDismissalComment'} | ${'foo'} | ${'vulnerabilities/addDismissalComment'} | ${{ comment: 'foo', vulnerability: 'bar' }} ${'addDismissalComment'} | ${'foo'} | ${'vulnerabilities/addDismissalComment'} | ${{ comment: 'foo', vulnerability: 'bar' }}
...@@ -166,7 +158,7 @@ describe('Security Dashboard component', () => { ...@@ -166,7 +158,7 @@ describe('Security Dashboard component', () => {
describe('issue modal', () => { describe('issue modal', () => {
it.each` it.each`
givenState | expectedProps givenState | expectedProps
${{ modal: { vulnerability: 'foo' } }} | ${{ modal: { vulnerability: 'foo' }, vulnerabilityFeedbackHelpPath, canCreateIssue: false, canCreateMergeRequest: false, canDismissVulnerability: false, isCreatingIssue: false, isDismissingVulnerability: false, isCreatingMergeRequest: false }} ${{ modal: { vulnerability: 'foo' } }} | ${{ modal: { vulnerability: 'foo' }, canCreateIssue: false, canCreateMergeRequest: false, canDismissVulnerability: false, isCreatingIssue: false, isDismissingVulnerability: false, isCreatingMergeRequest: false }}
${{ modal: { vulnerability: { create_vulnerability_feedback_issue_path: 'foo' } } }} | ${expect.objectContaining({ canCreateIssue: true })} ${{ modal: { vulnerability: { create_vulnerability_feedback_issue_path: 'foo' } } }} | ${expect.objectContaining({ canCreateIssue: true })}
${{ modal: { vulnerability: { create_vulnerability_feedback_merge_request_path: 'foo' } } }} | ${expect.objectContaining({ canCreateMergeRequest: true })} ${{ modal: { vulnerability: { create_vulnerability_feedback_merge_request_path: 'foo' } } }} | ${expect.objectContaining({ canCreateMergeRequest: true })}
${{ modal: { vulnerability: { create_vulnerability_feedback_dismissal_path: 'foo' } } }} | ${expect.objectContaining({ canDismissVulnerability: true })} ${{ modal: { vulnerability: { create_vulnerability_feedback_dismissal_path: 'foo' } } }} | ${expect.objectContaining({ canDismissVulnerability: true })}
......
...@@ -131,7 +131,6 @@ describe('Security Reports modal', () => { ...@@ -131,7 +131,6 @@ describe('Security Reports modal', () => {
beforeEach(() => { beforeEach(() => {
const propsData = { const propsData = {
modal: createState().modal, modal: createState().modal,
vulnerabilityFeedbackHelpPath: 'feedbacksHelpPath',
}; };
propsData.modal.title = 'Arbitrary file existence disclosure in Action Pack'; propsData.modal.title = 'Arbitrary file existence disclosure in Action Pack';
mountComponent(propsData, mount); mountComponent(propsData, mount);
...@@ -140,12 +139,6 @@ describe('Security Reports modal', () => { ...@@ -140,12 +139,6 @@ describe('Security Reports modal', () => {
it('renders title', () => { it('renders title', () => {
expect(wrapper.text()).toContain('Arbitrary file existence disclosure in Action Pack'); expect(wrapper.text()).toContain('Arbitrary file existence disclosure in Action Pack');
}); });
it('renders help link', () => {
expect(wrapper.find('.js-link-vulnerabilityFeedbackHelpPath').attributes('href')).toBe(
'feedbacksHelpPath#solutions-for-vulnerabilities-auto-remediation',
);
});
}); });
describe('with a resolved issue', () => { describe('with a resolved issue', () => {
......
...@@ -8,7 +8,6 @@ describe('Solution Card', () => { ...@@ -8,7 +8,6 @@ describe('Solution Card', () => {
const Component = Vue.extend(component); const Component = Vue.extend(component);
const solution = 'Upgrade to XYZ'; const solution = 'Upgrade to XYZ';
const remediation = { summary: 'Update to 123', fixes: [], diff: 'SGVsbG8gR2l0TGFi' }; const remediation = { summary: 'Update to 123', fixes: [], diff: 'SGVsbG8gR2l0TGFi' };
const vulnerabilityFeedbackHelpPath = '/foo';
let wrapper; let wrapper;
...@@ -63,7 +62,7 @@ describe('Solution Card', () => { ...@@ -63,7 +62,7 @@ describe('Solution Card', () => {
describe('with remediation', () => { describe('with remediation', () => {
beforeEach(() => { beforeEach(() => {
const propsData = { remediation, vulnerabilityFeedbackHelpPath, hasRemediation: true }; const propsData = { remediation, hasRemediation: true };
wrapper = shallowMount(Component, { propsData }); wrapper = shallowMount(Component, { propsData });
}); });
...@@ -73,22 +72,12 @@ describe('Solution Card', () => { ...@@ -73,22 +72,12 @@ describe('Solution Card', () => {
); );
}); });
it('renders the card footer', () => {
expect(wrapper.find('.card-footer').exists()).toBe(true);
});
describe('with download patch', () => { describe('with download patch', () => {
beforeEach(() => { beforeEach(() => {
wrapper.setProps({ hasDownload: true }); wrapper.setProps({ hasDownload: true });
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
}); });
it('renders the learn more about remediation solutions', () => {
expect(wrapper.find('.card-footer').text()).toContain(
s__('ciReport|Learn more about interacting with security reports'),
);
});
it('does not render the download and apply solution message when there is a file download and a merge request already exists', () => { it('does not render the download and apply solution message when there is a file download and a merge request already exists', () => {
wrapper.setProps({ hasMr: true }); wrapper.setProps({ hasMr: true });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -106,24 +95,8 @@ describe('Solution Card', () => { ...@@ -106,24 +95,8 @@ describe('Solution Card', () => {
}); });
describe('without download patch', () => { describe('without download patch', () => {
it('renders the learn more about remediation solutions', () => { it('does not render the card footer', () => {
expect(wrapper.find('.card-footer').text()).toContain( expect(wrapper.find('.card-footer').exists()).toBe(false);
s__('ciReport|Learn more about interacting with security reports'),
);
});
it('does not render the download and apply solution message', () => {
expect(wrapper.find('.card-footer').text()).not.toContain(
s__('ciReport|Download and apply the patch manually to resolve.'),
);
});
it('does not render the create a merge request to implement this solution message', () => {
expect(wrapper.find('.card-footer').text()).not.toContain(
s__(
'ciReport|Create a merge request to implement this solution, or download and apply the patch manually.',
),
);
}); });
}); });
}); });
......
...@@ -30,7 +30,6 @@ describe('Vulnerability Footer', () => { ...@@ -30,7 +30,6 @@ describe('Vulnerability Footer', () => {
can_modify_related_issues: true, can_modify_related_issues: true,
related_issues_help_path: 'help/path', related_issues_help_path: 'help/path',
has_mr: false, has_mr: false,
vulnerability_feedback_help_path: 'feedback/help/path',
pipeline: {}, pipeline: {},
}; };
...@@ -69,7 +68,6 @@ describe('Vulnerability Footer', () => { ...@@ -69,7 +68,6 @@ describe('Vulnerability Footer', () => {
remediation: properties.remediations[0], remediation: properties.remediations[0],
hasDownload: true, hasDownload: true,
hasMr: vulnerability.has_mr, hasMr: vulnerability.has_mr,
vulnerabilityFeedbackHelpPath: vulnerability.vulnerability_feedback_help_path,
isStandaloneVulnerability: true, isStandaloneVulnerability: true,
}); });
}); });
......
...@@ -30268,9 +30268,6 @@ msgstr "" ...@@ -30268,9 +30268,6 @@ msgstr ""
msgid "ciReport|Investigate this vulnerability by creating an issue" msgid "ciReport|Investigate this vulnerability by creating an issue"
msgstr "" msgstr ""
msgid "ciReport|Learn more about interacting with security reports"
msgstr ""
msgid "ciReport|Load performance test metrics: " msgid "ciReport|Load performance test metrics: "
msgstr "" msgstr ""
......
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