discourse/spec/integration
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
..
category_tag_spec.rb FEATURE: Tag synonyms 2019-12-04 13:33:51 -05:00
content_security_policy_spec.rb FIX: Allow CSP to work correctly for non-default hostnames/schemes (#9180) 2020-03-19 19:54:42 +00:00
email_style_spec.rb FIX: backwards compatibility for uncompiled email style css 2019-10-23 19:22:33 -04:00
flags_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
group_spec.rb UX: Include public groups in mentionable groups set (#8516) 2019-12-12 13:13:40 +02:00
invite_only_registration_spec.rb DEPRECATION: Remove support for api creds in query params (#9106) 2020-04-06 16:55:44 -06:00
message_bus_spec.rb SECURITY: Restrict message-bus access on login_required sites 2019-08-14 09:43:12 +01:00
multisite_spec.rb DEV: enables and fixes multisite-spec (#9557) 2020-04-27 20:55:36 +02:00
rate_limiting_spec.rb DEPRECATION: Remove support for api creds in query params (#9106) 2020-04-06 16:55:44 -06:00
same_ip_spammers_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
spam_rules_spec.rb Migrate score settings to use sensitivities 2019-05-24 15:44:24 -04:00
topic_auto_close_spec.rb DEV: Improve flaky time-sensitive specs (#9141) 2020-03-10 22:13:17 +01:00
topic_thumbnail_spec.rb FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
user_api_keys_spec.rb FEATURE: Hash user API keys in the database (#9344) 2020-04-07 16:42:52 +03:00
watched_words_spec.rb DEV: Fix heisentest 2019-07-23 18:04:53 +02:00