**Does V14 emit any events we can listen
# package-development
w
Does V14 emit any events we can listen/catch ? IE does an event get emitted when a document/content node is published?
s
Webhooks? Not sure if the mgmt API has any events.
w
This is clientside JS events. Be good to have a hook to know when something was successful. ie when a document is saved and published
s
These are still in the docs, so I assume they work just as before: https://docs.umbraco.com/umbraco-cms/reference/notifications/contentservice-notifications
Ah JS events. I'm stumped. 😅
w
As I could put a custom button for save and publish to be overwritten - however I don't know if something was successful or not from the publish from the workspaceContext AFAIK. /cc @Jacob Overgaard or @Niels Lyngsø ?
@Sebastiaan I would be super curious if thatg tutorial still works - I am semi skeptical....
s
That sounds like the type of AngularJS hackery we (luckily) can't have any more. What are you trying to do? AFAIK you should inherit the default button and add your own behavior if you need it to be customized.
w
Just something fun/silly as a simple hack to learn & play with overriding stuff 😄
But the button as I can see has no understanding if the publish was sucessfui or not - it just triggers the workspaceContext to saveandPublish
Which in turn calls a repo and then that fires a notification that we see if its sucessful. So what from what I understand there is no way to know if something is a-OKAY
But my silly hack case in my backlog of odds and ends whilst im learning... Click save & publish - only if sucessful then play a crowd clapping sound or something silly 😛
n
If your overwrite is what calls the method on the context, then you also got a Promise that will either be resolved or rejected depending on whether it succeeded. So that should do it for you 🙂
w
Fab will use that then and give it a hack later in the week. One hack project at a time 🙂
9 Views