Hiding promo banner on vulnerability page when 3rd party offers disabled
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 |
---|---|
How to set up and validate locally
Validation steps for local GDK.
Requires:
- A CI runner to be setup and linked to your local GDK. Docker is the easiest, instructions here: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/main/doc/howto/runner.md#executing-a-runner-from-within-docker
- A repository with vulnerability scanning enabled. This repo can be used https://gitlab.com/gitlab-examples/security/security-reports/
Validation steps:
- Clean up any previously-dismissed callout rows:
bundle exec rails console
Users::Callout.where(feature_name: "security_training_feature_promotion").delete_all
-
Users::Callout.where(feature_name: "security_training_feature_promotion").count
should return 0.
- Navigate to the vulnerability report. You should see the blue banner in the left screenshot.
- 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.
- Return to the vulnerability report. You should no longer see the blue banner.
- Toggle the "Customer experience improvement and third-party offers" setting and save again.
- Return to the vulnerability report. You should see the blue banner again.
Edited by Ryan Wells