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
cd0b8533
Commit
cd0b8533
authored
Aug 30, 2021
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix editing of scan execution policies
- update `isEditing` computed property - update tests
parent
de200ba4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue
...eat_monitoring/components/policy_editor/policy_editor.vue
+4
-1
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js
...monitoring/components/policy_editor/policy_editor_spec.js
+3
-3
ee/spec/frontend/threat_monitoring/components/policy_editor/scan_execution_policy/lib/from_yaml_spec.js
...policy_editor/scan_execution_policy/lib/from_yaml_spec.js
+1
-1
ee/spec/frontend/threat_monitoring/mocks/mock_data.js
ee/spec/frontend/threat_monitoring/mocks/mock_data.js
+0
-2
No files found.
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_editor.vue
View file @
cd0b8533
...
...
@@ -40,7 +40,10 @@ export default {
return
this
.
isEditing
?
this
.
policyType
:
this
.
newPolicyType
;
},
isEditing
()
{
return
Boolean
(
this
.
existingPolicy
?.
creation_timestamp
||
this
.
existingPolicy
?.
updatedAt
);
return
Boolean
(
this
.
existingPolicy
?.
creation_timestamp
||
this
.
existingPolicy
?.
type
===
POLICY_TYPE_COMPONENT_OPTIONS
.
scanExecution
.
urlParameter
,
);
},
policyTypes
()
{
return
Object
.
values
(
POLICY_TYPE_COMPONENT_OPTIONS
);
...
...
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_editor_spec.js
View file @
cd0b8533
...
...
@@ -93,9 +93,9 @@ describe('PolicyEditor component', () => {
describe
(
'
when an existing policy is present
'
,
()
=>
{
it
.
each
`
policyType | option | existingPolicy | findComponent
${
'
container_policy
'
}
|
${
POLICY_TYPE_COMPONENT_OPTIONS
.
container
}
|
${{
manifest
:
mockL3Manifest
,
updatedAt
:
'
2020-04-14T00:08:30Z
'
}
} |
${
findNeworkPolicyEditor
}
${
'
scan_execution_policy
'
}
|
${
POLICY_TYPE_COMPONENT_OPTIONS
.
scanExecution
}
|
${
mockDastScanExecutionObject
}
|
${
findScanExecutionPolicyEditor
}
policyType | option | existingPolicy
| findComponent
${
'
container_policy
'
}
|
${
POLICY_TYPE_COMPONENT_OPTIONS
.
container
}
|
${{
manifest
:
mockL3Manifest
,
creation_timestamp
:
'
2020-04-14T00:08:30Z
'
}
} |
${
findNeworkPolicyEditor
}
${
'
scan_execution_policy
'
}
|
${
POLICY_TYPE_COMPONENT_OPTIONS
.
scanExecution
}
|
${
mockDastScanExecutionObject
}
|
${
findScanExecutionPolicyEditor
}
`
(
'
renders the disabled form select for existing policy of type $policyType
'
,
async
({
existingPolicy
,
findComponent
,
option
,
policyType
})
=>
{
...
...
ee/spec/frontend/threat_monitoring/components/policy_editor/scan_execution_policy/lib/from_yaml_spec.js
View file @
cd0b8533
...
...
@@ -6,6 +6,6 @@ import {
describe
(
'
fromYaml
'
,
()
=>
{
it
(
'
returns policy object
'
,
()
=>
{
expect
(
fromYaml
(
mockDastScanExecutionManifest
)).
to
MatchObject
(
mockDastScanExecutionObject
);
expect
(
fromYaml
(
mockDastScanExecutionManifest
)).
to
StrictEqual
(
mockDastScanExecutionObject
);
});
});
ee/spec/frontend/threat_monitoring/mocks/mock_data.js
View file @
cd0b8533
...
...
@@ -23,7 +23,6 @@ rules:
- type: pipeline
branches:
- main
updatedAt: '2020-04-14T00:08:30Z'
actions:
- scan: dast
site_profile: required_site_profile
...
...
@@ -36,7 +35,6 @@ export const mockDastScanExecutionObject = {
description
:
'
This policy enforces pipeline configuration to have a job with DAST scan
'
,
enabled
:
false
,
rules
:
[{
type
:
'
pipeline
'
,
branches
:
[
'
main
'
]
}],
updatedAt
:
'
2020-04-14T00:08:30Z
'
,
actions
:
[
{
scan
:
'
dast
'
,
...
...
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