mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix: SMS notification types.
This commit is contained in:
@@ -13,7 +13,7 @@ import { compose } from 'utils';
|
||||
|
||||
const notificationType = {
|
||||
key: 'sale-estimate-details',
|
||||
label: 'Sale estimate details',
|
||||
label: intl.get('sms_notification.estimate_details.type'),
|
||||
};
|
||||
|
||||
function NotifyEstimateViaSMSForm({
|
||||
@@ -60,6 +60,7 @@ function NotifyEstimateViaSMSForm({
|
||||
|
||||
const initialValues = {
|
||||
...estimateSMSDetail,
|
||||
notification_key: notificationType.key,
|
||||
};
|
||||
// Handle the form cancel.
|
||||
const handleFormCancel = () => {
|
||||
@@ -69,7 +70,7 @@ function NotifyEstimateViaSMSForm({
|
||||
return (
|
||||
<NotifyViaSMSForm
|
||||
initialValues={initialValues}
|
||||
notificationTypes={notificationType}
|
||||
notificationTypes={[notificationType]}
|
||||
onCancel={handleFormCancel}
|
||||
onSubmit={handleFormSubmit}
|
||||
calloutCodes={calloutCode}
|
||||
|
||||
@@ -15,6 +15,18 @@ const transformFormValuesToRequest = (values) => {
|
||||
return pick(values, ['notification_key']);
|
||||
};
|
||||
|
||||
// Momerize the notification types.
|
||||
const notificationTypes = [
|
||||
{
|
||||
key: 'details',
|
||||
label: intl.get('sms_notification.invoice_details.type'),
|
||||
},
|
||||
{
|
||||
key: 'reminder',
|
||||
label: intl.get('sms_notification.invoice_reminder.type'),
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* Notify Invoice Via SMS Form.
|
||||
*/
|
||||
@@ -80,14 +92,7 @@ function NotifyInvoiceViaSMSForm({
|
||||
setNotificationType(values.notification_key);
|
||||
}
|
||||
};
|
||||
// Momerize the notification types.
|
||||
const notificationTypes = React.useMemo(
|
||||
() => [
|
||||
{ key: 'details', label: 'Invoice details' },
|
||||
{ key: 'reminder', label: 'Invoice reminder' },
|
||||
],
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<NotifyViaSMSForm
|
||||
initialValues={initialValues}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { compose } from 'utils';
|
||||
|
||||
const notificationType = {
|
||||
key: 'payment-receive-details',
|
||||
label: 'Payment receive thank you.',
|
||||
label: intl.get('sms_notification.payment_details.type'),
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,10 @@ function NotifyPaymentReceiveViaSMSForm({
|
||||
|
||||
// Form initial values.
|
||||
const initialValues = React.useMemo(
|
||||
() => ({ ...paymentReceiveMSDetail }),
|
||||
() => ({
|
||||
...paymentReceiveMSDetail,
|
||||
notification_key: notificationType.key,
|
||||
}),
|
||||
[paymentReceiveMSDetail],
|
||||
);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { compose } from 'utils';
|
||||
|
||||
const notificationType = {
|
||||
key: 'sale-receipt-details',
|
||||
label: 'Sale receipt details',
|
||||
label: intl.get('sms_notification.receipt_details.type'),
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -66,6 +66,7 @@ function NotifyReceiptViaSMSForm({
|
||||
const initialValues = React.useMemo(
|
||||
() => ({
|
||||
...receiptSMSDetail,
|
||||
notification_key: notificationType.key,
|
||||
}),
|
||||
[receiptSMSDetail],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user