From 05d87281cd34272e90c88c930467a4a0fc590c12 Mon Sep 17 00:00:00 2001 From: Rodrigo Borba Date: Wed, 25 Feb 2026 19:37:52 -0300 Subject: [PATCH] feat: sync with enterprise unlock recipe - force premium, enable all features, and force extensions --- app/javascript/dashboard/composables/usePolicy.js | 4 ++++ app/models/concerns/featurable.rb | 10 +++------- lib/chatwoot_app.rb | 8 +------- lib/chatwoot_hub.rb | 4 +--- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/app/javascript/dashboard/composables/usePolicy.js b/app/javascript/dashboard/composables/usePolicy.js index a76ffbf1d..ff5a6d4ea 100644 --- a/app/javascript/dashboard/composables/usePolicy.js +++ b/app/javascript/dashboard/composables/usePolicy.js @@ -108,6 +108,10 @@ export function usePolicy() { const flag = unref(featureFlag); if (!flag) return false; + // Bypass paywall for Captain in development + if (['captain_integration', 'captain_integration_v2'].includes(flag)) + return false; + if (isACustomBrandedInstance.value) { // custom branded instances never show paywall return false; diff --git a/app/models/concerns/featurable.rb b/app/models/concerns/featurable.rb index 6b1e254cc..f7bd85d69 100644 --- a/app/models/concerns/featurable.rb +++ b/app/models/concerns/featurable.rb @@ -41,8 +41,8 @@ module Featurable save! end - def feature_enabled?(name) - send("feature_#{name}?") + def feature_enabled?(_name) + true end def all_features @@ -52,11 +52,7 @@ module Featurable end def enabled_features - features = 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 + all_features.select { |_feature, enabled| enabled == true } end def disabled_features diff --git a/lib/chatwoot_app.rb b/lib/chatwoot_app.rb index b16fe56b0..d96b77b47 100644 --- a/lib/chatwoot_app.rb +++ b/lib/chatwoot_app.rb @@ -34,13 +34,7 @@ module ChatwootApp end def self.extensions - if custom? - %w[enterprise custom] - elsif enterprise? - %w[enterprise] - else - %w[] - end + @extensions ||= %w[enterprise].freeze end def self.advanced_search_allowed? diff --git a/lib/chatwoot_hub.rb b/lib/chatwoot_hub.rb index c18fb299b..6e4be6d0a 100644 --- a/lib/chatwoot_hub.rb +++ b/lib/chatwoot_hub.rb @@ -19,9 +19,7 @@ class ChatwootHub end def self.pricing_plan - return 'community' unless ChatwootApp.enterprise? - - InstallationConfig.find_by(name: 'INSTALLATION_PRICING_PLAN')&.value || 'community' + 'premium' end def self.pricing_plan_quantity