mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:33:24 +08:00
3e4621c2cb
This pull request follows on from https://github.com/discourse/discourse/pull/16308. This one does the following:
* Changes `BookmarkQuery` to allow for querying more than just Post and Topic bookmarkables
* Introduces a `Bookmark.register_bookmarkable` method which requires a model, serializer, fields and preload includes for searching. These registered `Bookmarkable` types are then used when validating new bookmarks, and also when determining which serializer to use for the bookmark list. The `Post` and `Topic` bookmarkables are registered by default.
* Adds new specific types for Post and Topic bookmark serializers along with preloading of associations in `UserBookmarkList`
* Changes to the user bookmark list template to allow for more generic bookmarkable types alongside the Post and Topic ones which need to display in a particular way
All of these changes are gated behind the `use_polymorphic_bookmarks` site setting, apart from the .hbs changes where I have updated the original `UserBookmarkSerializer` with some stub methods.
Following this PR will be several plugin PRs (for assign, chat, encrypt) that will register their own bookmarkable types or otherwise alter the bookmark serializers in their own way, also gated behind `use_polymorphic_bookmarks`.
This commit also removes `BookmarkQuery.preloaded_custom_fields` and the functionality surrounding it. It was added in
|
||
---|---|---|
.. | ||
about_serializer_spec.rb | ||
admin_plugin_serializer_spec.rb | ||
admin_user_list_serializer_spec.rb | ||
basic_group_serializer_spec.rb | ||
basic_group_user_serializer_spec.rb | ||
basic_post_serializer_spec.rb | ||
basic_user_serializer_spec.rb | ||
category_detailed_serializer_spec.rb | ||
category_serializer_spec.rb | ||
category_upload_serializer_spec.rb | ||
current_user_serializer_spec.rb | ||
directory_item_serializer_spec.rb | ||
emoji_serializer_spec.rb | ||
group_show_serializer_spec.rb | ||
listable_topic_serializer_spec.rb | ||
new_post_result_serializer_spec.rb | ||
notification_serializer_spec.rb | ||
pending_post_serializer_spec.rb | ||
post_revision_serializer_spec.rb | ||
post_serializer_spec.rb | ||
reviewable_flagged_post_serializer_spec.rb | ||
reviewable_queued_post_serializer_spec.rb | ||
reviewable_score_serializer_spec.rb | ||
reviewable_serializer_spec.rb | ||
reviewable_user_serializer_spec.rb | ||
single_sign_on_record_serializer_spec.rb | ||
site_serializer_spec.rb | ||
suggested_topic_serializer_spec.rb | ||
tag_group_serializer_spec.rb | ||
theme_serializer_spec.rb | ||
topic_link_serializer_spec.rb | ||
topic_list_item_serializer_spec.rb | ||
topic_list_serializer_spec.rb | ||
topic_view_details_serializer_spec.rb | ||
topic_view_posts_serializer_spec.rb | ||
topic_view_serializer_spec.rb | ||
upload_serializer_spec.rb | ||
user_auth_token_serializer_spec.rb | ||
user_bookmark_list_serializer_spec.rb | ||
user_bookmark_serializer_spec.rb | ||
user_card_serializer_spec.rb | ||
user_post_bookmark_serializer_spec.rb | ||
user_serializer_spec.rb | ||
user_summary_serializer_spec.rb | ||
user_topic_bookmark_serializer_spec.rb | ||
web_hook_post_serializer_spec.rb | ||
web_hook_topic_view_serializer_spec.rb | ||
web_hook_user_serializer_spec.rb | ||
wizard_serializer_spec.rb |