Commit cb39e5bb authored by James Fargher's avatar James Fargher

Merge branch 'fix-policy-editor-with-security-orchestration-ff-off' into 'master'

Add additional properties to policy_details helper

See merge request gitlab-org/gitlab!70553
parents f77c3e29 5645f93c
...@@ -31,11 +31,14 @@ module PolicyHelper ...@@ -31,11 +31,14 @@ module PolicyHelper
{ {
assigned_policy_project: assigned_policy_project(project).to_json, assigned_policy_project: assigned_policy_project(project).to_json,
default_environment_id: project.default_environment&.id || -1,
disable_scan_execution_update: disable_scan_execution_update.to_s, disable_scan_execution_update: disable_scan_execution_update.to_s,
network_policies_endpoint: project_security_network_policies_path(project), network_policies_endpoint: project_security_network_policies_path(project),
configure_agent_help_path: help_page_url('user/clusters/agent/repository.html'), configure_agent_help_path: help_page_url('user/clusters/agent/repository.html'),
create_agent_help_path: help_page_url('user/clusters/agent/index.md', anchor: 'create-an-agent-record-in-gitlab'), create_agent_help_path: help_page_url('user/clusters/agent/index.md', anchor: 'create-an-agent-record-in-gitlab'),
environments_endpoint: project_environments_path(project), environments_endpoint: project_environments_path(project),
network_documentation_path: help_page_path('user/application_security/policies/index'),
no_environment_svg_path: image_path('illustrations/monitoring/unable_to_connect.svg'),
project_path: project.full_path, project_path: project.full_path,
project_id: project.id, project_id: project.id,
threat_monitoring_path: project_threat_monitoring_path(project) threat_monitoring_path: project_threat_monitoring_path(project)
......
...@@ -18,11 +18,14 @@ RSpec.describe PolicyHelper do ...@@ -18,11 +18,14 @@ RSpec.describe PolicyHelper do
let(:base_data) do let(:base_data) do
{ {
assigned_policy_project: "null", assigned_policy_project: "null",
default_environment_id: -1,
disable_scan_execution_update: "false", disable_scan_execution_update: "false",
network_policies_endpoint: kind_of(String), network_policies_endpoint: kind_of(String),
configure_agent_help_path: kind_of(String), configure_agent_help_path: kind_of(String),
create_agent_help_path: kind_of(String), create_agent_help_path: kind_of(String),
environments_endpoint: kind_of(String), environments_endpoint: kind_of(String),
network_documentation_path: kind_of(String),
no_environment_svg_path: kind_of(String),
project_path: project.full_path, project_path: project.full_path,
project_id: project.id, project_id: project.id,
threat_monitoring_path: kind_of(String) threat_monitoring_path: kind_of(String)
...@@ -51,6 +54,7 @@ RSpec.describe PolicyHelper do ...@@ -51,6 +54,7 @@ RSpec.describe PolicyHelper do
it 'returns expected policy data' do it 'returns expected policy data' do
expect(subject).to match( expect(subject).to match(
base_data.merge( base_data.merge(
default_environment_id: project.default_environment.id,
policy: policy.to_json, policy: policy.to_json,
environment_id: environment.id environment_id: environment.id
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment