mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: wip send mail preview
This commit is contained in:
@@ -30,7 +30,6 @@ import {
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
* Estimate read-only details actions bar of the drawer.
|
||||
@@ -44,6 +43,7 @@ function EstimateDetailActionsBar({
|
||||
|
||||
// #withDrawerActions
|
||||
closeDrawer,
|
||||
openDrawer
|
||||
}) {
|
||||
// Estimate details drawer context.
|
||||
const { estimateId, estimate } = useEstimateDetailDrawerContext();
|
||||
@@ -80,7 +80,7 @@ function EstimateDetailActionsBar({
|
||||
};
|
||||
// Handles the estimate mail dialog.
|
||||
const handleMailEstimate = () => {
|
||||
openDialog(DialogsName.EstimateMail, { estimateId });
|
||||
openDrawer(DRAWERS.ESTIMATE_SEND_MAIL, { estimateId });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -28,7 +28,6 @@ import {
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
* Payment receive actions bar.
|
||||
@@ -39,6 +38,7 @@ function PaymentsReceivedActionsBar({
|
||||
|
||||
// #withDrawerActions
|
||||
closeDrawer,
|
||||
openDrawer,
|
||||
|
||||
// #withDialogActions
|
||||
openDialog,
|
||||
@@ -69,8 +69,11 @@ function PaymentsReceivedActionsBar({
|
||||
openDialog('payment-pdf-preview', { paymentReceiveId });
|
||||
};
|
||||
|
||||
// Handle mail action.
|
||||
const handleMailPaymentReceive = () => {
|
||||
openDialog(DialogsName.PaymentMail, { paymentReceiveId });
|
||||
openDrawer(DRAWERS.PAYMENT_RECEIVED_SEND_MAIL, {
|
||||
paymentReceivedId: paymentReceiveId,
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -24,7 +24,6 @@ import { useReceiptDetailDrawerContext } from './ReceiptDetailDrawerProvider';
|
||||
import { SaleReceiptAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
import { safeCallback, compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
* Receipt details actions bar.
|
||||
@@ -39,6 +38,7 @@ function ReceiptDetailActionBar({
|
||||
|
||||
// #withDrawerActions
|
||||
closeDrawer,
|
||||
openDrawer
|
||||
}) {
|
||||
const history = useHistory();
|
||||
const { receiptId } = useReceiptDetailDrawerContext();
|
||||
@@ -61,8 +61,9 @@ function ReceiptDetailActionBar({
|
||||
const handleNotifyViaSMS = () => {
|
||||
openDialog('notify-receipt-via-sms', { receiptId });
|
||||
};
|
||||
// Handle receipt mail action.
|
||||
const handleReceiptMail = () => {
|
||||
openDialog(DialogsName.ReceiptMail, { receiptId });
|
||||
openDrawer(DRAWERS.RECEIPT_SEND_MAIL, { receiptId });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
import * as Yup from 'yup';
|
||||
|
||||
export const EstimateSendMailSchema = Yup.object().shape({});
|
||||
export const EstimateSendMailSchema = Yup.object().shape({
|
||||
subject: Yup.string().required('Subject is required'),
|
||||
message: Yup.string().required('Message is required'),
|
||||
to: Yup.array()
|
||||
.of(Yup.string().email('Invalid email address'))
|
||||
.required('To address is required'),
|
||||
cc: Yup.array().of(Yup.string().email('Invalid email address')),
|
||||
bcc: Yup.array().of(Yup.string().email('Invalid email address')),
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@ export function InvoiceSendMailFields() {
|
||||
const argsOptions = useSendInvoiceFormatArgsOptions();
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<Stack flex={1}>
|
||||
<Stack spacing={0} overflow="auto" flex="1" p={'30px'}>
|
||||
<SendMailViewToAddressField
|
||||
toMultiSelectProps={{ items }}
|
||||
|
||||
Reference in New Issue
Block a user