Skip to content

Add training item UI in vulnerability details page

Samantha Ming requested to merge 349669-training-item-ui into master

What does this MR do and why?

This MR adds the UI to display training item in the vulnerability details page.

This MR is part of the new security training feature, please see the epic for details and the implementation breakdown > &6176 (closed)

Note the implementation of adding the training section is split into the following MR > (copied from here > #346066 (comment 802988533))

Changes Issue
Add training section (basic UI) !77317 (merged)
Add loading status of query fetch of training configuration tbd
Connect graphql to display training section !78201 (merged)
Make API call to fetch training (UI) This MR
Add loading status of trainer fetch Issue #349670 (closed)

Screenshots or screen recordings

Training found Training not found
training ui 2022-01-21_at_1.29_PM

How to set up and validate locally

This feature is behind a feature flag, to enable

rails c

Feature.enable(:secure_vulnerability_training)
  1. Navigate to the Vulnerability report
  2. Click on a vulnerability that is of type of CWE
  3. You will see a training link available

Note: there is an issue to eventually allow the frontend to call the API from the backend > https://gitlab.com/gitlab-org/gitlab/-/issues/349910. For now, we have the API call directly from the frontend for us to implement the UI. To see it locally, you will need to make some changes to the config_loader.rb. Here's a patch for the configuration:

config-loader-provider-api.patch

After applying the patch, you should run:

gdk restart rails-web

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #349669 (closed)

Edited by Samantha Ming

Merge request reports

Loading