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
af1fadd1
Commit
af1fadd1
authored
Sep 16, 2020
by
ap4y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not update yaml preview with errors in policy editor
parent
b5fa3a62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue
...eat_monitoring/components/policy_editor/policy_editor.vue
+1
-1
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js
...monitoring/components/policy_editor/policy_editor_spec.js
+10
-0
No files found.
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue
View file @
af1fadd1
...
...
@@ -146,7 +146,7 @@ export default {
}
},
changeEditorMode
(
mode
)
{
if
(
mode
===
EditorModeYAML
)
{
if
(
mode
===
EditorModeYAML
&&
!
this
.
hasParsingError
)
{
this
.
yamlEditorValue
=
toYaml
(
this
.
policy
);
}
...
...
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js
View file @
af1fadd1
...
...
@@ -215,6 +215,16 @@ spec:
it
(
'
disables add rule button
'
,
()
=>
{
expect
(
findAddRuleButton
().
props
(
'
disabled
'
)).
toBe
(
true
);
});
it
(
'
does not update yaml editor value on switch to yaml editor
'
,
async
()
=>
{
findPolicyName
().
vm
.
$emit
(
'
input
'
,
'
test-policy
'
);
wrapper
.
find
(
"
[data-testid='editor-mode']
"
).
vm
.
$emit
(
'
input
'
,
EditorModeYAML
);
await
wrapper
.
vm
.
$nextTick
();
const
editor
=
findNetworkPolicyEditor
();
expect
(
editor
.
exists
()).
toBe
(
true
);
expect
(
editor
.
props
(
'
value
'
)).
toEqual
(
''
);
});
});
it
(
'
creates policy and redirects to a threat monitoring path
'
,
async
()
=>
{
...
...
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