MM-15324 Allow plugins override ephemeral posts #2759
Conversation
@cpoile Gently reminder about this PR. Would be great if we can get this in v5.12. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @scottleedavis, this is really nice.
Just making sure I understand what's happening here: you have to add your own props to an ephemeral post, and that's how it'll pick up that this is post that 'hasPlugin'?
Thanks @cpoile ! That is correct. I chose this route over change the post type to have a prefix 'system_ephemeral_<custom_name>', as a lot of things would need to change, and I wanted to preserve the behavior with as little change as possible. |
@hanzei @scottleedavis does this need any documentation at https://developers.mattermost.com/extend/plugins/? |
@jasonblais I think it would be a good idea. Otherwise it isn't straight forward to use props to solve the issue. I haven't done documentation updates yet, happy to do so if requested. :) |
@scottleedavis It would be great if you had time to help with the doc! :) |
Documented via: #3024 . Thanks Scott! |
Summary
This PR enables ephemeral posts with a post.prop.type to override a post by a webapp plugin.
e.g. keeps the system_ephemeral post.type, but allows post.props.type to override
This has been validated by using
/test-ephemeral-post-override
from the test bot pluginTicket Link
Fixes mattermost/mattermost#10797
Notes
I did not add a test to post_message_view_test.jsx as I wasn't sure if it was needed and I am unfamiliar with snapshot testing. (happy to do it if requested).
I did not add a test for post_body.jsx as no tests currently exist for the component.