Add support for custom action buttons in the editor #40
Replies: 1 comment 5 replies
-
I think for general entity actions like the "Generate certificate", I'd probably say lets keep them in the actions menu drop down in the top right as I really wouldn't want to fill up the footer bar with tons of buttons. But the "Save" actions is kind of interesting and I have just been playing around with this and have something working. It essentially introducing a new ActionType that can be used by the action visibility control https://docs.getkonstrukt.net/actions/action-visibility so you can now expose a button for As a save is always triggered, Konstrukt auto prefixes "Save &" to the buttons label. I toyed with allowing save actions to not require a save, but it started to make the config awkward and I think it's not entirely necesarry given we can add actions to the actions menu that is on the same screen so I think a rule could be "Save actions always trigger a save" and if you don't want to, then you create a normal action instead. How does this sound? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment the editor only shows two buttons: Return to list and Save. It would be nice to be able to add custom buttons that allow for additional actions within the event handlers. The
KonstruktEntitySavingNotification
andKonstruktEntitySavedNotification
could have something like anAction
(string) property, so you can use that value to implement additional functionality. For example you could have a Save and Save and send invoice button. When the Save and send invoice button is clicked theKonstruktEntitySavedNotification.Action
property could contain the value 'SendInvoice' (or whatever the developer wants to use) and the event handler would know to also send out an email after the entity has been saved to the database by Konstrukt.This could also be used to skip Konstrukt's saving functionalitity entirely and only do some bespoke stuff. For example you'd have a Generate certificate button. You could then use the
KonstruktEntitySavingNotification
event to generate a PDF certificate (and maybe do some custom database actions) and skip Konstrukt's default save procedure by cancelling the event after you've done your custom work. Or would this result in an error message in the backoffice?Beta Was this translation helpful? Give feedback.
All reactions