Files
gitlab-foss/lib/service_ping/service_ping_settings.rb
2024-02-27 09:09:11 +00:00

25 lines
642 B
Ruby

# frozen_string_literal: true
module ServicePing
module ServicePingSettings
extend self
def enabled_and_consented?
enabled? && !User.single_user&.requires_usage_stats_consent?
end
def license_operational_metric_enabled?
false
end
# If it is EE and license operational metric is true,
# then we will show enable service ping checkbox checked,
# as it will always send service ping
def enabled?
license_operational_metric_enabled? || ::Gitlab::CurrentSettings.usage_ping_enabled?
end
end
end
ServicePing::ServicePingSettings.extend_mod_with('ServicePing::ServicePingSettings')