Commit acae7503 authored by Tetiana Chupryna's avatar Tetiana Chupryna

Address review comments

parent 4f5b10d2
...@@ -4,12 +4,16 @@ module EE ...@@ -4,12 +4,16 @@ module EE
module Projects module Projects
module Security module Security
module ConfigurationPresenter module ConfigurationPresenter
extend ::Gitlab::Utils::Override
private private
override :can_toggle_autofix
def can_toggle_autofix def can_toggle_autofix
try(:auto_fix_permission) try(:auto_fix_permission)
end end
override :autofix_enabled
def autofix_enabled def autofix_enabled
{ {
dependency_scanning: project_settings&.auto_fix_dependency_scanning, dependency_scanning: project_settings&.auto_fix_dependency_scanning,
...@@ -17,6 +21,7 @@ module EE ...@@ -17,6 +21,7 @@ module EE
} }
end end
override :auto_fix_user_path
def auto_fix_user_path def auto_fix_user_path
'/' # TODO: real link will be updated with https://gitlab.com/gitlab-org/gitlab/-/issues/348463 '/' # TODO: real link will be updated with https://gitlab.com/gitlab-org/gitlab/-/issues/348463
end end
......
...@@ -4,20 +4,21 @@ module EE ...@@ -4,20 +4,21 @@ module EE
module Gitlab module Gitlab
module Security module Security
module ScanConfiguration module ScanConfiguration
extend ::Gitlab::Utils::Override
override :available?
def available? def available?
super || project.licensed_feature_available?(type) super || project.licensed_feature_available?(type)
end end
def configured? override :configuration_path
configured
end
def configuration_path def configuration_path
configurable_scans[type] if available? || always_available? configurable_scans[type] if available? || always_available?
end end
private private
override :configurable_scans
def configurable_scans def configurable_scans
strong_memoize(:configurable_scans) do strong_memoize(:configurable_scans) do
{ {
......
...@@ -19,7 +19,9 @@ RSpec.describe ::Gitlab::Security::ScanConfiguration do ...@@ -19,7 +19,9 @@ RSpec.describe ::Gitlab::Security::ScanConfiguration do
stub_licensed_features(sast: false) stub_licensed_features(sast: false)
end end
it { is_expected.to be_truthy } it 'core scanners (SAST, Secret Detection) are always available' do
is_expected.to be_truthy
end
end end
context 'with licensed scanner that is available' do context 'with licensed scanner that is available' do
......
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