discourse/spec
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
..
components FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
fabricators FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
fixtures FIX: Change base importer to create new Bookmark records (#9603) 2020-05-01 11:34:55 +10:00
helpers DEV: Fix some more flaky tests (#9384) 2020-04-08 12:46:43 +02:00
import_export FEATURE: Rake task to export groups (#9450) 2020-04-17 14:59:54 -07:00
initializers FIX: We need to skip users with associated reviewables when auto-approving (#9080) 2020-03-02 14:33:52 -05:00
integration FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
integrity DEV: Improve flaky time-sensitive specs (#9141) 2020-03-10 22:13:17 +01:00
jobs FEATURE: Add user_profile to user_archive CSV export (#9571) 2020-04-29 12:09:50 +03:00
lib FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
mailers DEV: Add rubocop-rspec (#9288) 2020-03-27 17:35:40 +01:00
models FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
multisite FIX: Change secure media to encompass attachments as well (#9271) 2020-03-26 07:16:02 +10:00
requests FEATURE: Nokogumbo (#9577) 2020-05-05 13:46:57 +10:00
script/import_scripts FIX: Change base importer to create new Bookmark records (#9603) 2020-05-01 11:34:55 +10:00
serializers FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
services FEATURE: Nokogumbo (#9577) 2020-05-05 13:46:57 +10:00
support FEATURE: Nokogumbo (#9577) 2020-05-05 13:46:57 +10:00
tasks FEATURE: Promote bookmarks with reminders to core functionality (#9369) 2020-04-22 13:44:19 +10:00
views/omniauth_callbacks FEATURE: Use full page redirection for all external auth methods (#8092) 2019-10-08 12:10:43 +01:00
rails_helper.rb DEV: upgrade Rails 2020-04-20 12:55:53 +01:00
swagger_helper.rb DEV: Add rswag to aid in api documention (#9546) 2020-04-27 16:40:07 -06:00