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:
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 **Edit policy**.
......
......@@ -10,7 +10,7 @@ export default {
},
},
computed: {
enforcementStatusLabel() {
statusLabel() {
return this.policy?.enabled ? __('Enabled') : __('Disabled');
},
},
......@@ -23,6 +23,6 @@ export default {
<p data-testid="policy-type">
<slot name="type"></slot>
</p>
<slot v-bind="{ enforcementStatusLabel }"></slot>
<slot v-bind="{ statusLabel }"></slot>
</div>
</template>
......@@ -48,7 +48,7 @@ export default {
<base-policy :policy="policy">
<template #type>{{ s__('NetworkPolicies|Network') }}</template>
<template #default="{ enforcementStatusLabel }">
<template #default="{ statusLabel }">
<div v-if="parsedYaml">
<policy-info-row
v-if="parsedYaml.description"
......@@ -57,9 +57,7 @@ export default {
>{{ parsedYaml.description }}</policy-info-row
>
<policy-info-row :label="s__('NetworkPolicies|Enforcement status')">{{
enforcementStatusLabel
}}</policy-info-row>
<policy-info-row :label="__('Status')">{{ statusLabel }}</policy-info-row>
<policy-info-row
v-if="environments.length"
......
......@@ -42,7 +42,7 @@ export default {
<base-policy :policy="policy">
<template #type>{{ s__('SecurityOrchestration|Scan execution') }}</template>
<template #default="{ enforcementStatusLabel }">
<template #default="{ statusLabel }">
<div v-if="parsedYaml">
<policy-info-row
v-if="parsedYaml.description"
......@@ -60,8 +60,8 @@ export default {
<p v-for="action in humanizedActions" :key="action">{{ action }}</p>
</policy-info-row>
<policy-info-row :label="s__('SecurityOrchestration|Enforcement Status')">
{{ enforcementStatusLabel }}
<policy-info-row :label="__('Status')">
{{ statusLabel }}
</policy-info-row>
<policy-info-row
......
......@@ -23,7 +23,7 @@ exports[`CiliumNetworkPolicy component supported YAML renders policy preview tab
</policy-info-row-stub>
<policy-info-row-stub
label="Enforcement status"
label="Status"
>
Disabled
</policy-info-row-stub>
......
......@@ -5,7 +5,7 @@ describe('BasePolicy component', () => {
let wrapper;
const findPolicyType = () => wrapper.findByTestId('policy-type');
const findEnforcementStatusLabel = () => wrapper.findByTestId('enforcement-status-label');
const findStatusLabel = () => wrapper.findByTestId('status-label');
const factory = (propsData = {}) => {
wrapper = shallowMountExtended(BasePolicy, {
......@@ -14,8 +14,7 @@ describe('BasePolicy component', () => {
type: 'Policy type',
},
scopedSlots: {
default:
'<span data-testid="enforcement-status-label">{{ props.enforcementStatusLabel }}</span>',
default: '<span data-testid="status-label">{{ props.statusLabel }}</span>',
},
});
};
......@@ -34,16 +33,13 @@ describe('BasePolicy component', () => {
description | enabled | expectedLabel
${'enabled'} | ${true} | ${'Enabled'}
${'disabled'} | ${false} | ${'Disabled'}
`(
'renders the enforcement status label when policy is $description',
({ enabled, expectedLabel }) => {
factory({
policy: {
enabled,
},
});
expect(findEnforcementStatusLabel().text()).toBe(expectedLabel);
},
);
`('renders the status label when policy is $description', ({ enabled, expectedLabel }) => {
factory({
policy: {
enabled,
},
});
expect(findStatusLabel().text()).toBe(expectedLabel);
});
});
......@@ -22591,9 +22591,6 @@ msgstr ""
msgid "NetworkPolicies|Edit policy"
msgstr ""
msgid "NetworkPolicies|Enforcement status"
msgstr ""
msgid "NetworkPolicies|Environment does not have deployment platform"
msgstr ""
......@@ -30251,9 +30248,6 @@ msgstr ""
msgid "SecurityOrchestration|Enforce security for this project. %{linkStart}More information.%{linkEnd}"
msgstr ""
msgid "SecurityOrchestration|Enforcement Status"
msgstr ""
msgid "SecurityOrchestration|Executes a %{scanType} scan"
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