Commit c8a4b1ac authored by Michał Zając's avatar Michał Zając

Pass current_user to the footer component

parent 9876141b
......@@ -11,8 +11,8 @@ function createFooterApp() {
const { vulnerabilityFeedbackHelpPath, hasMr } = el.dataset;
const vulnerability = JSON.parse(el.dataset.vulnerabilityJson);
const finding = JSON.parse(el.dataset.finding);
const remediation = finding.remediations[0];
const finding = JSON.parse(el.dataset.findingJson);
const remediation = finding.solution;
const hasDownload = Boolean(
vulnerability.state !== 'resolved' && remediation?.diff?.length && !hasMr,
);
......@@ -20,14 +20,14 @@ function createFooterApp() {
const props = {
solutionInfo: {
solution: finding.solution,
remediation,
remediation: finding.solution,
hasDownload,
hasMr,
hasRemediation: Boolean(remediation),
vulnerabilityFeedbackHelpPath,
isStandaloneVulnerability: true,
},
feedback: finding.issue_feedback,
feedback: finding.feedback,
project: {
url: finding.project.full_path,
value: finding.project.full_name,
......
......@@ -35,7 +35,9 @@ module VulnerabilitiesHelper
links: occurrence[:links],
location: occurrence[:location],
name: occurrence[:name],
solution: remediation ? remediation['summary'] : occurrence[:solution]
solution: remediation ? remediation['summary'] : occurrence[:solution],
feedback: occurrence[:issue_feedback],
project: occurrence[:project]
}
end
end
......@@ -38,4 +38,4 @@
%li
%a{ :href=>identifier.url, target: "_blank", rel: 'noopener noreferrer' }= identifier.name
#js-vulnerability-footer{ data: vulnerability_data(@vulnerability, @pipeline) }
#js-vulnerability-footer{ data: vulnerability_data(@vulnerability, @pipeline, current_user: @current_user) }
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