mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat(webapp): send mail notification dialogs
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
* Estimate read-only details actions bar of the drawer.
|
||||
@@ -65,6 +66,10 @@ function EstimateDetailActionsBar({
|
||||
const handleNotifyViaSMS = () => {
|
||||
openDialog('notify-estimate-via-sms', { estimateId });
|
||||
};
|
||||
// Handles the estimate mail dialog.
|
||||
const handleMailEstimate = () => {
|
||||
openDialog(DialogsName.EstimateMail, { estimateId });
|
||||
};
|
||||
|
||||
return (
|
||||
<DrawerActionsBar>
|
||||
@@ -86,6 +91,15 @@ function EstimateDetailActionsBar({
|
||||
onClick={handlePrintEstimate}
|
||||
/>
|
||||
</Can>
|
||||
|
||||
<Can I={SaleEstimateAction.View} a={AbilitySubject.Estimate}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
text={'Mail'}
|
||||
onClick={handleMailEstimate}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={SaleEstimateAction.Delete} a={AbilitySubject.Estimate}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
import { compose } from '@/utils';
|
||||
import { BadDebtMenuItem } from './utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
* Invoice details action bar.
|
||||
@@ -93,6 +94,10 @@ function InvoiceDetailActionsBar({
|
||||
openAlert('cancel-bad-debt', { invoiceId });
|
||||
};
|
||||
|
||||
const handleMailInvoice = () => {
|
||||
openDialog(DialogsName.InvoiceMail, { invoiceId });
|
||||
};
|
||||
|
||||
return (
|
||||
<DrawerActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -116,6 +121,13 @@ function InvoiceDetailActionsBar({
|
||||
</If>
|
||||
<NavbarDivider />
|
||||
</Can>
|
||||
<Can I={SaleInvoiceAction.View} a={AbilitySubject.Invoice}>
|
||||
<Button
|
||||
text={'Mail'}
|
||||
onClick={handleMailInvoice}
|
||||
className={Classes.MINIMAL}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={SaleInvoiceAction.View} a={AbilitySubject.Invoice}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
* Payment receive actions bar.
|
||||
@@ -68,6 +69,10 @@ function PaymentReceiveActionsBar({
|
||||
openDialog('payment-pdf-preview', { paymentReceiveId });
|
||||
};
|
||||
|
||||
const handleMailPaymentReceive = () => {
|
||||
openDialog(DialogsName.PaymentMail, { paymentReceiveId });
|
||||
};
|
||||
|
||||
return (
|
||||
<DrawerActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -88,6 +93,13 @@ function PaymentReceiveActionsBar({
|
||||
onClick={handlePrintPaymentReceive}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={PaymentReceiveAction.View} a={AbilitySubject.PaymentReceive}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
text={'Mail'}
|
||||
onClick={handleMailPaymentReceive}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={PaymentReceiveAction.Delete} a={AbilitySubject.PaymentReceive}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
@@ -24,6 +24,7 @@ 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.
|
||||
@@ -60,6 +61,9 @@ function ReceiptDetailActionBar({
|
||||
const handleNotifyViaSMS = () => {
|
||||
openDialog('notify-receipt-via-sms', { receiptId });
|
||||
};
|
||||
const handleReceiptMail = () => {
|
||||
openDialog(DialogsName.ReceiptMail, { receiptId });
|
||||
}
|
||||
|
||||
return (
|
||||
<DrawerActionsBar>
|
||||
@@ -81,6 +85,13 @@ function ReceiptDetailActionBar({
|
||||
onClick={safeCallback(onPrintReceipt)}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={SaleReceiptAction.View} a={AbilitySubject.Receipt}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
text={'Mail'}
|
||||
onClick={handleReceiptMail}
|
||||
/>
|
||||
</Can>
|
||||
<Can I={SaleReceiptAction.Delete} a={AbilitySubject.Receipt}>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
Reference in New Issue
Block a user