nathanwoulfe / Plumber

The workflow solution for Umbraco 7
39 stars 20 forks source link

Reset button state when approval throws error #92

Closed tomfulton closed 5 years ago

tomfulton commented 5 years ago

Currently when approving a Publish/Unpublish operation that fails with an exception, the button stays in a "spinning"/busy state, and the user has to refresh to re-submit. This update ensures the button state is reset, and updates the notification with the exception message.

Old

button-state-issue

New

button-state-updated

nathanwoulfe commented 5 years ago

@tomfulton, looks good to me - out of interest, what were you doing to cause the error on submit?

tomfulton commented 5 years ago

We had some custom ContentService.Publishing events that canceled the Publish. Plumber was then throwing because it assumed there the PublishStatus contained an Exception (it was null). That specific case would be fixed with #93, but thought it made sense to implement this just in case of any other unhandled errors while I was working on it :)

nathanwoulfe commented 5 years ago

That makes sense. Really appreciate your contributions too - covering scenarios I obviously hadn't considered is fantastic!