Tuesday, December 17, 2019
2 changes · master
Resolved issues and error corrections
This fixes an issue where marking a CRM lead as lost could leave it in an inconsistent state if automatic probability was later applied. Lost leads now keep both manual and automatic probabilities at zero, and restored leads have their probabilities recalculated correctly.
Dialog buttons can now wait for an action, such as a user confirmation, before deciding whether to close the window. If the action is cancelled or fails, the dialog stays open, preventing users from being taken out of their workflow unexpectedly.
Original PR description
Prior to this commit, there was no clean way to have a button triggering asynchronous work (like asking user for confirmaton for example) and close or not close the modal according to the user choice. Your options were: 1. Swallow the pill and just accept that the modal will close even if the user chose not to undertake the action. 2. Set the `close` parameter of the button to false and handle the conditional closing by yourself from outside the dialog. This commit introduces a way to tell the form view dialog that the action has not been processed correctly and that the modal should not be closed by returning a rejected promise. Prior behavior can still be obtained (close no matter the result) by having the handler not returning a promise at all.