Commit 63bdd672 authored by Alexander Turinske's avatar Alexander Turinske

Change enforcement label to status

- enforcement is unnecessary

Changelog: changed
EE: true
parent eb78edda
...@@ -118,9 +118,9 @@ examining the Cilium logs: ...@@ -118,9 +118,9 @@ examining the Cilium logs:
kubectl -n gitlab-managed-apps logs -l k8s-app=cilium -c cilium-monitor kubectl -n gitlab-managed-apps logs -l k8s-app=cilium -c cilium-monitor
``` ```
### Change the enforcement status ### Change the status
To change a network policy's enforcement status: To change a network policy's status:
- Select the network policy you want to update. - Select the network policy you want to update.
- Select **Edit policy**. - Select **Edit policy**.
......
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
}, },
}, },
computed: { computed: {
enforcementStatusLabel() { statusLabel() {
return this.policy?.enabled ? __('Enabled') : __('Disabled'); return this.policy?.enabled ? __('Enabled') : __('Disabled');
}, },
}, },
...@@ -23,6 +23,6 @@ export default { ...@@ -23,6 +23,6 @@ export default {
<p data-testid="policy-type"> <p data-testid="policy-type">
<slot name="type"></slot> <slot name="type"></slot>
</p> </p>
<slot v-bind="{ enforcementStatusLabel }"></slot> <slot v-bind="{ statusLabel }"></slot>
</div> </div>
</template> </template>
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
<base-policy :policy="policy"> <base-policy :policy="policy">
<template #type>{{ s__('NetworkPolicies|Network') }}</template> <template #type>{{ s__('NetworkPolicies|Network') }}</template>
<template #default="{ enforcementStatusLabel }"> <template #default="{ statusLabel }">
<div v-if="parsedYaml"> <div v-if="parsedYaml">
<policy-info-row <policy-info-row
v-if="parsedYaml.description" v-if="parsedYaml.description"
...@@ -57,9 +57,7 @@ export default { ...@@ -57,9 +57,7 @@ export default {
>{{ parsedYaml.description }}</policy-info-row >{{ parsedYaml.description }}</policy-info-row
> >
<policy-info-row :label="s__('NetworkPolicies|Enforcement status')">{{ <policy-info-row :label="__('Status')">{{ statusLabel }}</policy-info-row>
enforcementStatusLabel
}}</policy-info-row>
<policy-info-row <policy-info-row
v-if="environments.length" v-if="environments.length"
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
<base-policy :policy="policy"> <base-policy :policy="policy">
<template #type>{{ s__('SecurityOrchestration|Scan execution') }}</template> <template #type>{{ s__('SecurityOrchestration|Scan execution') }}</template>
<template #default="{ enforcementStatusLabel }"> <template #default="{ statusLabel }">
<div v-if="parsedYaml"> <div v-if="parsedYaml">
<policy-info-row <policy-info-row
v-if="parsedYaml.description" v-if="parsedYaml.description"
...@@ -60,8 +60,8 @@ export default { ...@@ -60,8 +60,8 @@ export default {
<p v-for="action in humanizedActions" :key="action">{{ action }}</p> <p v-for="action in humanizedActions" :key="action">{{ action }}</p>
</policy-info-row> </policy-info-row>
<policy-info-row :label="s__('SecurityOrchestration|Enforcement Status')"> <policy-info-row :label="__('Status')">
{{ enforcementStatusLabel }} {{ statusLabel }}
</policy-info-row> </policy-info-row>
<policy-info-row <policy-info-row
......
...@@ -23,7 +23,7 @@ exports[`CiliumNetworkPolicy component supported YAML renders policy preview tab ...@@ -23,7 +23,7 @@ exports[`CiliumNetworkPolicy component supported YAML renders policy preview tab
</policy-info-row-stub> </policy-info-row-stub>
<policy-info-row-stub <policy-info-row-stub
label="Enforcement status" label="Status"
> >
Disabled Disabled
</policy-info-row-stub> </policy-info-row-stub>
......
...@@ -5,7 +5,7 @@ describe('BasePolicy component', () => { ...@@ -5,7 +5,7 @@ describe('BasePolicy component', () => {
let wrapper; let wrapper;
const findPolicyType = () => wrapper.findByTestId('policy-type'); const findPolicyType = () => wrapper.findByTestId('policy-type');
const findEnforcementStatusLabel = () => wrapper.findByTestId('enforcement-status-label'); const findStatusLabel = () => wrapper.findByTestId('status-label');
const factory = (propsData = {}) => { const factory = (propsData = {}) => {
wrapper = shallowMountExtended(BasePolicy, { wrapper = shallowMountExtended(BasePolicy, {
...@@ -14,8 +14,7 @@ describe('BasePolicy component', () => { ...@@ -14,8 +14,7 @@ describe('BasePolicy component', () => {
type: 'Policy type', type: 'Policy type',
}, },
scopedSlots: { scopedSlots: {
default: default: '<span data-testid="status-label">{{ props.statusLabel }}</span>',
'<span data-testid="enforcement-status-label">{{ props.enforcementStatusLabel }}</span>',
}, },
}); });
}; };
...@@ -34,16 +33,13 @@ describe('BasePolicy component', () => { ...@@ -34,16 +33,13 @@ describe('BasePolicy component', () => {
description | enabled | expectedLabel description | enabled | expectedLabel
${'enabled'} | ${true} | ${'Enabled'} ${'enabled'} | ${true} | ${'Enabled'}
${'disabled'} | ${false} | ${'Disabled'} ${'disabled'} | ${false} | ${'Disabled'}
`( `('renders the status label when policy is $description', ({ enabled, expectedLabel }) => {
'renders the enforcement status label when policy is $description',
({ enabled, expectedLabel }) => {
factory({ factory({
policy: { policy: {
enabled, enabled,
}, },
}); });
expect(findEnforcementStatusLabel().text()).toBe(expectedLabel); expect(findStatusLabel().text()).toBe(expectedLabel);
}, });
);
}); });
...@@ -22591,9 +22591,6 @@ msgstr "" ...@@ -22591,9 +22591,6 @@ msgstr ""
msgid "NetworkPolicies|Edit policy" msgid "NetworkPolicies|Edit policy"
msgstr "" msgstr ""
msgid "NetworkPolicies|Enforcement status"
msgstr ""
msgid "NetworkPolicies|Environment does not have deployment platform" msgid "NetworkPolicies|Environment does not have deployment platform"
msgstr "" msgstr ""
...@@ -30251,9 +30248,6 @@ msgstr "" ...@@ -30251,9 +30248,6 @@ msgstr ""
msgid "SecurityOrchestration|Enforce security for this project. %{linkStart}More information.%{linkEnd}" msgid "SecurityOrchestration|Enforce security for this project. %{linkStart}More information.%{linkEnd}"
msgstr "" msgstr ""
msgid "SecurityOrchestration|Enforcement Status"
msgstr ""
msgid "SecurityOrchestration|Executes a %{scanType} scan" msgid "SecurityOrchestration|Executes a %{scanType} scan"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment