Skip to content

Vulnerability code flow viewer styling issue when the 'src' url is too long

What does this MR do and why?

When the file URL is too large, it pushes the Edit button out of the section.

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.

In code_flow_file_viewer

Before After
Screenshot_2024-08-05_at_22.12.32 Screenshot_2024-08-05_at_22.44.53

In blob_content_viewer

Before After
Screenshot_2024-08-06_at_14.13.23 Screenshot_2024-08-06_at_14.14.20

In snippet_blob_view

Before After
Screenshot_2024-08-06_at_14.24.43 Screenshot_2024-08-06_at_14.25.08

How to set up and validate locally

  1. Upload a GitLab Ultimate license
  2. Enable the feature flag (echo "Feature.enable(:vulnerability_code_flow)" | rails c)
  3. Clone the code flow project and run his pipeline to display vulnerabilities
  4. Navigate to the project => Secure => Vulnerability report => Select the first vulnerability to navigate to the vulnerability details page
  5. Apply the following patch to show the new features
Patch
diff --git a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue
index ca4110274476..319e8f7180ae 100644
--- a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue
+++ b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue
@@ -56,6 +56,7 @@ export default {
       },
     },
     showCodeFlowTabs() {
+      return true
       return (
         this.glFeatures.vulnerabilityCodeFlow && !isEmpty(this.vulnerability.details.codeFlows)
       );
diff --git a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue
index bfbc47e4c041..72fd47398163 100644
--- a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue
+++ b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue
@@ -221,6 +221,7 @@ export default {
       return this.vulnerability.location?.file && this.vulnerability.location?.startLine;
     },
     showCodeFlowButton() {
+      return true
       return (
         this.glFeatures.vulnerabilityCodeFlow && !isEmpty(this.vulnerability.details.codeFlows)
       );
  1. Navigate to code flow tab
  2. Verify that 'URL' isn't pushed out of the section.
  3. Navigate to specific file from your project
  4. Verify that 'URL' isn't pushed out of the section.
  5. Navigate to the project => Code => Snippets
  6. Verify that 'URL' isn't pushed out of the section.

Numbered steps to set up and validate the change are strongly suggested.

Related to #477328 (closed)

Edited by Chen Charnolevsky

Merge request reports

Loading