discourse/spec/lib
David Taylor 03818e642a
FEATURE: Include optimized thumbnails for topics (#9215)
This introduces new APIs for obtaining optimized thumbnails for topics. There are a few building blocks required for this:

- Introduces new `image_upload_id` columns on the `posts` and `topics` table. This replaces the old `image_url` column, which means that thumbnails are now restricted to uploads. Hotlinked thumbnails are no longer possible. In normal use (with pull_hotlinked_images enabled), this has no noticeable impact

- A migration attempts to match existing urls to upload records. If a match cannot be found then the posts will be queued for rebake

- Optimized thumbnails are generated during post_process_cooked. If thumbnails are missing when serializing a topic list, then a sidekiq job is queued

- Topic lists and topics now include a `thumbnails` key, which includes all the available images:
   ```
   "thumbnails": [
   {
     "max_width": null,
     "max_height": null,
     "url": "//example.com/original-image.png",
     "width": 1380,
     "height": 1840
   },
   {
     "max_width": 1024,
     "max_height": 1024,
     "url": "//example.com/optimized-image.png",
     "width": 768,
     "height": 1024
   }
   ]
  ```

- Themes can request additional thumbnail sizes by using a modifier in their `about.json` file:
   ```
    "modifiers": {
      "topic_thumbnail_sizes": [
        [200, 200],
        [800, 800]
      ],
      ...
  ```
  Remember that these are generated asynchronously, so your theme should include logic to fallback to other available thumbnails if your requested size has not yet been generated

- Two new raw plugin outlets are introduced, to improve the customisability of the topic list. `topic-list-before-columns` and `topic-list-before-link`
2020-05-05 09:07:50 +01:00
..
backup_restore DEV: Use a tmp directory for storing uploads in tests (#9554) 2020-04-28 14:03:04 +01:00
compression DEV: Split max decompressed setting for themes and backups (#8179) 2019-10-11 14:38:10 -03:00
content_security_policy FIX: Allow CSP to work correctly for non-default hostnames/schemes (#9180) 2020-03-19 19:54:42 +00:00
i18n FIX: English locale must not fall back to any other locale 2019-06-07 21:53:01 +02:00
seed_data DEV: Add rubocop-rspec (#9288) 2020-03-27 17:35:40 +01:00
site_settings Revert "Revert "FIX: Don't allow people to clear the upload bucket while it's enabled"" 2020-03-06 09:35:55 -05:00
validators FEATURE: Add timezone to core user_options (#8380) 2019-11-25 10:49:27 +10:00
webauthn SECURITY: 2FA with U2F / TOTP 2020-01-15 11:27:12 +01:00
bookmark_manager_spec.rb FIX: Topic user bookmarked column logic was not correct (#9563) 2020-04-28 16:19:25 +10:00
bookmark_query_spec.rb FIX: Bookmark UI tweaks (#9604) 2020-05-01 16:14:20 +10:00
bookmark_reminder_notification_handler_spec.rb FEATURE: Promote bookmarks with reminders to core functionality (#9369) 2020-04-22 13:44:19 +10:00
browser_detection_spec.rb FIX: Detect DiscourseHub user agent. 2019-08-09 11:58:15 +03:00
content_security_policy_spec.rb FEATURE: Nokogumbo (#9577) 2020-05-05 13:46:57 +10:00
db_helper_spec.rb FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
discourse_js_processor_spec.rb Support for transpiling `.js` files (#9160) 2020-03-11 09:43:55 -04:00
encodings_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
introduction_updater_spec.rb FIX: replace default welcome topic post with new value from wizard 2020-04-01 15:42:45 -04:00
mini_sql_multisite_connection_spec.rb DEV: Allow DB.after_commit to be used outside of a transaction 2020-05-04 09:42:41 +01:00
search_spec.rb FIX: skip invalid URLs when checking for audio/video in search blurbs 2019-11-06 10:32:15 -05:00
theme_flag_modifier_spec.rb FEATURE: Allow themes to specify modifiers in their about.json file (#9097) 2020-03-11 13:30:45 +00:00
theme_javascript_compiler_spec.rb DEV: Test theme js compiler append_raw_template (#8950) 2020-03-06 11:35:52 -05:00
topic_upload_security_manager_spec.rb DEV: Add rubocop-rspec (#9288) 2020-03-27 17:35:40 +01:00
upload_creator_spec.rb FIX: Change secure media to encompass attachments as well (#9271) 2020-03-26 07:16:02 +10:00
upload_recovery_spec.rb DEV: disable all upload recovery specs 2019-11-11 16:04:18 +11:00
upload_security_spec.rb FIX: Change secure media to encompass attachments as well (#9271) 2020-03-26 07:16:02 +10:00