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
ec2ed1fe
Commit
ec2ed1fe
authored
Apr 14, 2022
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update helpers to be more concise
- ensure helper matches project helper
parent
aa89bd58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
ee/app/helpers/ee/security_orchestration_helper.rb
ee/app/helpers/ee/security_orchestration_helper.rb
+2
-2
ee/app/views/groups/security/policies/new.html.haml
ee/app/views/groups/security/policies/new.html.haml
+1
-2
ee/spec/helpers/ee/security_orchestration_helper_spec.rb
ee/spec/helpers/ee/security_orchestration_helper_spec.rb
+3
-8
No files found.
ee/app/helpers/ee/security_orchestration_helper.rb
View file @
ec2ed1fe
...
@@ -11,8 +11,8 @@ module EE
...
@@ -11,8 +11,8 @@ module EE
return
unless
namespace
return
unless
namespace
{
{
assigned_policy_project:
'null'
,
assigned_policy_project:
nil
.
to_json
,
disable_scan_policy_update:
false
,
disable_scan_policy_update:
false
.
to_s
,
create_agent_help_path:
help_page_url
(
'user/clusters/agent/install/index'
),
create_agent_help_path:
help_page_url
(
'user/clusters/agent/install/index'
),
policy:
policy
&
.
to_json
,
policy:
policy
&
.
to_json
,
policy_editor_empty_state_svg_path:
image_path
(
'illustrations/monitoring/unable_to_connect.svg'
),
policy_editor_empty_state_svg_path:
image_path
(
'illustrations/monitoring/unable_to_connect.svg'
),
...
...
ee/app/views/groups/security/policies/new.html.haml
View file @
ec2ed1fe
-
add_to_breadcrumbs
s_
(
"SecurityOrchestration|Policies"
),
group_security_policies_path
(
@group
)
-
add_to_breadcrumbs
s_
(
"SecurityOrchestration|Policies"
),
group_security_policies_path
(
@group
)
-
breadcrumb_title
s_
(
"SecurityOrchestration|New policy"
)
-
breadcrumb_title
s_
(
"SecurityOrchestration|New policy"
)
-
page_title
s_
(
"SecurityOrchestration|Policy editor"
)
-
page_title
s_
(
"SecurityOrchestration|Policy editor"
)
-
data
=
security_orchestration_policy_data
(
@group
)
#js-group-policy-builder-app
{
data:
data
}
#js-group-policy-builder-app
{
data:
security_orchestration_policy_data
(
@group
)
}
ee/spec/helpers/ee/security_orchestration_helper_spec.rb
View file @
ec2ed1fe
...
@@ -10,8 +10,8 @@ RSpec.describe EE::SecurityOrchestrationHelper do
...
@@ -10,8 +10,8 @@ RSpec.describe EE::SecurityOrchestrationHelper do
let
(
:owner
)
{
namespace
.
first_owner
}
let
(
:owner
)
{
namespace
.
first_owner
}
let
(
:base_data
)
do
let
(
:base_data
)
do
{
{
assigned_policy_project:
"null"
,
assigned_policy_project:
nil
.
to_json
,
disable_scan_policy_update:
false
,
disable_scan_policy_update:
false
.
to_s
,
create_agent_help_path:
kind_of
(
String
),
create_agent_help_path:
kind_of
(
String
),
policy:
policy
&
.
to_json
,
policy:
policy
&
.
to_json
,
policy_editor_empty_state_svg_path:
kind_of
(
String
),
policy_editor_empty_state_svg_path:
kind_of
(
String
),
...
@@ -40,12 +40,7 @@ RSpec.describe EE::SecurityOrchestrationHelper do
...
@@ -40,12 +40,7 @@ RSpec.describe EE::SecurityOrchestrationHelper do
let
(
:policy_type
)
{
'scan_execution_policy'
}
let
(
:policy_type
)
{
'scan_execution_policy'
}
let
(
:policy
)
do
let
(
:policy
)
do
Gitlab
::
Kubernetes
::
CiliumNetworkPolicy
.
new
(
build
(
:scan_execution_policy
,
name:
'Run DAST in every pipeline'
)
name:
'policy'
,
namespace:
'another'
,
selector:
{
matchLabels:
{
role:
'db'
}
},
ingress:
[{
from:
[{
namespaceSelector:
{
matchLabels:
{
group:
'mygroup'
}
}
}]
}]
)
end
end
it
{
is_expected
.
to
match
(
base_data
)
}
it
{
is_expected
.
to
match
(
base_data
)
}
...
...
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