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
808f57df
Commit
808f57df
authored
Mar 26, 2021
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up network-policy-editor
- fix styling - make tests more concise - move changelog
parent
f42183fd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
12 deletions
+16
-12
ee/app/assets/javascripts/threat_monitoring/components/network_policy_editor.vue
...ts/threat_monitoring/components/network_policy_editor.vue
+1
-0
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue
...eat_monitoring/components/policy_editor/policy_editor.vue
+8
-7
ee/changelogs/unreleased/threat-monitoring-policy-editor-source-editor.yml
...eleased/threat-monitoring-policy-editor-source-editor.yml
+0
-0
ee/spec/frontend/threat_monitoring/components/network_policy_editor_spec.js
...hreat_monitoring/components/network_policy_editor_spec.js
+7
-4
ee/spec/frontend/threat_monitoring/components/policy_editor/__snapshots__/policy_editor_spec.js.snap
...ts/policy_editor/__snapshots__/policy_editor_spec.js.snap
+0
-1
No files found.
ee/app/assets/javascripts/threat_monitoring/components/network_policy_editor.vue
View file @
808f57df
...
@@ -22,6 +22,7 @@ export default {
...
@@ -22,6 +22,7 @@ export default {
lineNumbers
:
'
off
'
,
lineNumbers
:
'
off
'
,
minimap
:
{
enabled
:
false
},
minimap
:
{
enabled
:
false
},
folding
:
false
,
folding
:
false
,
glyphMargin
:
false
,
renderIndentGuides
:
false
,
renderIndentGuides
:
false
,
renderWhitespace
:
'
boundary
'
,
renderWhitespace
:
'
boundary
'
,
renderLineHighlight
:
'
none
'
,
renderLineHighlight
:
'
none
'
,
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue
View file @
808f57df
...
@@ -365,13 +365,14 @@ export default {
...
@@ -365,13 +365,14 @@ export default {
>
>
{{ s__('NetworkPolicies|YAML editor') }}
{{ s__('NetworkPolicies|YAML editor') }}
</h5>
</h5>
<network-policy-editor
<div
class=
"gl-p-4"
>
data-testid=
"network-policy-editor"
<network-policy-editor
:value=
"yamlEditorValue"
data-testid=
"network-policy-editor"
:height=
"400"
:value=
"yamlEditorValue"
:read-only=
"false"
:read-only=
"false"
@
input=
"loadYaml"
@
input=
"loadYaml"
/>
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
changelogs/unreleased/threat-monitoring-policy-editor-source-editor.yml
→
ee/
changelogs/unreleased/threat-monitoring-policy-editor-source-editor.yml
View file @
808f57df
File moved
ee/spec/frontend/threat_monitoring/components/network_policy_editor_spec.js
View file @
808f57df
...
@@ -5,6 +5,8 @@ import EditorLite from '~/vue_shared/components/editor_lite.vue';
...
@@ -5,6 +5,8 @@ import EditorLite from '~/vue_shared/components/editor_lite.vue';
describe
(
'
NetworkPolicyEditor component
'
,
()
=>
{
describe
(
'
NetworkPolicyEditor component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
findEditor
=
()
=>
wrapper
.
findComponent
(
EditorLite
);
const
factory
=
({
propsData
}
=
{})
=>
{
const
factory
=
({
propsData
}
=
{})
=>
{
wrapper
=
shallowMount
(
NetworkPolicyEditor
,
{
wrapper
=
shallowMount
(
NetworkPolicyEditor
,
{
propsData
:
{
propsData
:
{
...
@@ -27,17 +29,18 @@ describe('NetworkPolicyEditor component', () => {
...
@@ -27,17 +29,18 @@ describe('NetworkPolicyEditor component', () => {
});
});
it
(
'
renders container element
'
,
()
=>
{
it
(
'
renders container element
'
,
()
=>
{
expect
(
wrapper
.
findComponent
(
EditorLite
).
exists
()).
toBe
(
true
);
expect
(
findEditor
(
).
exists
()).
toBe
(
true
);
});
});
it
(
'
initializes monaco editor with yaml language and provided value
'
,
()
=>
{
it
(
'
initializes monaco editor with yaml language and provided value
'
,
()
=>
{
const
editor
=
wrapper
.
findComponent
(
EditorLite
).
vm
.
getEditor
();
const
editorComponent
=
findEditor
();
expect
(
editorComponent
.
props
(
'
value
'
)).
toBe
(
'
foo
'
);
const
editor
=
editorComponent
.
vm
.
getEditor
();
expect
(
editor
.
getModel
().
getModeId
()).
toBe
(
'
yaml
'
);
expect
(
editor
.
getModel
().
getModeId
()).
toBe
(
'
yaml
'
);
expect
(
editor
.
getValue
()).
toBe
(
'
foo
'
);
});
});
it
(
"
emits input event on editor's input
"
,
async
()
=>
{
it
(
"
emits input event on editor's input
"
,
async
()
=>
{
const
editor
=
wrapper
.
findComponent
(
EditorLite
);
const
editor
=
findEditor
(
);
editor
.
vm
.
$emit
(
'
input
'
);
editor
.
vm
.
$emit
(
'
input
'
);
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
emitted
().
input
).
toBeTruthy
();
expect
(
wrapper
.
emitted
().
input
).
toBeTruthy
();
...
...
ee/spec/frontend/threat_monitoring/components/policy_editor/__snapshots__/policy_editor_spec.js.snap
View file @
808f57df
...
@@ -24,7 +24,6 @@ exports[`PolicyEditorApp component given .yaml editor mode is enabled renders ya
...
@@ -24,7 +24,6 @@ exports[`PolicyEditorApp component given .yaml editor mode is enabled renders ya
>
>
<networkpolicyeditor-stub
<networkpolicyeditor-stub
data-testid="network-policy-editor"
data-testid="network-policy-editor"
height="400"
value=""
value=""
/>
/>
</div>
</div>
...
...
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