Commit f7391e51 authored by Rajendra Kadam's avatar Rajendra Kadam

Prepend EE to CE

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