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 ...@@ -28,7 +28,7 @@ module Types
field :edit_path, GraphQL::STRING_TYPE, null: true, field :edit_path, GraphQL::STRING_TYPE, null: true,
description: 'Relative web path to the edit page of a scanner profile', description: 'Relative web path to the edit page of a scanner profile',
resolve: -> (obj, _args, _ctx) do 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 end
end end
...@@ -23,7 +23,7 @@ module Types ...@@ -23,7 +23,7 @@ module Types
field :edit_path, GraphQL::STRING_TYPE, null: true, field :edit_path, GraphQL::STRING_TYPE, null: true,
description: 'Relative web path to the edit page of a site profile', description: 'Relative web path to the edit page of a site profile',
resolve: -> (obj, _args, _ctx) do 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 end
field :validation_status, Types::DastSiteProfileValidationStatusEnum, null: true, field :validation_status, Types::DastSiteProfileValidationStatusEnum, null: true,
......
...@@ -7,10 +7,10 @@ module Projects::OnDemandScansHelper ...@@ -7,10 +7,10 @@ module Projects::OnDemandScansHelper
'empty-state-svg-path' => image_path('illustrations/empty-state/ondemand-scan-empty.svg'), 'empty-state-svg-path' => image_path('illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch, 'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace, 'project-path' => project.path_with_namespace,
'scanner-profiles-library-path' => project_profiles_path(project, anchor: 'scanner-profiles'), 'scanner-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_profiles_path(project, anchor: 'site-profiles'), 'site-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_dast_scanner_profile_path(project), 'new-scanner-profile-path' => new_project_security_configuration_dast_profiles_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_dast_site_profile_path(project) 'new-site-profile-path' => new_project_security_configuration_dast_profiles_dast_site_profile_path(project)
} }
end end
end end
...@@ -178,7 +178,7 @@ module Projects ...@@ -178,7 +178,7 @@ module Projects
def configuration_path(type) def configuration_path(type)
{ {
sast: project_security_configuration_sast_path(project), sast: project_security_configuration_sast_path(project),
dast_profiles: project_profiles_path(project) dast_profiles: project_security_configuration_dast_profiles_path(project)
}[type] }[type]
end end
end end
......
---
title: Update DAST profiles routes
merge_request: 42859
author:
type: changed
...@@ -77,7 +77,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do ...@@ -77,7 +77,7 @@ RSpec.describe GitlabSchema.types['DastSiteProfile'] do
describe 'edit_path field' do describe 'edit_path field' do
it 'is the relative path to edit the dast_site_profile' 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) expect(first_dast_site_profile['editPath']).to eq(path)
end end
......
...@@ -12,10 +12,10 @@ RSpec.describe Projects::OnDemandScansHelper do ...@@ -12,10 +12,10 @@ RSpec.describe Projects::OnDemandScansHelper do
'empty-state-svg-path' => match_asset_path('/assets/illustrations/empty-state/ondemand-scan-empty.svg'), 'empty-state-svg-path' => match_asset_path('/assets/illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => project.default_branch, 'default-branch' => project.default_branch,
'project-path' => project.path_with_namespace, 'project-path' => project.path_with_namespace,
'scanner-profiles-library-path' => project_profiles_path(project, anchor: 'scanner-profiles'), 'scanner-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'scanner-profiles'),
'site-profiles-library-path' => project_profiles_path(project, anchor: 'site-profiles'), 'site-profiles-library-path' => project_security_configuration_dast_profiles_path(project, anchor: 'site-profiles'),
'new-scanner-profile-path' => new_project_dast_scanner_profile_path(project), 'new-scanner-profile-path' => new_project_security_configuration_dast_profiles_dast_scanner_profile_path(project),
'new-site-profile-path' => new_project_dast_site_profile_path(project) 'new-site-profile-path' => new_project_security_configuration_dast_profiles_dast_site_profile_path(project)
) )
end end
end end
......
...@@ -250,7 +250,7 @@ RSpec.describe Projects::Security::ConfigurationPresenter do ...@@ -250,7 +250,7 @@ RSpec.describe Projects::Security::ConfigurationPresenter do
def configuration_path(type) def configuration_path(type)
if type === :dast_profiles if type === :dast_profiles
project_profiles_path(project) project_security_configuration_dast_profiles_path(project)
elsif type === :sast elsif type === :sast
project_security_configuration_sast_path(project) project_security_configuration_sast_path(project)
else 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