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