UX: Introduces a splash screen behind a hidden site setting (#17094)

This PR introduces a new hidden site setting that allows admins to display a splash screen while site assets load.

The splash screen can be enabled via the `splash_screen` hidden site setting.

This is what the splash screen currently looks like

5ceb72f085.mp4

Once site assets load, the splash screen is automatically removed.

To control the loading text that shows in the splash screen, you can change the preloader_text translation string in admin > customize > text
This commit is contained in:
Joe
2022-06-22 04:35:46 +08:00
committed by GitHub
parent 624c684d51
commit e82a2ce9ae
11 changed files with 209 additions and 2 deletions

View File

@ -529,6 +529,28 @@ RSpec.describe ApplicationController do
end
end
describe "splash_screen" do
let(:admin) { Fabricate(:admin) }
before do
admin
end
it 'adds a preloader splash screen when enabled' do
get '/'
expect(response.status).to eq(200)
expect(response.body).not_to include("d-splash")
SiteSetting.splash_screen = true
get '/'
expect(response.status).to eq(200)
expect(response.body).to include("d-splash")
end
end
describe 'Delegated auth' do
let :public_key do
<<~TXT