mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
revert: form changes
This commit is contained in:
@@ -29,7 +29,7 @@ export default function EstimateFloatingActions() {
|
|||||||
|
|
||||||
// Handle submit & deliver button click.
|
// Handle submit & deliver button click.
|
||||||
const handleSubmitDeliverBtnClick = (event) => {
|
const handleSubmitDeliverBtnClick = (event) => {
|
||||||
setSubmitPayload({ redirect: false, deliverViaMail: true });
|
setSubmitPayload({ redirect: true, deliver: true });
|
||||||
submitForm();
|
submitForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,16 +36,11 @@ import {
|
|||||||
handleErrors,
|
handleErrors,
|
||||||
resetFormState,
|
resetFormState,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import { DialogsName } from '@/constants/dialogs';
|
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Estimate form.
|
* Estimate form.
|
||||||
*/
|
*/
|
||||||
function EstimateForm({
|
function EstimateForm({
|
||||||
// #withDialogActions
|
|
||||||
openDialog,
|
|
||||||
|
|
||||||
// #withSettings
|
// #withSettings
|
||||||
estimateNextNumber,
|
estimateNextNumber,
|
||||||
estimateNumberPrefix,
|
estimateNumberPrefix,
|
||||||
@@ -113,7 +108,7 @@ function EstimateForm({
|
|||||||
delivered: submitPayload.deliver,
|
delivered: submitPayload.deliver,
|
||||||
};
|
};
|
||||||
// Handle the request success.
|
// Handle the request success.
|
||||||
const onSuccess = (res) => {
|
const onSuccess = (response) => {
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: intl.get(
|
message: intl.get(
|
||||||
isNewMode
|
isNewMode
|
||||||
@@ -131,11 +126,6 @@ function EstimateForm({
|
|||||||
if (submitPayload.resetForm) {
|
if (submitPayload.resetForm) {
|
||||||
resetFormState({ resetForm, initialValues, values });
|
resetFormState({ resetForm, initialValues, values });
|
||||||
}
|
}
|
||||||
if (submitPayload.deliverViaMail) {
|
|
||||||
openDialog(DialogsName.EstimateFormMailDeliver, {
|
|
||||||
estimateId: res.data.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
// Handle the request error.
|
// Handle the request error.
|
||||||
const onError = ({
|
const onError = ({
|
||||||
@@ -190,7 +180,6 @@ function EstimateForm({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withDialogActions,
|
|
||||||
withSettings(({ estimatesSettings }) => ({
|
withSettings(({ estimatesSettings }) => ({
|
||||||
estimateNextNumber: estimatesSettings?.nextNumber,
|
estimateNextNumber: estimatesSettings?.nextNumber,
|
||||||
estimateNumberPrefix: estimatesSettings?.numberPrefix,
|
estimateNumberPrefix: estimatesSettings?.numberPrefix,
|
||||||
|
|||||||
@@ -30,19 +30,19 @@ export default function InvoiceFloatingActions() {
|
|||||||
const { setSubmitPayload, invoice } = useInvoiceFormContext();
|
const { setSubmitPayload, invoice } = useInvoiceFormContext();
|
||||||
|
|
||||||
// Handle submit & deliver button click.
|
// Handle submit & deliver button click.
|
||||||
const handleSubmitDeliverBtnClick = () => {
|
const handleSubmitDeliverBtnClick = (event) => {
|
||||||
setSubmitPayload({ redirectToEdit: true, deliverViaMail: true });
|
setSubmitPayload({ redirect: true, deliver: true });
|
||||||
submitForm();
|
submitForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle submit, deliver & new button click.
|
// Handle submit, deliver & new button click.
|
||||||
const handleSubmitDeliverAndNewBtnClick = () => {
|
const handleSubmitDeliverAndNewBtnClick = (event) => {
|
||||||
setSubmitPayload({ redirect: false, deliver: true, resetForm: true });
|
setSubmitPayload({ redirect: false, deliver: true, resetForm: true });
|
||||||
submitForm();
|
submitForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle submit, deliver & continue editing button click.
|
// Handle submit, deliver & continue editing button click.
|
||||||
const handleSubmitDeliverContinueEditingBtnClick = () => {
|
const handleSubmitDeliverContinueEditingBtnClick = (event) => {
|
||||||
setSubmitPayload({ redirect: false, deliver: true });
|
setSubmitPayload({ redirect: false, deliver: true });
|
||||||
submitForm();
|
submitForm();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,20 +34,12 @@ import {
|
|||||||
transformValueToRequest,
|
transformValueToRequest,
|
||||||
resetFormState,
|
resetFormState,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import {
|
import { InvoiceExchangeRateSync, InvoiceNoSyncSettingsToForm } from './components';
|
||||||
InvoiceExchangeRateSync,
|
|
||||||
InvoiceNoSyncSettingsToForm,
|
|
||||||
} from './components';
|
|
||||||
import { DialogsName } from '@/constants/dialogs';
|
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice form.
|
* Invoice form.
|
||||||
*/
|
*/
|
||||||
function InvoiceForm({
|
function InvoiceForm({
|
||||||
// #withDialogActions
|
|
||||||
openDialog,
|
|
||||||
|
|
||||||
// #withSettings
|
// #withSettings
|
||||||
invoiceNextNumber,
|
invoiceNextNumber,
|
||||||
invoiceNumberPrefix,
|
invoiceNumberPrefix,
|
||||||
@@ -119,7 +111,7 @@ function InvoiceForm({
|
|||||||
from_estimate_id: estimateId,
|
from_estimate_id: estimateId,
|
||||||
};
|
};
|
||||||
// Handle the request success.
|
// Handle the request success.
|
||||||
const onSuccess = (res) => {
|
const onSuccess = () => {
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: intl.get(
|
message: intl.get(
|
||||||
isNewMode
|
isNewMode
|
||||||
@@ -131,11 +123,6 @@ function InvoiceForm({
|
|||||||
});
|
});
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
|
|
||||||
if (submitPayload.deliverViaMail) {
|
|
||||||
openDialog(DialogsName.InvoiceFormMailDeliver, {
|
|
||||||
invoiceId: res.data.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (submitPayload.redirect) {
|
if (submitPayload.redirect) {
|
||||||
history.push('/invoices');
|
history.push('/invoices');
|
||||||
}
|
}
|
||||||
@@ -214,5 +201,4 @@ export default compose(
|
|||||||
invoiceTermsConditions: invoiceSettings?.termsConditions,
|
invoiceTermsConditions: invoiceSettings?.termsConditions,
|
||||||
})),
|
})),
|
||||||
withCurrentOrganization(),
|
withCurrentOrganization(),
|
||||||
withDialogActions,
|
|
||||||
)(InvoiceForm);
|
)(InvoiceForm);
|
||||||
|
|||||||
@@ -34,20 +34,12 @@ import {
|
|||||||
transformFormValuesToRequest,
|
transformFormValuesToRequest,
|
||||||
resetFormState,
|
resetFormState,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import {
|
import { ReceiptSyncAutoExRateToForm, ReceiptSyncIncrementSettingsToForm } from './components';
|
||||||
ReceiptSyncAutoExRateToForm,
|
|
||||||
ReceiptSyncIncrementSettingsToForm,
|
|
||||||
} from './components';
|
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|
||||||
import { DialogsName } from '@/constants/dialogs';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receipt form.
|
* Receipt form.
|
||||||
*/
|
*/
|
||||||
function ReceiptForm({
|
function ReceiptForm({
|
||||||
// #withDialogActions
|
|
||||||
openDialog,
|
|
||||||
|
|
||||||
// #withSettings
|
// #withSettings
|
||||||
receiptNextNumber,
|
receiptNextNumber,
|
||||||
receiptNumberPrefix,
|
receiptNumberPrefix,
|
||||||
@@ -92,7 +84,10 @@ function ReceiptForm({
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
// Handle the form submit.
|
// Handle the form submit.
|
||||||
const handleFormSubmit = (values, { setErrors, setSubmitting }) => {
|
const handleFormSubmit = (
|
||||||
|
values,
|
||||||
|
{ setErrors, setSubmitting, resetForm },
|
||||||
|
) => {
|
||||||
const entries = values.entries.filter(
|
const entries = values.entries.filter(
|
||||||
(item) => item.item_id && item.quantity,
|
(item) => item.item_id && item.quantity,
|
||||||
);
|
);
|
||||||
@@ -129,11 +124,6 @@ function ReceiptForm({
|
|||||||
if (submitPayload.resetForm) {
|
if (submitPayload.resetForm) {
|
||||||
resetFormState();
|
resetFormState();
|
||||||
}
|
}
|
||||||
if (submitPayload.deliverMail) {
|
|
||||||
openDialog(DialogsName.ReceiptFormMailDeliver, {
|
|
||||||
receiptId: response.data.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle the request error.
|
// Handle the request error.
|
||||||
@@ -189,7 +179,6 @@ function ReceiptForm({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withDialogActions,
|
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withSettings(({ receiptSettings }) => ({
|
withSettings(({ receiptSettings }) => ({
|
||||||
receiptNextNumber: receiptSettings?.nextNumber,
|
receiptNextNumber: receiptSettings?.nextNumber,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default function ReceiptFormFloatingActions() {
|
|||||||
|
|
||||||
// Handle submit & close button click.
|
// Handle submit & close button click.
|
||||||
const handleSubmitCloseBtnClick = (event) => {
|
const handleSubmitCloseBtnClick = (event) => {
|
||||||
setSubmitPayload({ redirect: false, deliverMail: true, status: true });
|
setSubmitPayload({ redirect: true, status: true });
|
||||||
submitForm();
|
submitForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user