feat: sync with enterprise unlock recipe - force premium, enable all features, and force extensions
This commit is contained in:
parent
e7326e543b
commit
05d87281cd
@ -108,6 +108,10 @@ export function usePolicy() {
|
|||||||
const flag = unref(featureFlag);
|
const flag = unref(featureFlag);
|
||||||
if (!flag) return false;
|
if (!flag) return false;
|
||||||
|
|
||||||
|
// Bypass paywall for Captain in development
|
||||||
|
if (['captain_integration', 'captain_integration_v2'].includes(flag))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (isACustomBrandedInstance.value) {
|
if (isACustomBrandedInstance.value) {
|
||||||
// custom branded instances never show paywall
|
// custom branded instances never show paywall
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -41,8 +41,8 @@ module Featurable
|
|||||||
save!
|
save!
|
||||||
end
|
end
|
||||||
|
|
||||||
def feature_enabled?(name)
|
def feature_enabled?(_name)
|
||||||
send("feature_#{name}?")
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def all_features
|
def all_features
|
||||||
@ -52,11 +52,7 @@ module Featurable
|
|||||||
end
|
end
|
||||||
|
|
||||||
def enabled_features
|
def enabled_features
|
||||||
features = all_features.select { |_feature, enabled| enabled == true }
|
all_features.select { |_feature, enabled| enabled == true }
|
||||||
# Temporarily force enable captain features to fix blank page UI issue
|
|
||||||
features['captain_integration'] = true
|
|
||||||
features['captain_tasks'] = true
|
|
||||||
features
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def disabled_features
|
def disabled_features
|
||||||
|
|||||||
@ -34,13 +34,7 @@ module ChatwootApp
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.extensions
|
def self.extensions
|
||||||
if custom?
|
@extensions ||= %w[enterprise].freeze
|
||||||
%w[enterprise custom]
|
|
||||||
elsif enterprise?
|
|
||||||
%w[enterprise]
|
|
||||||
else
|
|
||||||
%w[]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.advanced_search_allowed?
|
def self.advanced_search_allowed?
|
||||||
|
|||||||
@ -19,9 +19,7 @@ class ChatwootHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.pricing_plan
|
def self.pricing_plan
|
||||||
return 'community' unless ChatwootApp.enterprise?
|
'premium'
|
||||||
|
|
||||||
InstallationConfig.find_by(name: 'INSTALLATION_PRICING_PLAN')&.value || 'community'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.pricing_plan_quantity
|
def self.pricing_plan_quantity
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user