From 7320957405c21b1f428e8d36910ed65852c4d64b Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Tue, 20 Feb 2024 15:53:29 +0530 Subject: [PATCH] chore: Add facebook_api_version to global config (#8965) - Ability to configure facebook_api_version from global config Co-authored-by: Pranav --- app/controllers/dashboard_controller.rb | 2 +- app/controllers/super_admin/app_configs_controller.rb | 2 +- config/installation_config.yml | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 9e59758ea5df1..0aea9df8345a4 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -55,7 +55,7 @@ def app_config VAPID_PUBLIC_KEY: VapidService.public_key, ENABLE_ACCOUNT_SIGNUP: GlobalConfigService.load('ENABLE_ACCOUNT_SIGNUP', 'false'), FB_APP_ID: GlobalConfigService.load('FB_APP_ID', ''), - FACEBOOK_API_VERSION: 'v14.0', + FACEBOOK_API_VERSION: GlobalConfigService.load('FACEBOOK_API_VERSION', 'v17.0'), IS_ENTERPRISE: ChatwootApp.enterprise?, AZURE_APP_ID: ENV.fetch('AZURE_APP_ID', ''), GIT_SHA: GIT_HASH diff --git a/app/controllers/super_admin/app_configs_controller.rb b/app/controllers/super_admin/app_configs_controller.rb index a31d01675bb58..6223f717495cb 100644 --- a/app/controllers/super_admin/app_configs_controller.rb +++ b/app/controllers/super_admin/app_configs_controller.rb @@ -34,7 +34,7 @@ def set_config def allowed_configs @allowed_configs = case @config when 'facebook' - %w[FB_APP_ID FB_VERIFY_TOKEN FB_APP_SECRET IG_VERIFY_TOKEN ENABLE_MESSENGER_CHANNEL_HUMAN_AGENT] + %w[FB_APP_ID FB_VERIFY_TOKEN FB_APP_SECRET IG_VERIFY_TOKEN FACEBOOK_API_VERSION ENABLE_MESSENGER_CHANNEL_HUMAN_AGENT] when 'email' ['MAILER_INBOUND_EMAIL_DOMAIN'] else diff --git a/config/installation_config.yml b/config/installation_config.yml index 60eae3bc25efa..9db5278328735 100644 --- a/config/installation_config.yml +++ b/config/installation_config.yml @@ -110,6 +110,11 @@ display_title: 'Instagram Verify Token' description: 'The verify token used for Instagram Webhook' locked: false +- name: FACEBOOK_API_VERSION + display_title: 'Facebook API Version' + description: 'Configure this if you want to use a different Facebook API version. Make sure its prefixed with `v`' + value: 'v17.0' + locked: false - name: ENABLE_MESSENGER_CHANNEL_HUMAN_AGENT display_title: 'Enable human agent' value: false