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
66a083e6
Commit
66a083e6
authored
Mar 31, 2021
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests and formatting
- add changelog
parent
4ba53e14
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
8 deletions
+34
-8
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_drawer.vue
...eat_monitoring/components/policy_editor/policy_drawer.vue
+16
-6
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_preview.vue
...at_monitoring/components/policy_editor/policy_preview.vue
+10
-2
ee/changelogs/unreleased/271169-update-yaml-parsing.yml
ee/changelogs/unreleased/271169-update-yaml-parsing.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_drawer.vue
View file @
66a083e6
...
...
@@ -17,14 +17,22 @@ export default {
},
},
computed
:
{
canHumanizePolicy
()
{
console
.
log
(
'
to/from
'
,
toYaml
(
fromYaml
(
this
.
value
)));
console
.
log
(
'
original
'
,
this
.
value
);
return
this
.
value
.
includes
(
toYaml
(
fromYaml
(
this
.
value
)));
},
initialTab
()
{
return
this
.
canHumanizePolicy
?
1
:
0
;
},
policy
()
{
return
fromYaml
(
this
.
value
)
;
return
this
.
canHumanizePolicy
?
fromYaml
(
this
.
value
)
:
null
;
},
humanizedPolicy
()
{
return
humanizeNetworkPolicy
(
this
.
policy
)
;
return
this
.
canHumanizePolicy
?
humanizeNetworkPolicy
(
this
.
policy
)
:
null
;
},
policyYaml
()
{
return
t
oYaml
(
this
.
policy
)
;
return
t
his
.
value
;
},
},
methods
:
{
...
...
@@ -43,12 +51,14 @@ export default {
<h5
class=
"gl-mt-6"
>
{{
s__
(
'
NetworkPolicies|Policy type
'
)
}}
</h5>
<p>
{{
s__
(
'
NetworkPolicies|Network Policy
'
)
}}
</p>
<h5
class=
"gl-mt-6"
>
{{
s__
(
'
NetworkPolicies|Description
'
)
}}
</h5>
<gl-form-textarea
:value=
"policy.description"
@
input=
"updateManifest"
/>
<div
v-if=
"canHumanizePolicy"
>
<h5
class=
"gl-mt-6"
>
{{
s__
(
'
NetworkPolicies|Description
'
)
}}
</h5>
<gl-form-textarea
:value=
"policy.description"
@
input=
"updateManifest"
/>
</div>
<policy-preview
class=
"gl-mt-4"
:initial-tab=
"
1
"
:initial-tab=
"
initialTab
"
:policy-yaml=
"policyYaml"
:policy-description=
"humanizedPolicy"
/>
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_preview.vue
View file @
66a083e6
<
script
>
import
{
GlTabs
,
GlTab
,
GlSafeHtmlDirective
}
from
'
@gitlab/ui
'
;
import
{
Gl
Alert
,
Gl
Tabs
,
GlTab
,
GlSafeHtmlDirective
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlAlert
,
GlTabs
,
GlTab
,
},
...
...
@@ -16,7 +17,8 @@ export default {
},
policyDescription
:
{
type
:
String
,
required
:
true
,
required
:
false
,
default
:
''
,
},
initialTab
:
{
type
:
Number
,
...
...
@@ -40,9 +42,15 @@ export default {
</gl-tab>
<gl-tab
:title=
"s__('NetworkPolicies|Rule')"
>
<div
v-if=
"policyDescription"
v-safe-html:
[$
options.safeHtmlConfig]=
"policyDescription"
class=
"gl-bg-white gl-rounded-top-left-none gl-rounded-top-right-none gl-rounded-bottom-left-base gl-rounded-bottom-right-base gl-py-3 gl-px-4 gl-border-1 gl-border-solid gl-border-gray-100"
></div>
<div
v-else
>
<gl-alert
variant=
"info"
:dismissible=
"false"
>
{{
s__
(
'
NetworkPolicies|Unsupported attribute
'
)
}}
</gl-alert>
</div>
</gl-tab>
</gl-tabs>
</
template
>
ee/changelogs/unreleased/271169-update-yaml-parsing.yml
0 → 100644
View file @
66a083e6
---
title
:
Throw an error when yaml mode contains unparsable attributes
merge_request
:
54987
author
:
type
:
fixed
locale/gitlab.pot
View file @
66a083e6
...
...
@@ -20790,6 +20790,9 @@ msgstr ""
msgid "NetworkPolicies|Unable to parse policy"
msgstr ""
msgid "NetworkPolicies|Unsupported attribute"
msgstr ""
msgid "NetworkPolicies|YAML editor"
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