Commit f7391e51 authored by Rajendra Kadam's avatar Rajendra Kadam

Prepend EE to CE

parent a3246c17
...@@ -2,16 +2,18 @@ ...@@ -2,16 +2,18 @@
module ServicePing module ServicePing
module ServicePingSettings module ServicePingSettings
class << self extend self
def product_intelligence_enabled?
pings_enabled? && !User.single_user&.requires_usage_stats_consent?
end
private def product_intelligence_enabled?
pings_enabled? && !User.single_user&.requires_usage_stats_consent?
end
private
def pings_enabled? def pings_enabled?
::Gitlab::CurrentSettings.usage_ping_enabled? ::Gitlab::CurrentSettings.usage_ping_enabled?
end
end end
end end
end end
ServicePing::ServicePingSettings.extend_mod_with('ServicePing::ServicePingSettings')
...@@ -13,7 +13,7 @@ module EE ...@@ -13,7 +13,7 @@ module EE
override :execute override :execute
def execute def execute
return super unless ::License.current.present? return super unless ::License.current.present?
return [] unless ServicePing::ServicePingSettings.product_intelligence_enabled? return [] unless ServicePingSettings.product_intelligence_enabled?
optional_enabled = ::Gitlab::CurrentSettings.usage_ping_enabled? optional_enabled = ::Gitlab::CurrentSettings.usage_ping_enabled?
customer_service_enabled = ::License.current.customer_service_enabled? customer_service_enabled = ::License.current.customer_service_enabled?
......
...@@ -3,16 +3,13 @@ ...@@ -3,16 +3,13 @@
module EE module EE
module ServicePing module ServicePing
module ServicePingSettings module ServicePingSettings
class << self extend ::Gitlab::Utils::Override
def product_intelligence_enabled?
pings_enabled? && !::User.single_user&.requires_usage_stats_consent?
end
private private
def pings_enabled? override :pings_enabled?
::License.current&.customer_service_enabled? || ::Gitlab::CurrentSettings.usage_ping_enabled? def pings_enabled?
end ::License.current&.customer_service_enabled? || super
end end
end end
end end
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ServicePing::PermitDataCategoriesService do RSpec.describe ServicePing::PermitDataCategoriesService do
using RSpec::Parameterized::TableSyntax
describe '#execute' do describe '#execute' do
subject(:permitted_categories) { described_class.new.execute } subject(:permitted_categories) { described_class.new.execute }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe EE::ServicePing::ServicePingSettings do RSpec.describe ServicePing::ServicePingSettings do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
describe '#product_intelligence_enabled?' do describe '#product_intelligence_enabled?' do
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ServicePing::PermitDataCategoriesService do RSpec.describe ServicePing::PermitDataCategoriesService do
using RSpec::Parameterized::TableSyntax
describe '#execute', :without_license do describe '#execute', :without_license do
subject(:permitted_categories) { described_class.new.execute } subject(:permitted_categories) { described_class.new.execute }
......
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