Remove redundant confirmLeave on tracking number dialog (#1926)

* Add onBeforeUnload handler to prevent accidental refresh

* Update button messages

* Fix exit form not working after submit

* Make onBeforeUnload disable if env is development

* Fix onClose

* Remove internal date time field state

* Update messages and dialog

* Prevent navigation on 400 error

* Add submit disabled ref in exit form

* Update exit form dialog for disabled save

* Update confirmLeave forms to set ref if save is disabled

* Remove unused error handling

* Remove explicit ref type

* Remove unused import

* Fix disabled type

* Add disable check function to generic forms

* Add custom isDisabled method to sale and voucher forms

* Add default isDisabled functions to confirmLeave forms

* Update tests

* Remove unused code

* Rebase fixes + update tests

* Refactor form and useform

* Refactor disabling forms

* Change "saveDisabled" name to "isSaveDisabled" for improved readability

* Change "isDisabled" function to "checkIfSaveIsDisabled"

* Remove redundant confirmLeave on tracking number dialog
This commit is contained in:
Wojciech Mista 2022-03-23 11:41:26 +01:00 committed by GitHub
parent 74848922dc
commit 26659a0be7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,7 @@ const OrderFulfillmentTrackingDialog: React.FC<OrderFulfillmentTrackingDialogPro
return ( return (
<Dialog onClose={onClose} open={open} fullWidth maxWidth="xs"> <Dialog onClose={onClose} open={open} fullWidth maxWidth="xs">
<Form confirmLeave initial={initialData} onSubmit={onConfirm}> <Form initial={initialData} onSubmit={onConfirm}>
{({ change, data, submit }) => ( {({ change, data, submit }) => (
<> <>
<DialogTitle> <DialogTitle>