discourse/spec/fabricators
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
..
api_key_fabricator.rb FEATURE: Hash API keys in the database (#8438) 2019-12-12 11:45:00 +00:00
badge_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
bookmark_fabricator.rb FEATURE: Send notifications for time-based and At Desktop bookmark reminders (#9071) 2020-03-12 10:16:00 +10:00
category_fabricator.rb FIX: Make inline oneboxes work with secured topics in secured contexts (#8895) 2020-02-12 12:11:28 +02:00
category_group_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
color_scheme_color_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
color_scheme_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
email_change_request_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
email_log_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
email_token_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
embeddable_host_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
flag_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
group_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
group_history_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
group_request_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
group_user_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
ignored_user.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
incoming_email_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
incoming_link_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
invite_fabricator.rb FEATURE: send max 200 emails every minute for bulk invites (#7875) 2019-07-19 11:29:12 +05:30
like_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
muted_user.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
notification_fabricator.rb FEATURE: High priority bookmark reminder notifications (#9290) 2020-04-01 09:09:20 +10:00
optimized_image_fabricator.rb Fix the build. 2019-05-23 16:11:50 +08:00
permalink_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
post_action_fabricator.rb FIX: correct user serializer user method for extended serializer (#8590) 2019-12-19 09:48:01 -08:00
post_custom_field_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
post_detail_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
post_fabricator.rb FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
post_reply_key_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
post_revision_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
published_page_fabricator.rb FEATURE: Support for publishing topics as pages (#9364) 2020-04-08 12:52:36 -04:00
reviewable_claimed_topic_fabricator.rb FEATURE: Claim Reviewables by Topic 2019-05-09 13:40:36 -04:00
reviewable_fabricator.rb FIX: Granting staff status should auto-approve users waiting approval (#8533) 2019-12-12 16:26:38 -03:00
screened_email_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
screened_ip_address_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
screened_url_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
search_log_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
shared_draft_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
single_sign_on_record_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
skipped_email_log_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
tag_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
tag_group_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
theme_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
topic_allowed_group_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
topic_allowed_user_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
topic_embed_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
topic_fabricator.rb DEV: Use dynamic/static fabricator attrs correctly (#9519) 2020-04-22 20:49:53 +02:00
topic_tag_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
topic_timer_fabricator.rb DEV: Use dynamic/static fabricator attrs correctly (#9519) 2020-04-22 20:49:53 +02:00
topic_user_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
upload_fabricator.rb DEV: Use dynamic/static fabricator attrs correctly (#9519) 2020-04-22 20:49:53 +02:00
user_action_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
user_api_key_fabricator.rb DEV: Drop 'key' column from user_api_keys (#9388) 2020-04-22 12:13:19 +03:00
user_avatar_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
user_email_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
user_fabricator.rb FEATURE: introduce dedicated storage and DB constraints for anon users 2019-05-29 14:26:24 +10:00
user_field_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
user_option_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
user_profile_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
user_second_factor_fabricator.rb DEV: use #frozen_string_literal: true on all spec 2019-04-30 10:27:42 +10:00
user_security_key_fabricator.rb FEATURE: Webauthn authenticator management with 2FA login (Security Keys) (#8099) 2019-10-01 19:08:41 -07:00
watched_word_fabricator.rb DEV: Use dynamic/static fabricator attrs correctly (#9519) 2020-04-22 20:49:53 +02:00
web_crawler_request_fabricator.rb DEV: Use dynamic/static fabricator attrs correctly (#9519) 2020-04-22 20:49:53 +02:00
web_hook_fabricator.rb FEATURE: Webhooks and Event for user being granted a badge 2020-04-08 14:38:30 -07:00