mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
Merge branch 'develop' into big-116-open-up-the-link-component
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { Dialog, DialogSuspense } from '@/components';
|
||||
import withDialogRedux from '@/components/DialogReduxConnect';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
const ReceiptFormMailDeliverDialogContent = React.lazy(
|
||||
() => import('./ReceiptFormMailDeliverDialogContent'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Receipt mail dialog.
|
||||
*/
|
||||
function ReceiptFormMailDeliverDialog({
|
||||
dialogName,
|
||||
payload: { receiptId = null },
|
||||
isOpen,
|
||||
}) {
|
||||
return (
|
||||
<Dialog
|
||||
name={dialogName}
|
||||
title={'Receipt Mail'}
|
||||
isOpen={isOpen}
|
||||
canEscapeJeyClose={false}
|
||||
isCloseButtonShown={false}
|
||||
autoFocus={true}
|
||||
style={{ width: 600 }}
|
||||
>
|
||||
<DialogSuspense>
|
||||
<ReceiptFormMailDeliverDialogContent
|
||||
dialogName={dialogName}
|
||||
receiptId={receiptId}
|
||||
/>
|
||||
</DialogSuspense>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(withDialogRedux())(ReceiptFormMailDeliverDialog);
|
||||
@@ -0,0 +1,40 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import ReceiptMailDialogContent from '../../ReceiptMailDialog/ReceiptMailDialogContent';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
interface ReceiptFormDeliverDialogContent {
|
||||
receiptId: number;
|
||||
}
|
||||
|
||||
function ReceiptFormDeliverDialogContentRoot({
|
||||
receiptId,
|
||||
|
||||
// #withDialogActions
|
||||
closeDialog,
|
||||
}: ReceiptFormDeliverDialogContent) {
|
||||
const history = useHistory();
|
||||
|
||||
const handleSubmit = () => {
|
||||
history.push('/receipts');
|
||||
closeDialog(DialogsName.ReceiptFormMailDeliver);
|
||||
};
|
||||
const handleCancel = () => {
|
||||
history.push('/receipts');
|
||||
closeDialog(DialogsName.ReceiptFormMailDeliver);
|
||||
};
|
||||
|
||||
return (
|
||||
<ReceiptMailDialogContent
|
||||
receiptId={receiptId}
|
||||
onFormSubmit={handleSubmit}
|
||||
onCancelClick={handleCancel}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default R.compose(withDialogActions)(
|
||||
ReceiptFormDeliverDialogContentRoot,
|
||||
);
|
||||
@@ -2,6 +2,8 @@
|
||||
import React from 'react';
|
||||
import { useFormikContext } from 'formik';
|
||||
import ReceiptNumberDialog from '@/containers/Dialogs/ReceiptNumberDialog';
|
||||
import ReceiptFormMailDeliverDialog from './Dialogs/ReceiptFormMailDeliverDialog';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
* Receipt form dialogs.
|
||||
@@ -27,6 +29,9 @@ export default function ReceiptFormDialogs() {
|
||||
dialogName={'receipt-number-form'}
|
||||
onConfirm={handleReceiptNumberFormConfirm}
|
||||
/>
|
||||
<ReceiptFormMailDeliverDialog
|
||||
dialogName={DialogsName.ReceiptFormMailDeliver}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user