Commit 537d84fb authored by Alexander Turinske's avatar Alexander Turinske Committed by Michał Zając

Refactor vulnerability page for new data model

- the data model passed to the vulnerability page has been
  updated
- I updated the vulnerability page to account for this new
  data model
parent c8a4b1ac
......@@ -12,22 +12,22 @@ function createFooterApp() {
const { vulnerabilityFeedbackHelpPath, hasMr } = el.dataset;
const vulnerability = JSON.parse(el.dataset.vulnerabilityJson);
const finding = JSON.parse(el.dataset.findingJson);
const remediation = finding.solution;
const { issue_feedback: feedback, remediation, solution } = finding;
const hasDownload = Boolean(
vulnerability.state !== 'resolved' && remediation?.diff?.length && !hasMr,
);
const props = {
solutionInfo: {
solution: finding.solution,
remediation: finding.solution,
solution,
remediation,
hasDownload,
hasMr,
hasRemediation: Boolean(remediation),
vulnerabilityFeedbackHelpPath,
isStandaloneVulnerability: true,
},
feedback: finding.feedback,
feedback,
project: {
url: finding.project.full_path,
value: finding.project.full_name,
......
......@@ -35,8 +35,9 @@ module VulnerabilitiesHelper
links: occurrence[:links],
location: occurrence[:location],
name: occurrence[:name],
solution: remediation ? remediation['summary'] : occurrence[:solution],
feedback: occurrence[:issue_feedback],
solution: occurrence[:solution],
remediation: remediation,
issue_feedback: occurrence[:issue_feedback],
project: occurrence[:project]
}
end
......
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