discourse/config/initializers
David Taylor 0e303c7f5d
FEATURE: Automatically generate optimized site metadata icons (#7372)
This change automatically resizes icons for various purposes. Admins can now upload `logo` and `logo_small`, and everything else will be auto-generated. Specific icons can still be uploaded separately if required.

## Core

- Adds an SiteIconManager module which manages automatic resizing and fallback

- Icons are looked up in the OptimizedImage table at runtime, and then cached in Redis. If the resized version is missing for some reason, then most icons will fall back to the original files. Some icons (e.g. PWA Manifest) will return `nil` (because an incorrectly sized icon is worse than a missing icon). 

- `SiteSetting.site_large_icon_url` will return the optimized version, including any fallback. `SiteSetting.large_icon` continues to return the upload object. This means that (almost) no changes are required in core/plugins to support this new system.

- Icons are resized whenever a relevant site setting is changed, and during post-deploy migrations

## Wizard

- Allows `requiresRefresh` wizard steps to reload data via AJAX instead of a full page reload

- Add placeholders to the **icons** step of the wizard, which automatically update from the "Square Logo"

- Various copy updates to support the changes

- Remove the "upload-time" resizing for `large_icon`. This is no longer required.

## Site Settings UX

- Move logo/icon settings under a new "Branding" tab

- Various copy changes to support the changes

- Adds placeholder support to the `image-uploader` component

- Automatically reloads site settings after saving. This allows setting placeholders to change based on changes to other settings

- Upload site settings will be assigned a placeholder if SiteIconManager `responds_to?` an icon of the same name

## Dashboard Warnings

- Remove PWA icon and PWA title warnings. Both are now handled automatically.

## Bonus

- Updated the sketch logos to use @awesomerobot's new high-res designs
2019-05-01 14:44:45 +01:00
..
001-redis.rb Remove unused lines. 2018-06-11 08:44:41 +08:00
002-freedom_patches.rb Revert "Revert message bus upgrade" 2015-12-09 11:48:41 +11:00
003-sql_builder.rb Revert "Revert message bus upgrade" 2015-12-09 11:48:41 +11:00
004-message_bus.rb SECURITY: extra CORS headers should be set on correct host 2018-07-11 09:29:02 +10:00
004-rails_multisite.rb FIX: Sidekiq fails to start if any of the multisite has problems. 2018-12-12 11:30:14 +08:00
005-site_settings.rb FIX: Sidekiq fails to start if any of the multisite has problems. 2018-12-12 11:30:14 +08:00
006-ensure_login_hint.rb Fix the build. 2019-01-17 17:28:09 +08:00
006-mini_profiler.rb DEV: update mini profiler 2018-12-10 14:29:20 +11:00
008-rack-cors.rb Add Cache-Control header to CORS (#6490) 2018-10-16 10:46:55 +11:00
009-omniauth.rb PERF: bypass omniauth unless in an auth path 2018-01-15 12:44:54 +11:00
010-discourse_iife.rb Update sprockets. (#4167) 2016-04-18 10:47:52 +08:00
011-rack-protection.rb Revert "Revert message bus upgrade" 2015-12-09 11:48:41 +11:00
012-web_hook_events.rb FEATURE: New 'Reviewable' model to make reviewable items generic 2019-03-28 12:45:10 -04:00
013-excon_defaults.rb FIX: Make omit_default_port the global default 2017-06-30 12:43:26 -04:00
014-track-setting-changes.rb FEATURE: Automatically generate optimized site metadata icons (#7372) 2019-05-01 14:44:45 +01:00
050-force_https.rb Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
099-anon-cache.rb DEV: avoid require_dependency for some libs 2018-12-31 10:53:30 +11:00
099-defer.rb PERF: stop running background work between requests 2017-11-23 15:48:47 +11:00
099-drain_pool.rb Revert "Revert message bus upgrade" 2015-12-09 11:48:41 +11:00
100-i18n.rb DEV: Rails 6 compatability 2019-04-29 17:13:30 +10:00
100-logster.rb DEV: document max_logster_logs in discourse_defaults.conf 2019-03-22 14:11:40 +11:00
100-oj.rb Revert "Revert message bus upgrade" 2015-12-09 11:48:41 +11:00
100-onebox_options.rb FIX: allow upto three url redirects in onebox (#5457) 2017-12-27 10:30:06 +11:00
100-push-notifications.rb PERF: Don't bloat the Sidekiq queue with Jobs::SendPushNotification. 2018-05-24 10:04:09 +08:00
100-quiet_logger.rb Fix all the errors to get our tests green on Rails 5.1. 2017-09-25 13:48:58 +08:00
100-secret_token.rb FEATURE: per client user tokens 2017-02-07 09:22:16 -05:00
100-session_store.rb DEV: add warning if force_https in dev 2016-11-25 11:35:29 +11:00
100-sidekiq.rb Pause MiniScheduler when Sidekiq is paused. 2019-01-18 17:50:24 +08:00
100-silence_logger.rb FIX: silence and quiet logger not thread safe 2017-01-31 15:44:46 -05:00
100-strong_parameters.rb Revert "Revert message bus upgrade" 2015-12-09 11:48:41 +11:00
100-verify_config.rb Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
100-watch_for_restart.rb Move discourse dev data out of tmp 2017-05-18 11:36:24 -04:00
100-wrap_parameters.rb FIX: Store custom emojis as uploads. 2017-03-14 13:07:18 +08:00
101-lograge.rb DEV: Rescue from readonly error in lograge. 2019-01-21 14:20:19 +08:00
200-message_bus_request_tracker.rb WORKAROUND: Can't reinsert a deleted middleware. 2017-09-25 13:48:59 +08:00
000-mini_sql.rb DEV: remove exec_sql and replace with mini_sql 2018-06-19 16:13:36 +10:00
000-post_migration.rb DEV: Support post deployment migrations for plugins. 2018-10-09 13:11:45 +08:00