feat(webapp): send mail notification dialogs

This commit is contained in:
Ahmed Bouhuolia
2023-12-26 15:52:38 +02:00
parent 3c8c3d8253
commit de1b7f132c
33 changed files with 737 additions and 0 deletions

View File

@@ -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}