From a19742e6dbb9adf9f9b579099aa4775c7ecb9309 Mon Sep 17 00:00:00 2001
From: "Alan (Maciej) Paruszewski" <mparuszewski@gitlab.com>
Date: Sun, 19 May 2024 19:00:26 +0000
Subject: [PATCH] Remove extra informaton about policy scoping in policy editor

---
 .../components/policy_editor/editor_wrapper.vue  | 12 ------------
 .../components/policy_editor/scope/constants.js  |  2 +-
 .../policy_editor/editor_wrapper_spec.js         | 16 ++--------------
 locale/gitlab.pot                                |  5 +----
 4 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/ee/app/assets/javascripts/security_orchestration/components/policy_editor/editor_wrapper.vue b/ee/app/assets/javascripts/security_orchestration/components/policy_editor/editor_wrapper.vue
index d33e4f14569fd..9233eb5d9859b 100644
--- a/ee/app/assets/javascripts/security_orchestration/components/policy_editor/editor_wrapper.vue
+++ b/ee/app/assets/javascripts/security_orchestration/components/policy_editor/editor_wrapper.vue
@@ -1,6 +1,5 @@
 <script>
 import { GlAlert, GlFormGroup, GlFormSelect } from '@gitlab/ui';
-import { s__ } from '~/locale';
 import { NAMESPACE_TYPES } from '../../constants';
 import { POLICY_TYPE_COMPONENT_OPTIONS } from '../constants';
 import PipelineExecutionPolicyEditor from './pipeline_execution/editor_component.vue';
@@ -57,22 +56,11 @@ export default {
     },
   },
   NAMESPACE_TYPES,
-  i18n: {
-    groupPolicyMessage: s__(
-      'SecurityOrchestration|After enabling a group-level policy, this policy automatically applies to all projects and sub-groups in this group.',
-    ),
-  },
 };
 </script>
 
 <template>
   <section class="policy-editor">
-    <span
-      v-if="namespaceType === $options.NAMESPACE_TYPES.GROUP"
-      data-testid="group-level-notification"
-    >
-      {{ $options.i18n.groupPolicyMessage }}
-    </span>
     <gl-alert
       v-if="error"
       class="gl-mt-5 security-policies-alert gl-z-2"
diff --git a/ee/app/assets/javascripts/security_orchestration/components/policy_editor/scope/constants.js b/ee/app/assets/javascripts/security_orchestration/components/policy_editor/scope/constants.js
index 32c366b4ea08c..0afd899e50c65 100644
--- a/ee/app/assets/javascripts/security_orchestration/components/policy_editor/scope/constants.js
+++ b/ee/app/assets/javascripts/security_orchestration/components/policy_editor/scope/constants.js
@@ -6,7 +6,7 @@ export const SPECIFIC_PROJECTS = 'specific_projects';
 
 export const PROJECT_SCOPE_TYPE_TEXTS = {
   [PROJECTS_WITH_FRAMEWORK]: s__('SecurityOrchestration|projects with compliance frameworks'),
-  [ALL_PROJECTS_IN_GROUP]: s__('SecurityOrchestration|all projects in this group'),
+  [ALL_PROJECTS_IN_GROUP]: s__('SecurityOrchestration|all subgroups/projects in this group'),
   [SPECIFIC_PROJECTS]: s__('SecurityOrchestration|specific projects'),
 };
 
diff --git a/ee/spec/frontend/security_orchestration/components/policy_editor/editor_wrapper_spec.js b/ee/spec/frontend/security_orchestration/components/policy_editor/editor_wrapper_spec.js
index 4696c88761002..e51c89e642d73 100644
--- a/ee/spec/frontend/security_orchestration/components/policy_editor/editor_wrapper_spec.js
+++ b/ee/spec/frontend/security_orchestration/components/policy_editor/editor_wrapper_spec.js
@@ -14,7 +14,6 @@ import { mockDastScanExecutionObject } from '../../mocks/mock_scan_execution_pol
 describe('EditorWrapper component', () => {
   let wrapper;
 
-  const findGroupLevelNotification = () => wrapper.findByTestId('group-level-notification');
   const findErrorAlert = () => wrapper.findByTestId('error-alert');
   const findPipelineExecutionPolicyEditor = () =>
     wrapper.findComponent(PipelineExecutionPolicyEditor);
@@ -41,9 +40,8 @@ describe('EditorWrapper component', () => {
       beforeEach(factory);
 
       it.each`
-        component              | findComponent
-        ${'group-level alert'} | ${findGroupLevelNotification}
-        ${'error alert'}       | ${findErrorAlert}
+        component        | findComponent
+        ${'error alert'} | ${findErrorAlert}
       `('does not display the $component', ({ findComponent }) => {
         expect(findComponent().exists()).toBe(false);
       });
@@ -87,16 +85,6 @@ describe('EditorWrapper component', () => {
         },
       );
     });
-
-    describe('group-level', () => {
-      beforeEach(() => {
-        factory({ provide: { namespaceType: NAMESPACE_TYPES.GROUP } });
-      });
-
-      it('does display the group-level alert', () => {
-        expect(findGroupLevelNotification().exists()).toBe(true);
-      });
-    });
   });
 
   describe('when there is existingPolicy attached', () => {
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 37a3a4a8bacf5..a562bf6ee30fe 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -46584,9 +46584,6 @@ msgstr ""
 msgid "SecurityOrchestration|After dismissing the alert, the information will never be shown again."
 msgstr ""
 
-msgid "SecurityOrchestration|After enabling a group-level policy, this policy automatically applies to all projects and sub-groups in this group."
-msgstr ""
-
 msgid "SecurityOrchestration|All projects in the group."
 msgstr ""
 
@@ -47267,7 +47264,7 @@ msgstr ""
 msgid "SecurityOrchestration|all namespaces"
 msgstr ""
 
-msgid "SecurityOrchestration|all projects in this group"
+msgid "SecurityOrchestration|all subgroups/projects in this group"
 msgstr ""
 
 msgid "SecurityOrchestration|any"
-- 
GitLab