Skip to content

Hiding promo banner on vulnerability page when 3rd party offers disabled

Ryan Wells requested to merge ryaanwells/hide_promo_banner_vuln_page into master

What does this MR do and why?

Contributes to: #465208

When third party offers are disabled, we should not show the "Enable security training" promo banner. This PR links the Admin setting to a conditional display control on the banner.

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.

When the admin setting is unchecked When the admin setting is checked
Screenshot 2024-07-04 at 15.40.48.png Screenshot 2024-07-04 at 15.40.59.png

How to set up and validate locally

Validation steps for local GDK.

Requires:

Validation steps:

  1. Clean up any previously-dismissed callout rows:
    1. bundle exec rails console
    2. Users::Callout.where(feature_name: "security_training_feature_promotion").delete_all
    3. Users::Callout.where(feature_name: "security_training_feature_promotion").count should return 0.
  2. Navigate to the vulnerability report. You should see the blue banner in the left screenshot.
  3. Navigate to http://<your_GDK>/admin/application_settings/general#js-third-party-offers-settings. Under "Customer experience improvement and third-party offers", check the box and hit save.
  4. Return to the vulnerability report. You should no longer see the blue banner.
  5. Toggle the "Customer experience improvement and third-party offers" setting and save again.
  6. Return to the vulnerability report. You should see the blue banner again.
Edited by Ryan Wells

Merge request reports