[verified] Remove Chatwoot Hub sync paths

This commit is contained in:
Kunthawat Greethong
2026-08-15 13:23:03 +07:00
parent 8ebb320bd4
commit 832a7fdae0
15 changed files with 43 additions and 290 deletions

View File

@@ -23,18 +23,11 @@ class Installation::OnboardingController < ApplicationController
private
def onboarding_params
params.permit(:subscribe_to_updates, user: [:name, :company, :email])
params.permit(user: [:name, :company, :email])
end
def finish_onboarding
::Redis::Alfred.delete(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)
return if onboarding_params[:subscribe_to_updates].blank?
ChatwootHub.register_instance(
onboarding_params.dig(:user, :company),
onboarding_params.dig(:user, :name),
onboarding_params.dig(:user, :email)
)
end
def ensure_installation_onboarding

View File

@@ -1,10 +1,3 @@
class SuperAdmin::SettingsController < SuperAdmin::ApplicationController
def show; end
def refresh
Internal::CheckNewVersionsJob.perform_now
# rubocop:disable Rails/I18nLocaleTexts
redirect_to super_admin_settings_path, notice: 'Instance status refreshed'
# rubocop:enable Rails/I18nLocaleTexts
end
end

View File

@@ -2,18 +2,7 @@ class Internal::CheckNewVersionsJob < ApplicationJob
queue_as :scheduled_jobs
def perform
return unless Rails.env.production?
@instance_info = ChatwootHub.sync_with_hub
update_version_info
end
private
def update_version_info
return if @instance_info['version'].blank?
::Redis::Alfred.set(::Redis::Alfred::LATEST_CHATWOOT_VERSION, @instance_info['version'])
# Version checks are intentionally local-only in the private fork.
end
end

View File

@@ -2,25 +2,7 @@ class Internal::TriggerDailyScheduledItemsJob < ApplicationJob
queue_as :scheduled_jobs
def perform
# Schedule daily deferred jobs here so each installation can spread load
# across the day without changing its slot on deploys or restarts.
schedule_version_check
end
private
def schedule_version_check
return unless Rails.env.production?
Internal::CheckNewVersionsJob.set(wait_until: version_check_run_at).perform_later
end
def version_check_run_at
Time.current.utc.beginning_of_day + designated_minute.minutes
end
def designated_minute
@designated_minute ||= Digest::MD5.hexdigest(ChatwootHub.installation_identifier).hex % 1440
# Daily local scheduled work is extended by feature modules when present.
end
end

View File

@@ -59,13 +59,6 @@
</div>
</div>
<div class="text-sm text-slate-900">
<%= check_box_tag "subscribe_to_updates", 'true', true %>
<label class="ml-2" for="subscribe_to_updates">
Subscribe to release notes, newsletters & product feedback surveys.
</label>
</div>
<button type="submit" class="flex items-center w-full justify-center rounded-md bg-woot-500 py-3 px-3 text-base font-medium text-white shadow-sm hover:bg-woot-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-woot-500 cursor-pointer">
Finish Setup
</button>

View File

@@ -44,10 +44,6 @@
<div class="flex flex-col flex-grow gap-1">
<div class="flex items-center gap-2">
<h2 class="h-5 leading-5 text-n-slate-12 text-sm font-medium">Current plan</h2>
<a href="<%= refresh_super_admin_settings_url %>" class="inline-flex gap-1 text-xs font-medium items-center text-woot-500 hover:text-woot-700">
<svg width="16" height="16"><use xlink:href="#icon-refresh-line" /></svg>
<span>Refresh</span>
</a>
</div>
<p class="text-n-slate-11 m-0 text-sm"><%= SuperAdmin::FeaturesHelper.plan_details.html_safe %></p>
</div>