Start using new DAST profiles routes

Start favoring new DAST profiles routes over old ones. This is in an
intermediary change before we effectively remove the old routes that
will no longer be needed.
parent 58f318e0
......@@ -28,7 +28,7 @@ module Types
field :edit_path, GraphQL::STRING_TYPE, null: true,
description: 'Relative web path to the edit page of a scanner profile',
resolve: -> (obj, _args, _ctx) do
Rails.application.routes.url_helpers.edit_project_dast_scanner_profile_path(obj.project, obj)
Rails.application.routes.url_helpers.edit_project_security_configuration_dast_profiles_dast_scanner_profile_path(obj.project, obj)
end
end
end
......@@ -23,7 +23,7 @@ module Types
field :edit_path, GraphQL::STRING_TYPE, null: true,
description: 'Relative web path to the edit page of a site profile',
resolve: -> (obj, _args, _ctx) do
Rails.application.routes.url_helpers.edit_project_dast_site_profile_path(obj.project, obj)
Rails.application.routes.url_helpers.edit_project_security_configuration_dast_profiles_dast_site_profile_path(obj.project, obj)
end
field :validation_status, Types::DastSiteProfileValidationStatusEnum, null: true,
......
......@@ -7,10 +7,10 @@ module Projects::OnDemandScansHelper
'empty-state-svg-path' => image_path('illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace,
'scanner-profiles-library-path' => project_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_dast_site_profile_path(project)
'scanner-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_security_configuration_dast_profiles_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_security_configuration_dast_profiles_dast_site_profile_path(project)
}
end
end
......@@ -178,7 +178,7 @@ module Projects
def configuration_path(type)
{
sast: project_security_configuration_sast_path(project),
dast_profiles: project_profiles_path(project)
dast_profiles: project_security_configuration_dast_profiles_path(project)
}[type]
end
end
......
---
title: Update DAST profiles routes
merge_request: 42859
author:
type: changed
......@@ -77,7 +77,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do
describe 'edit_path field' do
it 'is the relative path to edit the dast_site_profile' do
path = "/#{project.full_path}/-/on_demand_scans/profiles/dast_site_profiles/#{dast_site_profile.id}/edit"
path = "/#{project.full_path}/-/security/configuration/dast_profiles/dast_site_profiles/#{dast_site_profile.id}/edit"
expect(first_dast_site_profile['editPath']).to eq(path)
end
......
......@@ -12,10 +12,10 @@ RSpec.describe Projects::OnDemandScansHelper do
'empty-state-svg-path' => match_asset_path('/assets/illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace,
'scanner-profiles-library-path' => project_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_dast_site_profile_path(project)
'scanner-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_security_configuration_dast_profiles_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_security_configuration_dast_profiles_dast_site_profile_path(project)
)
end
end
......
......@@ -250,7 +250,7 @@ RSpec.describe Projects::Security::ConfigurationPresenter do
def configuration_path(type)
if type === :dast_profiles
project_profiles_path(project)
project_security_configuration_dast_profiles_path(project)
elsif type === :sast
project_security_configuration_sast_path(project)
else
......
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