diff --git a/ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue b/ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue index 2c501d6fe8d8f3e8e1c5023dc3b627bb2b69728a..b235ab14a1f3fc5aaf68422fbee8fde02bf1b8bf 100644 --- a/ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue +++ b/ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue @@ -14,7 +14,6 @@ import { import { mapState, mapActions } from 'vuex'; import { redirectTo } from '~/lib/utils/url_utility'; import { s__, __, sprintf } from '~/locale'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import EnvironmentPicker from '../environment_picker.vue'; import { EditorModeRule, @@ -59,7 +58,6 @@ export default { DimDisableContainer, }, directives: { GlModal: GlModalDirective }, - mixins: [glFeatureFlagsMixin()], props: { threatMonitoringPath: { type: String, @@ -135,9 +133,6 @@ export default { ? s__('NetworkPolicies|Save changes') : s__('NetworkPolicies|Create policy'); }, - showAlertsPicker() { - return this.glFeatures.threatMonitoringAlerts; - }, deleteModalTitle() { return sprintf(s__('NetworkPolicies|Delete policy: %{policy}'), { policy: this.policy.name }); }, @@ -345,11 +340,7 @@ export default { </template> <policy-action-picker /> - <policy-alert-picker - v-if="showAlertsPicker" - :policy-alert="policyAlert" - @update-alert="handleAlertUpdate" - /> + <policy-alert-picker :policy-alert="policyAlert" @update-alert="handleAlertUpdate" /> </dim-disable-container> </div> <div class="col-sm-12 col-md-6 col-lg-5 col-xl-4"> diff --git a/ee/spec/frontend/threat_monitoring/components/policy_editor/__snapshots__/policy_editor_spec.js.snap b/ee/spec/frontend/threat_monitoring/components/policy_editor/__snapshots__/policy_editor_spec.js.snap index 75a020386953001dea9d99d0620e52f486b9340d..e4b23c44dada028ea0faad08e3a8879c3e9e7df0 100644 --- a/ee/spec/frontend/threat_monitoring/components/policy_editor/__snapshots__/policy_editor_spec.js.snap +++ b/ee/spec/frontend/threat_monitoring/components/policy_editor/__snapshots__/policy_editor_spec.js.snap @@ -185,7 +185,7 @@ exports[`PolicyEditorApp component renders the policy editor layout 1`] = ` <policy-action-picker-stub /> - <!----> + <policy-alert-picker-stub /> </dim-disable-container-stub> </div> diff --git a/ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js b/ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js index d03e0263d925791abbc5d76962e2a2abf1972ac1..7ea0fb21b42c518beafb35266c4676d640fa3260 100644 --- a/ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js +++ b/ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js @@ -62,7 +62,6 @@ spec: ...propsData, }, provide: { - glFeatures: { threatMonitoringAlerts: false }, ...provide, }, store, @@ -121,6 +120,10 @@ spec: }); }); + it('renders the policy alert picker', () => { + expect(findPolicyAlertPicker().exists()).toBe(true); + }); + it('does not render yaml editor', () => { expect(findYamlEditor().exists()).toBe(false); }); @@ -133,10 +136,6 @@ spec: expect(findDeletePolicy().exists()).toBe(false); }); - it('does not render the policy alert picker', () => { - expect(findPolicyAlertPicker().exists()).toBe(false); - }); - describe('given .yaml editor mode is enabled', () => { beforeEach(() => { factory({ @@ -431,14 +430,6 @@ spec: }); describe('add alert picker', () => { - beforeEach(() => { - factory({ provide: { glFeatures: { threatMonitoringAlerts: true } } }); - }); - - it('does render the policy alert picker', () => { - expect(findPolicyAlertPicker().exists()).toBe(true); - }); - it('adds a policy annotation on alert addition', async () => { await modifyPolicyAlert({ isAlertEnabled: true }); expect(store.dispatch).toHaveBeenLastCalledWith('networkPolicies/createPolicy', {