]> BookStack Code Mirror - bookstack/commit
Added extendable/scalable formatter for webhook data
authorDan Brown <redacted>
Sat, 26 Mar 2022 16:44:34 +0000 (16:44 +0000)
committerDan Brown <redacted>
Sat, 26 Mar 2022 16:53:02 +0000 (16:53 +0000)
commit3625f12abe7c0cc052bd027af961d0214d6fcc7e
treebf708bee4962f2b8a40748f75bc8e6e74758589c
parent55d61fceb2f70209c29e6cc0dab4087a2b7b4312
Added extendable/scalable formatter for webhook data

Creates a new organsied formatting system for webhook data, with
interfaces for extending with custom model formatting rules.
Allows easy usage & extension of the default bookstack formatting
behaviour when customizing webhook events via theme system, and keeps
default data customizations organised.

This also makes the following webhook data changes:
- owned_by/created_by/updated_by user details are loaded for events with
  Entity details. (POTENTIALLY BREAKING CHANGE).
- current_revision details are loaded for page update/create events.

Added testing to cover added model formatting rules.

For #3279 and #3218
app/Actions/DispatchWebhookJob.php
app/Actions/WebhookFormatter.php [new file with mode: 0644]
app/Entities/Models/Page.php
app/Entities/Models/PageRevision.php
app/Http/Controllers/PageRevisionController.php
app/Theming/ThemeEvents.php
resources/views/settings/webhooks/parts/format-example.blade.php
tests/Actions/WebhookFormatTesting.php [new file with mode: 0644]
tests/Entity/PageRevisionTest.php