Skip to content

Add group-level policy informational banner

What does this MR do and why?

Add group-level policy informational banner

  • it tells the user that their group-level policy will affect all projects
  • update tests

Related to #345317 (closed)

Screenshots or screen recordings

Scenario Before After
Group-level w/out error Screen_Shot_2022-05-13_at_10.02.04 Screen_Shot_2022-05-19_at_08.48.15
Group-level w/ error group_error_-_b Screen_Shot_2022-05-19_at_08.48.23
Project-level w/out error Screen_Shot_2022-05-13_at_09.55.31 No visual change
Project-level w/ error project_error_-_b No visual change

How to set up and validate locally

  1. Enable :group_level_security_policies feature flag
  2. Upload a GitLab Ultimate license
  3. Apply the following patch
Patch
diff --git a/ee/app/assets/javascripts/threat_monitoring/policy_editor.js b/ee/app/assets/javascripts/threat_monitoring/policy_editor.js
index 01ee8e916f7..dafadb88287 100644
--- a/ee/app/assets/javascripts/threat_monitoring/policy_editor.js
+++ b/ee/app/assets/javascripts/threat_monitoring/policy_editor.js
@@ -43,7 +43,7 @@ export default (el, namespaceType) => {
 
   let component = PolicyEditorApp;
 
-  if (gon.features?.containerSecurityPolicySelection) {
+  if (true || gon.features?.containerSecurityPolicySelection) {
     component = NewPolicyApp;
   }
  1. Navigate to a group => Security & Compliance => Policies => 'New policy'
  2. Navigate to a project in that group => Security & Compliance => Policies => 'New policy'

MR acceptance checklist

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

Edited by Alexander Turinske

Merge request reports