-
Notifications
You must be signed in to change notification settings - Fork 9
4027-split-shipping #4091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
4027-split-shipping #4091
Changes from 3 commits
600f5e8
6bd8156
22c517c
fb24670
48ab7a2
973860c
c71b312
85f1e77
5e80484
e0b8416
4589589
de39dbb
e439b66
ccb8b51
d07cb16
f62338d
33301fe
6018636
00eb479
dd3e49a
ca8d479
90d67c5
71b94b6
8c377cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,7 @@ interface ReimbursementProductTableProps { | |
| firstRefundSourceName?: string; | ||
| secondRefundSourceName?: string; | ||
| allProjects: ProjectPreview[]; | ||
| applySplitShippingToProducts: (totalShipping?: number) => void; | ||
| } | ||
|
|
||
| const ListItem = styled('li')(({ theme }) => ({ | ||
|
|
@@ -156,7 +157,8 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({ | |
| firstRefundSourceName, | ||
| secondRefundSourceName, | ||
| watch, | ||
| allProjects | ||
| allProjects, | ||
| applySplitShippingToProducts | ||
| }) => { | ||
| const uniqueWbsElementsWithProducts = new Map< | ||
| string, | ||
|
|
@@ -181,6 +183,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({ | |
| setValue(`reimbursementProducts.${index}.refundSources`, [{ indexCode: firstRefundSourceIndexCode, amount: value }]); | ||
| } | ||
| }; | ||
| const totalShipping = watch('splitShipping'); | ||
|
|
||
| const userTheme = useTheme(); | ||
| const hoverColor = userTheme.palette.action.hover; | ||
|
|
@@ -409,6 +412,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({ | |
| cost: 0, | ||
| refundSources: [] | ||
| }); | ||
| setTimeout(() => applySplitShippingToProducts(Number(totalShipping)), 0); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use a callback instead of setTimeout |
||
| } | ||
| }} | ||
| value={null} | ||
|
|
@@ -434,6 +438,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({ | |
| cost: 0, | ||
| refundSources: [] | ||
| }); | ||
| setTimeout(() => applySplitShippingToProducts(Number(totalShipping)), 0); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too |
||
| } | ||
| }} | ||
| value={null} | ||
|
|
@@ -805,7 +810,10 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({ | |
| backgroundColor: hoverColor | ||
| } | ||
| }} | ||
| onClick={() => removeProduct(product.index)} | ||
| onClick={() => { | ||
| removeProduct(product.index); | ||
| setTimeout(() => applySplitShippingToProducts(Number(totalShipping)), 0); | ||
|
Steph375 marked this conversation as resolved.
Outdated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too |
||
| }} | ||
| > | ||
| <RemoveCircleOutline /> | ||
| </IconButton> | ||
|
|
@@ -840,6 +848,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({ | |
| cost: 0, | ||
| refundSources: [] | ||
| }); | ||
| setTimeout(() => applySplitShippingToProducts(Number(totalShipping)), 0); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too |
||
| } | ||
| e.currentTarget.blur(); | ||
| }} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.