-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webapp): showing up mail popup once saving invoice, receipt and …
…estimate
- Loading branch information
Showing
29 changed files
with
482 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...app/src/containers/Sales/Estimates/EstimateForm/Dialogs/EstimateFormMailDeliverDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// @ts-nocheck | ||
import React from 'react'; | ||
import { Dialog, DialogSuspense } from '@/components'; | ||
import withDialogRedux from '@/components/DialogReduxConnect'; | ||
import { compose } from '@/utils'; | ||
|
||
const EstimateFormMailDeliverDialogContent = React.lazy( | ||
() => import('./EstimateFormMailDeliverDialogContent'), | ||
); | ||
|
||
/** | ||
* Estimate mail dialog. | ||
*/ | ||
function EstimateFormMailDeliverDialog({ | ||
dialogName, | ||
payload: { estimateId = null }, | ||
isOpen, | ||
}) { | ||
return ( | ||
<Dialog | ||
name={dialogName} | ||
title={'Estimate Mail'} | ||
isOpen={isOpen} | ||
canEscapeJeyClose={false} | ||
isCloseButtonShown={false} | ||
autoFocus={true} | ||
style={{ width: 600 }} | ||
> | ||
<DialogSuspense> | ||
<EstimateFormMailDeliverDialogContent | ||
dialogName={dialogName} | ||
estimateId={estimateId} | ||
/> | ||
</DialogSuspense> | ||
</Dialog> | ||
); | ||
} | ||
|
||
export default compose(withDialogRedux())(EstimateFormMailDeliverDialog); |
40 changes: 40 additions & 0 deletions
40
.../containers/Sales/Estimates/EstimateForm/Dialogs/EstimateFormMailDeliverDialogContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// @ts-nocheck | ||
import * as R from 'ramda'; | ||
import withDialogActions from '@/containers/Dialog/withDialogActions'; | ||
import { useHistory } from 'react-router-dom'; | ||
import EstimateMailDialogContent from '../../EstimateMailDialog/EstimateMailDialogContent'; | ||
import { DialogsName } from '@/constants/dialogs'; | ||
|
||
interface EstimateFormDeliverDialogContent { | ||
estimateId: number; | ||
} | ||
|
||
function EstimateFormDeliverDialogContentRoot({ | ||
estimateId, | ||
|
||
// #withDialogActions | ||
closeDialog, | ||
}: EstimateFormDeliverDialogContent) { | ||
const history = useHistory(); | ||
|
||
const handleSubmit = () => { | ||
closeDialog(DialogsName.EstimateFormMailDeliver); | ||
history.push('/estimates'); | ||
}; | ||
const handleCancel = () => { | ||
closeDialog(DialogsName.EstimateFormMailDeliver); | ||
history.push('/estimates'); | ||
}; | ||
|
||
return ( | ||
<EstimateMailDialogContent | ||
estimateId={estimateId} | ||
onFormSubmit={handleSubmit} | ||
onCancelClick={handleCancel} | ||
/> | ||
); | ||
} | ||
|
||
export default R.compose(withDialogActions)( | ||
EstimateFormDeliverDialogContentRoot, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/webapp/src/containers/Sales/Estimates/EstimateMailDialog/EstimateMailDialogBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// @ts-nocheck | ||
import * as R from 'ramda'; | ||
import withDialogActions from '@/containers/Dialog/withDialogActions'; | ||
import EstimateMailDialogContent from './EstimateMailDialogContent'; | ||
import { DialogsName } from '@/constants/dialogs'; | ||
|
||
interface EstimateMailDialogBodyProps { | ||
estimateId: number; | ||
} | ||
|
||
function EstimateMailDialogBodyRoot({ | ||
estimateId, | ||
|
||
// #withDialogActions | ||
closeDialog, | ||
}: EstimateMailDialogBodyProps) { | ||
const handleSubmit = () => { | ||
closeDialog(DialogsName.EstimateMail); | ||
}; | ||
const handleCancelClick = () => { | ||
closeDialog(DialogsName.EstimateMail); | ||
}; | ||
|
||
return ( | ||
<EstimateMailDialogContent | ||
estimateId={estimateId} | ||
onFormSubmit={handleSubmit} | ||
onCancelClick={handleCancelClick} | ||
/> | ||
); | ||
} | ||
|
||
export default R.compose(withDialogActions)(EstimateMailDialogBodyRoot); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...nvoices/InvoiceForm/Dialogs/InvoiceFormMailDeliverDialog/InvoiceFormMailDeliverDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// @ts-nocheck | ||
import React from 'react'; | ||
import { Dialog, DialogSuspense } from '@/components'; | ||
import withDialogRedux from '@/components/DialogReduxConnect'; | ||
import { compose } from '@/utils'; | ||
|
||
const InvoiceFormMailDeliverDialogContent = React.lazy( | ||
() => import('./InvoiceFormMailDeliverDialogContent'), | ||
); | ||
|
||
/** | ||
* Invoice mail dialog. | ||
*/ | ||
function InvoiceFormMailDeliverDialog({ | ||
dialogName, | ||
payload: { invoiceId = null }, | ||
isOpen, | ||
}) { | ||
return ( | ||
<Dialog | ||
name={dialogName} | ||
title={'Invoice Mail'} | ||
isOpen={isOpen} | ||
canEscapeJeyClose={false} | ||
isCloseButtonShown={false} | ||
autoFocus={true} | ||
style={{ width: 600 }} | ||
> | ||
<DialogSuspense> | ||
<InvoiceFormMailDeliverDialogContent | ||
dialogName={dialogName} | ||
invoiceId={invoiceId} | ||
/> | ||
</DialogSuspense> | ||
</Dialog> | ||
); | ||
} | ||
|
||
export default compose(withDialogRedux())(InvoiceFormMailDeliverDialog); |
40 changes: 40 additions & 0 deletions
40
.../InvoiceForm/Dialogs/InvoiceFormMailDeliverDialog/InvoiceFormMailDeliverDialogContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// @ts-nocheck | ||
import * as R from 'ramda'; | ||
import { useHistory } from 'react-router-dom'; | ||
import InvoiceMailDialogContent from '../../../InvoiceMailDialog/InvoiceMailDialogContent'; | ||
import withDialogActions from '@/containers/Dialog/withDialogActions'; | ||
import { DialogsName } from '@/constants/dialogs'; | ||
|
||
interface InvoiceFormDeliverDialogContent { | ||
invoiceId: number; | ||
} | ||
|
||
function InvoiceFormDeliverDialogContentRoot({ | ||
invoiceId, | ||
|
||
// #withDialogActions | ||
closeDialog, | ||
}: InvoiceFormDeliverDialogContent) { | ||
const history = useHistory(); | ||
|
||
const handleSubmit = () => { | ||
history.push('/invoices'); | ||
closeDialog(DialogsName.InvoiceFormMailDeliver); | ||
}; | ||
const handleCancel = () => { | ||
history.push('/invoices'); | ||
closeDialog(DialogsName.InvoiceFormMailDeliver); | ||
}; | ||
|
||
return ( | ||
<InvoiceMailDialogContent | ||
invoiceId={invoiceId} | ||
onFormSubmit={handleSubmit} | ||
onCancelClick={handleCancel} | ||
/> | ||
); | ||
} | ||
|
||
export default R.compose(withDialogActions)( | ||
InvoiceFormDeliverDialogContentRoot, | ||
); |
Oops, something went wrong.