discourse/spec/serializers
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
..
admin_plugin_serializer_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
admin_user_list_serializer_spec.rb FIX: Admin user list not showing 2FA icon for only security keys enabled (#8839) 2020-02-03 14:37:46 +10:00
basic_group_serializer_spec.rb UX: drop the automatic_membership_retroactive column from groups model. (#9430) 2020-04-22 22:07:39 +05:30
basic_group_user_serializer_spec.rb DEV: Prefabrication (test optimization) (#7414) 2019-05-07 13:12:20 +10:00
basic_post_serializer_spec.rb DEV: Move requested_group_id custom field from post to topic (#9127) 2020-03-24 11:12:52 +02:00
basic_user_serializer_spec.rb FIX: correct user serializer user method for extended serializer (#8590) 2019-12-19 09:48:01 -08:00
category_detailed_serializer_spec.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
category_serializer_spec.rb FIX: Include default notification level in category serializer (#9572) 2020-04-28 12:05:53 -04:00
category_upload_serializer_spec.rb DEV: Prefabrication (test optimization) (#7414) 2019-05-07 13:12:20 +10:00
current_user_serializer_spec.rb FIX: Muted tags are respected by TopicTrackingState (#8467) 2019-12-10 09:50:05 +11:00
group_show_serializer_spec.rb DEV: Prefabrication (test optimization) (#7414) 2019-05-07 13:12:20 +10:00
new_post_result_serializer_spec.rb Support for custom messages and redirects when creating posts (#8434) 2019-11-29 09:30:54 -05:00
notification_serializer_spec.rb FIX: Include user id in notification webhook (#8195) 2019-10-21 16:24:41 -06:00
post_revision_serializer_spec.rb DEV: Prefabrication (test optimization) (#7414) 2019-05-07 13:12:20 +10:00
post_serializer_spec.rb FIX: Rename all instances of bookmarkWithReminder to just bookmark (#9579) 2020-04-30 10:09:22 +10:00
reviewable_flagged_post_serializer_spec.rb Fix the actual failing test 2019-11-14 16:20:45 -08:00
reviewable_queued_post_serializer_spec.rb FEATURE: Allow viewing of raw emails for reviewable queued posts (#7910) 2019-07-19 11:56:14 -04:00
reviewable_serializer_spec.rb Fix the actual failing test 2019-11-14 16:20:45 -08:00
reviewable_user_serializer_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
single_sign_on_record_serializer_spec.rb DEV: Prefabrication (test optimization) (#7414) 2019-05-07 13:12:20 +10:00
site_serializer_spec.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
suggested_topic_serializer_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
tag_group_serializer_spec.rb FEATURE: Tag synonyms 2019-12-04 13:33:51 -05:00
theme_serializer_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
topic_link_serializer_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
topic_list_item_serializer_spec.rb FIX: composer problem on the categories page (#9508) 2020-04-22 09:24:54 -07:00
topic_list_serializer_spec.rb DEV: Prefabrication (test optimization) (#7414) 2019-05-07 13:12:20 +10:00
topic_view_posts_serializer_spec.rb PERF: optimize lookup of reviewable info in post stream 2019-06-07 18:12:30 +10:00
topic_view_serializer_spec.rb FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
upload_serializer_spec.rb FIX: add short_path to upload_serializer (#9417) 2020-04-15 09:19:59 +10:00
user_auth_token_serializer_spec.rb DEV: Prefabrication (test optimization) (#7414) 2019-05-07 13:12:20 +10:00
user_bookmark_serializer_spec.rb DEV: Update rubocop-discourse (#9270) 2020-03-26 16:32:41 +01:00
user_serializer_spec.rb PERF: Reduce DB queries when serializing ignore/mute information (#8629) 2020-01-02 13:04:08 +00:00
user_summary_serializer_spec.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
web_hook_post_serializer_spec.rb Fix the WebHookPostSerializer spec. 2019-12-04 23:30:04 +05:30
web_hook_topic_view_serializer_spec.rb FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
web_hook_user_serializer_spec.rb FEATURE: Featured topic for user profile & card (#8461) 2019-12-09 11:15:47 -08:00