Commit 5806362b authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '8342-vulnerability-modal-discrepancies-on-group-security-dashboard' into 'master'

Resolve "Vulnerability modal discrepancies on Group Security Dashboard"

Closes #8342

See merge request gitlab-org/gitlab-ee!8360
parents f83c60b0 f3a01ed7
...@@ -36,6 +36,10 @@ export default { ...@@ -36,6 +36,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
vulnerabilityFeedbackHelpPath: {
type: String,
required: true,
},
}, },
computed: { computed: {
...mapGetters('vulnerabilities', ['vulnerabilitiesCountByReportType']), ...mapGetters('vulnerabilities', ['vulnerabilitiesCountByReportType']),
...@@ -114,6 +118,7 @@ export default { ...@@ -114,6 +118,7 @@ export default {
</tabs> </tabs>
<issue-modal <issue-modal
:modal="modal" :modal="modal"
:vulnerability-feedback-help-path="vulnerabilityFeedbackHelpPath"
:can-create-issue-permission="true" :can-create-issue-permission="true"
:can-create-feedback-permission="true" :can-create-feedback-permission="true"
@createNewIssue="createIssue({ vulnerability: modal.vulnerability })" @createNewIssue="createIssue({ vulnerability: modal.vulnerability })"
......
...@@ -15,6 +15,7 @@ export default () => { ...@@ -15,6 +15,7 @@ export default () => {
return createElement('group-security-dashboard-app', { return createElement('group-security-dashboard-app', {
props: { props: {
dashboardDocumentation: el.dataset.dashboardDocumentation, dashboardDocumentation: el.dataset.dashboardDocumentation,
vulnerabilityFeedbackHelpPath: el.dataset.vulnerabilityFeedbackHelpPath,
vulnerabilitiesEndpoint: el.dataset.vulnerabilitiesEndpoint, vulnerabilitiesEndpoint: el.dataset.vulnerabilitiesEndpoint,
vulnerabilitiesCountEndpoint: el.dataset.vulnerabilitiesSummaryEndpoint, vulnerabilitiesCountEndpoint: el.dataset.vulnerabilitiesSummaryEndpoint,
}, },
......
...@@ -56,15 +56,30 @@ export default { ...@@ -56,15 +56,30 @@ export default {
'value', 'value',
vulnerability.identifiers.length && vulnerability.identifiers, vulnerability.identifiers.length && vulnerability.identifiers,
); );
Vue.set(
state.modal.data.className,
'value',
vulnerability.location && vulnerability.location.class,
);
Vue.set(state.modal.data.severity, 'value', vulnerability.severity); Vue.set(state.modal.data.severity, 'value', vulnerability.severity);
Vue.set(state.modal.data.confidence, 'value', vulnerability.confidence); Vue.set(state.modal.data.confidence, 'value', vulnerability.confidence);
Vue.set(state.modal.data.solution, 'value', vulnerability.solution); Vue.set(state.modal.data.solution, 'value', vulnerability.solution);
Vue.set(state.modal.data.links, 'value', vulnerability.links);
Vue.set(state.modal.data.instances, 'value', vulnerability.instances);
Vue.set(state.modal, 'vulnerability', vulnerability); Vue.set(state.modal, 'vulnerability', vulnerability);
Vue.set(state.modal.vulnerability, 'hasIssue', Boolean(vulnerability.issue_feedback)); Vue.set(state.modal.vulnerability, 'hasIssue', Boolean(vulnerability.issue_feedback));
Vue.set(state.modal.vulnerability, 'isDismissed', Boolean(vulnerability.dismissal_feedback)); Vue.set(state.modal.vulnerability, 'isDismissed', Boolean(vulnerability.dismissal_feedback));
Vue.set(state.modal, 'error', null); Vue.set(state.modal, 'error', null);
if (vulnerability.instances && vulnerability.instances.length) {
Vue.set(state.modal.data.instances, 'value', vulnerability.instances);
} else {
Vue.set(state.modal.data.instances, 'value', null);
}
if (vulnerability.links && vulnerability.links.length) {
Vue.set(state.modal.data.links, 'value', vulnerability.links);
} else {
Vue.set(state.modal.data.links, 'value', null);
}
}, },
[types.REQUEST_CREATE_ISSUE](state) { [types.REQUEST_CREATE_ISSUE](state) {
state.isCreatingIssue = true; state.isCreatingIssue = true;
......
...@@ -22,6 +22,7 @@ export default () => ({ ...@@ -22,6 +22,7 @@ export default () => ({
identifiers: { text: s__('Vulnerability|Identifiers') }, identifiers: { text: s__('Vulnerability|Identifiers') },
severity: { text: s__('Vulnerability|Severity') }, severity: { text: s__('Vulnerability|Severity') },
confidence: { text: s__('Vulnerability|Confidence') }, confidence: { text: s__('Vulnerability|Confidence') },
className: { text: s__('Vulnerability|Class') },
solution: { text: s__('Vulnerability|Solution') }, solution: { text: s__('Vulnerability|Solution') },
links: { text: s__('Vulnerability|Links') }, links: { text: s__('Vulnerability|Links') },
instances: { text: s__('Vulnerability|Instances') }, instances: { text: s__('Vulnerability|Instances') },
......
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
#js-group-security-dashboard{ data: { vulnerabilities_endpoint: group_security_vulnerabilities_path(@group), #js-group-security-dashboard{ data: { vulnerabilities_endpoint: group_security_vulnerabilities_path(@group),
vulnerabilities_summary_endpoint: summary_group_security_vulnerabilities_path(@group), vulnerabilities_summary_endpoint: summary_group_security_vulnerabilities_path(@group),
vulnerability_feedback_help_path: help_page_path("user/project/merge_requests/index", anchor: "interacting-with-security-reports-ultimate"),
dashboard_documentation: help_page_path('user/group/security_dashboard/index') } } dashboard_documentation: help_page_path('user/group/security_dashboard/index') } }
---
title: Fixes missing fields on the group security dashboard
merge_request: 8360
author:
type: fixed
...@@ -47,6 +47,18 @@ ...@@ -47,6 +47,18 @@
"name": "Cipher does not check for integrity first?", "name": "Cipher does not check for integrity first?",
"url": "https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first" "url": "https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first"
} }
],
"instances": [
{
"param": "X-Content-Type-Options",
"method": "GET",
"uri": "http://bikebilly-spring-auto-devops-review-feature-br-3y2gpb.35.192.176.43.xip.io"
},
{
"param": "X-Content-Type-Options",
"method": "GET",
"uri": "http://bikebilly-spring-auto-devops-review-feature-br-3y2gpb.35.192.176.43.xip.io/"
}
] ]
}, },
{ {
......
...@@ -172,6 +172,10 @@ describe('vulnerabilities module mutations', () => { ...@@ -172,6 +172,10 @@ describe('vulnerabilities module mutations', () => {
expect(state.modal.data.confidence.value).toEqual(vulnerability.confidence); expect(state.modal.data.confidence.value).toEqual(vulnerability.confidence);
}); });
it('should set the modal class', () => {
expect(state.modal.data.className.value).toEqual(vulnerability.location.class);
});
it('should set the modal solution', () => { it('should set the modal solution', () => {
expect(state.modal.data.solution.value).toEqual(vulnerability.solution); expect(state.modal.data.solution.value).toEqual(vulnerability.solution);
}); });
...@@ -212,6 +216,20 @@ describe('vulnerabilities module mutations', () => { ...@@ -212,6 +216,20 @@ describe('vulnerabilities module mutations', () => {
expect(state.modal.vulnerability.hasIssue).toEqual(true); expect(state.modal.vulnerability.hasIssue).toEqual(true);
}); });
it('should nullify the modal links', () => {
const payload = { vulnerability: { ...vulnerability, links: [] } };
mutations[types.SET_MODAL_DATA](state, payload);
expect(state.modal.data.links.value).toEqual(null);
});
it('should nullify the instances', () => {
const payload = { vulnerability: { ...vulnerability, instances: [] } };
mutations[types.SET_MODAL_DATA](state, payload);
expect(state.modal.data.instances.value).toEqual(null);
});
}); });
}); });
......
...@@ -8896,6 +8896,9 @@ msgstr "" ...@@ -8896,6 +8896,9 @@ msgstr ""
msgid "VisibilityLevel|Unknown" msgid "VisibilityLevel|Unknown"
msgstr "" msgstr ""
msgid "Vulnerability|Class"
msgstr ""
msgid "Vulnerability|Confidence" msgid "Vulnerability|Confidence"
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