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

@@ -1,6 +1,6 @@
require 'rails_helper'
RSpec.describe 'Super Admin Instance health', type: :request do
RSpec.describe 'Super Admin Instance status', type: :request do
let(:super_admin) { create(:super_admin) }
describe 'GET /super_admin/instance_status' do

View File

@@ -4,11 +4,11 @@ RSpec.describe Internal::CheckNewVersionsJob do
subject(:job) { described_class.perform_now }
it 'updates the latest chatwoot version in redis' do
version = '1.1.1'
data = { 'version' => '1.2.3' }.to_json
allow(Rails.env).to receive(:production?).and_return(true)
allow(ChatwootHub).to receive(:latest_version).and_return(version)
allow(ChatwootHub).to receive(:sync_with_hub).and_return(data)
job
expect(ChatwootHub).to have_received(:latest_version)
expect(Redis::Alfred.get(Redis::Alfred::LATEST_CHATWOOT_VERSION)).to eq version
expect(ChatwootHub).to have_received(:sync_with_hub)
expect(Redis::Alfred.get(Redis::Alfred::LATEST_CHATWOOT_VERSION)).to eq data['version']
end
end

View File

@@ -7,11 +7,11 @@ describe ChatwootHub do
expect(described_class.installation_identifier).to eq installation_identifier
end
context 'when fetching latest_version' do
context 'when fetching sync_with_hub' do
it 'get latest version from chatwoot hub' do
version = '1.1.1'
allow(RestClient).to receive(:post).and_return({ version: version }.to_json)
expect(described_class.latest_version).to eq version
expect(described_class.sync_with_hub['version']).to eq version
expect(RestClient).to have_received(:post).with(described_class::PING_URL, described_class.instance_config
.merge(described_class.instance_metrics).to_json, { content_type: :json, accept: :json })
end
@@ -20,7 +20,7 @@ describe ChatwootHub do
version = '1.1.1'
with_modified_env DISABLE_TELEMETRY: 'true' do
allow(RestClient).to receive(:post).and_return({ version: version }.to_json)
expect(described_class.latest_version).to eq version
expect(described_class.sync_with_hub['version']).to eq version
expect(RestClient).to have_received(:post).with(described_class::PING_URL,
described_class.instance_config.to_json, { content_type: :json, accept: :json })
end
@@ -28,7 +28,7 @@ describe ChatwootHub do
it 'returns nil when chatwoot hub is down' do
allow(RestClient).to receive(:post).and_raise(ExceptionList::REST_CLIENT_EXCEPTIONS.sample)
expect(described_class.latest_version).to be_nil
expect(described_class.sync_with_hub).to be_nil
end
end