feat: Super admin design improvements (#8517)

- Revamp the super admin design
- Introduce a new settings page for support and billing settings
- Move the access tokens into users, agent bots and platform app show pages


Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Nithin David Thomas
2023-12-08 19:40:35 -08:00
committed by GitHub
parent b1a68759cf
commit f002870c6a
39 changed files with 577 additions and 348 deletions

View File

@@ -4,9 +4,20 @@ class Internal::CheckNewVersionsJob < ApplicationJob
def perform
return unless Rails.env.production?
latest_version = ChatwootHub.latest_version
return unless latest_version
instance_info = ChatwootHub.sync_with_hub
return unless instance_info
::Redis::Alfred.set(::Redis::Alfred::LATEST_CHATWOOT_VERSION, latest_version)
::Redis::Alfred.set(::Redis::Alfred::LATEST_CHATWOOT_VERSION, instance_info['version'])
update_installation_config(key: 'INSTALLATION_PRICING_PLAN', value: instance_info['plan'])
update_installation_config(key: 'CHATWOOT_SUPPORT_WEBSITE_TOKEN', value: instance_info['chatwoot_support_website_token'])
update_installation_config(key: 'CHATWOOT_SUPPORT_IDENTIFIER_HASH', value: instance_info['chatwoot_support_identifier_hash'])
update_installation_config(key: 'CHATWOOT_SUPPORT_SCRIPT_URL', value: instance_info['chatwoot_support_script_url'])
end
def update_installation_config(key:, value:)
config = InstallationConfig.find_or_initialize_by(name: key)
config.value = value
config.locked = true
config.save!
end
end