Skip to content

Create components for highlighting vulnerability source code

Chen Charnolevsky requested to merge 469653-vulnerability-code-flow-P4 into master

What does this MR do and why?

What:

  • create a new component called vulnerability_file_content_viewer that also highlighting by boolean input
  • update our Highlight.js implementation to be re-usable in other contexts

Why:

  • Currently there is no component that highlighting a few lines as required in 'Code Flow', so to handle this we need to refactor a little bit the language highlight plugin

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

The screenshots should be the same.

The code in the screenshots (ee/app/assets/javascripts/vulnerabilities/components/vulnerability_file_contents.vue) is using now vulnerability-file-content-viewer.

Before After
Screenshot_2024-07-06_at_21.08.34 Screenshot_2024-07-06_at_21.10.13

How to set up and validate locally

nothing 😄

Related to #469653 (closed) and #458062

Edited by Jacques Erasmus

Merge request reports

Loading