Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
60b82d46
Commit
60b82d46
authored
Oct 21, 2021
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add namespace to security orchestration strings
- move i18n strings out of vue template
parent
63bdd672
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
20 deletions
+56
-20
ee/app/assets/javascripts/threat_monitoring/components/policy_drawer/base_policy.vue
...hreat_monitoring/components/policy_drawer/base_policy.vue
+4
-2
ee/app/assets/javascripts/threat_monitoring/components/policy_drawer/cilium_network_policy.vue
...toring/components/policy_drawer/cilium_network_policy.vue
+18
-8
ee/app/assets/javascripts/threat_monitoring/components/policy_drawer/scan_execution_policy.vue
...toring/components/policy_drawer/scan_execution_policy.vue
+17
-7
ee/spec/frontend/threat_monitoring/components/policy_drawer/__snapshots__/cilium_network_policy_spec.js.snap
...y_drawer/__snapshots__/cilium_network_policy_spec.js.snap
+3
-1
ee/spec/frontend/threat_monitoring/components/policy_drawer/cilium_network_policy_spec.js
...ng/components/policy_drawer/cilium_network_policy_spec.js
+2
-1
locale/gitlab.pot
locale/gitlab.pot
+12
-1
No files found.
ee/app/assets/javascripts/threat_monitoring/components/policy_drawer/base_policy.vue
View file @
60b82d46
<
script
>
import
{
__
}
from
'
~/locale
'
;
import
{
s
__
}
from
'
~/locale
'
;
export
default
{
props
:
{
...
...
@@ -11,7 +11,9 @@ export default {
},
computed
:
{
statusLabel
()
{
return
this
.
policy
?.
enabled
?
__
(
'
Enabled
'
)
:
__
(
'
Disabled
'
);
return
this
.
policy
?.
enabled
?
s__
(
'
SecurityOrchestration|Enabled
'
)
:
s__
(
'
SecurityOrchestration|Disabled
'
);
},
},
};
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_drawer/cilium_network_policy.vue
View file @
60b82d46
<
script
>
import
{
GlIntersperse
}
from
'
@gitlab/ui
'
;
import
{
n__
,
s__
}
from
'
~/locale
'
;
import
{
removeUnnecessaryDashes
}
from
'
../../utils
'
;
import
{
fromYaml
,
humanizeNetworkPolicy
}
from
'
../policy_editor/network_policy/lib
'
;
import
PolicyPreview
from
'
../policy_editor/policy_preview.vue
'
;
...
...
@@ -7,6 +8,11 @@ import BasePolicy from './base_policy.vue';
import
PolicyInfoRow
from
'
./policy_info_row.vue
'
;
export
default
{
i18n
:
{
description
:
s__
(
'
SecurityOrchestration|Description
'
),
network
:
s__
(
'
NetworkPolicies|Network
'
),
status
:
s__
(
'
SecurityOrchestration|Status
'
),
},
components
:
{
GlIntersperse
,
BasePolicy
,
...
...
@@ -40,34 +46,38 @@ export default {
environments
()
{
return
this
.
policy
.
environments
?.
nodes
??
[];
},
environmentLabel
()
{
return
n__
(
'
Environment
'
,
'
Environments
'
,
this
.
environments
.
length
);
},
},
};
</
script
>
<
template
>
<base-policy
:policy=
"policy"
>
<template
#type
>
{{
s__
(
'
NetworkPolicies|Network
'
)
}}
</
template
>
<template
#type
>
{{
$options
.
i18n
.
network
}}
</
template
>
<
template
#default=
"{ statusLabel }"
>
<div
v-if=
"parsedYaml"
>
<policy-info-row
v-if=
"parsedYaml.description"
data-testid=
"description"
:label=
"__('Description')"
>
{{
parsedYaml
.
description
}}
</policy-info-row
:label=
"$options.i18n.description"
>
{{
parsedYaml
.
description
}}
</policy-info-row>
<policy-info-row
:label=
"
__('Status')
"
>
{{
statusLabel
}}
</policy-info-row>
<policy-info-row
:label=
"
$options.i18n.status
"
>
{{
statusLabel
}}
</policy-info-row>
<policy-info-row
v-if=
"environments.length"
data-testid=
"environments"
:label=
"
s__('SecurityPolicies|Environment(s)')
"
:label=
"
environmentLabel
"
>
<gl-intersperse>
<span
v-for=
"environment in environments"
:key=
"environment.name"
>
{{
environment
.
name
}}
</span>
<span
v-for=
"environment in environments"
:key=
"environment.name"
>
{{
environment
.
name
}}
</span>
</gl-intersperse>
</policy-info-row>
</div>
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_drawer/scan_execution_policy.vue
View file @
60b82d46
<
script
>
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
fromYaml
,
humanizeActions
,
...
...
@@ -9,6 +10,15 @@ import BasePolicy from './base_policy.vue';
import
PolicyInfoRow
from
'
./policy_info_row.vue
'
;
export
default
{
i18n
:
{
action
:
s__
(
'
SecurityOrchestration|Action
'
),
description
:
s__
(
'
SecurityOrchestration|Description
'
),
latestScan
:
s__
(
'
SecurityOrchestration|Latest scan
'
),
rule
:
s__
(
'
SecurityOrchestration|Rule
'
),
scanExecution
:
s__
(
'
SecurityOrchestration|Scan execution
'
),
status
:
s__
(
'
SecurityOrchestration|Status
'
),
viewResults
:
s__
(
'
SecurityOrchestration|view results
'
),
},
components
:
{
GlLink
,
BasePolicy
,
...
...
@@ -40,38 +50,38 @@ export default {
<
template
>
<base-policy
:policy=
"policy"
>
<template
#type
>
{{
s__
(
'
SecurityOrchestration|Scan execution
'
)
}}
</
template
>
<template
#type
>
{{
$options
.
i18n
.
scanExecution
}}
</
template
>
<
template
#default=
"{ statusLabel }"
>
<div
v-if=
"parsedYaml"
>
<policy-info-row
v-if=
"parsedYaml.description"
data-testid=
"policy-description"
:label=
"
s__('SecurityOrchestration|Description')
"
:label=
"
$options.i18n.description
"
>
{{
parsedYaml
.
description
}}
</policy-info-row>
<policy-info-row
data-testid=
"policy-rules"
:label=
"
s__('SecurityOrchestration|Rule')
"
>
<policy-info-row
data-testid=
"policy-rules"
:label=
"
$options.i18n.rule
"
>
<p
v-for=
"rule in humanizedRules"
:key=
"rule"
>
{{
rule
}}
</p>
</policy-info-row>
<policy-info-row
data-testid=
"policy-actions"
:label=
"
s__('SecurityOrchestration|Action')
"
>
<policy-info-row
data-testid=
"policy-actions"
:label=
"
$options.i18n.action
"
>
<p
v-for=
"action in humanizedActions"
:key=
"action"
>
{{
action
}}
</p>
</policy-info-row>
<policy-info-row
:label=
"
__('Status')
"
>
<policy-info-row
:label=
"
$options.i18n.status
"
>
{{
statusLabel
}}
</policy-info-row>
<policy-info-row
v-if=
"policy.latestScan"
data-testid=
"policy-latest-scan"
:label=
"
s__('SecurityOrchestration|Latest scan')
"
:label=
"
$options.i18n.latestScan
"
>
{{
policy
.
latestScan
.
date
}}
<gl-link
:href=
"policy.latestScan.pipelineUrl"
>
{{
s__
(
'
SecurityOrchestration|view results
'
)
}}
{{
$options
.
i18n
.
viewResults
}}
</gl-link></policy-info-row
>
</div>
...
...
ee/spec/frontend/threat_monitoring/components/policy_drawer/__snapshots__/cilium_network_policy_spec.js.snap
View file @
60b82d46
...
...
@@ -19,7 +19,9 @@ exports[`CiliumNetworkPolicy component supported YAML renders policy preview tab
data-testid="description"
label="Description"
>
test description
</policy-info-row-stub>
<policy-info-row-stub
...
...
ee/spec/frontend/threat_monitoring/components/policy_drawer/cilium_network_policy_spec.js
View file @
60b82d46
...
...
@@ -95,7 +95,8 @@ describe('CiliumNetworkPolicy component', () => {
},
});
expect
(
findEnvironments
().
exists
()).
toBe
(
true
);
expect
(
findEnvironments
().
text
()).
toBe
(
'
production, local
'
);
expect
(
findEnvironments
().
text
()).
toContain
(
'
production
'
);
expect
(
findEnvironments
().
text
()).
toContain
(
'
local
'
);
});
it
(
"
does not render environments row if there aren't any
"
,
()
=>
{
...
...
locale/gitlab.pot
View file @
60b82d46
...
...
@@ -12890,7 +12890,9 @@ msgid "Enterprise"
msgstr ""
msgid "Environment"
msgstr ""
msgid_plural "Environments"
msgstr[0] ""
msgstr[1] ""
msgid "Environment does not have deployments"
msgstr ""
...
...
@@ -30239,12 +30241,18 @@ msgstr ""
msgid "SecurityOrchestration|Description"
msgstr ""
msgid "SecurityOrchestration|Disabled"
msgstr ""
msgid "SecurityOrchestration|Edit policy"
msgstr ""
msgid "SecurityOrchestration|Edit policy project"
msgstr ""
msgid "SecurityOrchestration|Enabled"
msgstr ""
msgid "SecurityOrchestration|Enforce security for this project. %{linkStart}More information.%{linkEnd}"
msgstr ""
...
...
@@ -30314,6 +30322,9 @@ msgstr ""
msgid "SecurityOrchestration|Sorry, your filter produced no results."
msgstr ""
msgid "SecurityOrchestration|Status"
msgstr ""
msgid "SecurityOrchestration|There was a problem creating the new security policy"
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment