discourse/plugins/chat/spec/system
Loïc Guitaut 41584ab40c DEV: Provide user input to services using `params` key
Currently in services, we don’t make a distinction between input
parameters, options and dependencies.

This can lead to user input modifying the service behavior, whereas it
was not the developer intention.

This patch addresses the issue by changing how data is provided to
services:
- `params` is now used to hold all data coming from outside (typically
  user input from a controller) and a contract will take its values from
  `params`.
- `options` is a new key to provide options to a service. This typically
  allows changing a service behavior at runtime. It is, of course,
  totally optional.
- `dependencies` is actually anything else provided to the service (like
  `guardian`) and available directly from the context object.

The `service_params` helper in controllers has been updated to reflect
those changes, so most of the existing services didn’t need specific
changes.

The options block has the same DSL as contracts, as it’s also based on
`ActiveModel`. There aren’t any validations, though. Here’s an example:
```ruby
options do
  attribute :allow_changing_hidden, :boolean, default: false
end
```
And here’s an example of how to call a service with the new keys:
```ruby
MyService.call(params: { key1: value1, … }, options: { my_option: true }, guardian:, …)
```
2024-10-25 09:57:59 +02:00
..
admin FEATURE: Convert chat plugin UI to new show plugin and admin UI guidelines (#28632) 2024-09-10 15:16:16 +10:00
chat/composer FEATURE: supports mark tag in chat messages (#28949) 2024-09-17 20:52:34 +02:00
chat_message DEV: Try until success for clipboard copies (#27986) 2024-07-19 19:44:10 +08:00
drawer DEV: rename chat preferred mobile index to chat preferred index (#27953) 2024-07-30 10:25:22 -03:00
list_channels DEV: add spec for chat drawer channel lists (#28927) 2024-09-16 12:15:21 +04:00
page_objects DEV: Fix flaky chat system tests (#29104) 2024-10-07 14:20:19 +08:00
reply_to_message FEATURE: supports mark tag in chat messages (#28949) 2024-09-17 20:52:34 +02:00
select_message
shortcuts
thread_list
thread_tracking FEATURE: Add ability to watch chat threads (#28639) 2024-09-02 16:45:55 +04:00
user_menu_notifications DEV: cleanup chat desktop notification data (#28943) 2024-10-03 12:43:17 +04:00
user_status
about_page_site_acitivity_spec.rb DEV: Allow custom site activity items in the new /about page (#28400) 2024-08-20 16:16:05 +03:00
admin_sidebar_navigation_spec.rb DEV: adds logo page component (#28276) 2024-08-08 13:52:48 +02:00
anonymous_spec.rb
archive_channel_spec.rb
bookmark_message_spec.rb
browse_page_spec.rb
channel_members_page_spec.rb
channel_message_upload_spec.rb
channel_settings_page_spec.rb FEATURE: enable threading in chat DM channels (#29170) 2024-10-11 13:05:07 +04:00
channel_thread_message_echoing_spec.rb
chat_channel_spec.rb DEV: More specs for chat excerpts (#29344) 2024-10-22 14:53:42 -03:00
chat_composer_draft_spec.rb
chat_composer_spec.rb
chat_footer_spec.rb FEATURE: Add ability to watch chat threads (#28639) 2024-09-02 16:45:55 +04:00
chat_message_creator_spec.rb FIX: chat direct message group user limit is off by 1 (#27014) 2024-06-03 12:11:49 +04:00
chat_message_onebox_spec.rb
chat_new_message_spec.rb FIX: new chat from url flaky fix (#27414) 2024-06-11 14:13:08 +04:00
closed_channel_spec.rb
create_channel_spec.rb
dates_separators_spec.rb
deleted_channel_spec.rb
deleted_message_spec.rb
document_title_spec.rb
drawer_spec.rb FIX: adds chat-draw-expanded class to body (#28490) 2024-08-22 17:46:41 +02:00
edited_message_spec.rb
flag_message_spec.rb
hashtag_autocomplete_spec.rb FEATURE: allows browse page in chat drawer (#27919) 2024-07-16 12:34:37 +02:00
invite_users_to_channel_spec.rb DEV: Provide user input to services using `params` key 2024-10-25 09:57:59 +02:00
kick_user_from_channel_spec.rb
mention_warnings_spec.rb
message_errors_spec.rb FIX: show too long message error on client (#27794) 2024-07-09 18:34:35 +02:00
message_notifications_mobile_spec.rb FEATURE: allows browse page in chat drawer (#27919) 2024-07-16 12:34:37 +02:00
message_notifications_with_sidebar_spec.rb
message_thread_indicator_spec.rb DEV: skip flaky system chat spec (#27737) 2024-07-05 15:27:07 +02:00
message_user_info_spec.rb
move_message_to_channel_spec.rb FEATURE: Support designating multiple groups as mods on category (#28655) 2024-09-04 04:38:46 +03:00
navigation_spec.rb DEV: adds logo page component (#28276) 2024-08-08 13:52:48 +02:00
react_to_message_spec.rb
read_only_spec.rb
removing_channel_spec.rb
restore_message_spec.rb
reviewables_spec.rb
send_message_spec.rb
separate_sidebar_mode_spec.rb DEV: adds logo page component (#28276) 2024-08-08 13:52:48 +02:00
sidebar_navigation_menu_spec.rb UX: new sidebar styling (#29119) 2024-10-08 11:28:36 +02:00
sidebars_spec.rb
silenced_user_spec.rb
single_thread_spec.rb FEATURE: allows browse page in chat drawer (#27919) 2024-07-16 12:34:37 +02:00
thread_preview_spec.rb
transcript_spec.rb DEV: Try until success for clipboard copies (#27986) 2024-07-19 19:44:10 +08:00
unfollow_dm_channel_spec.rb
update_last_read_spec.rb
uploads_spec.rb FIX: _uploadDropTargetOptions is now public (#29246) 2024-10-17 13:10:01 +09:00
user_card_spec.rb
user_chat_preferences_spec.rb
user_profile_spec.rb
user_threads_spec.rb
visit_channel_spec.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00