-
Notifications
You must be signed in to change notification settings - Fork 78
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
LF-3761: Implement crop sales expandable content #2938
LF-3761: Implement crop sales expandable content #2938
Conversation
6272d69
to
f096918
Compare
f096918
to
49bbd1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's working/looking great! 🎉
let quantityTotal = items.reduce((total, { quantity }) => total + quantity, 0); | ||
quantityTotal += ` ${quantityUnit}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT, but I'd probably keep quantityTotal
a constant and make the following line another const named something like quantityWithUnit
to make it a bit easier to read and make both immutable
@@ -42,7 +43,7 @@ | |||
border-radius: 1px; | |||
} | |||
|
|||
&:hover { | |||
&:hover:not(.expanded) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda liked the hover effect on the expanded item because it showcases more clearly that the item can be clicked on to collapse, but not sure if Figma calls for anything specific in this situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll confirm with Loïc!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loïc's input:
It should not change colour on hover when the row is expanded, the reason is that it can be distracting when you process the info inside the expanded row.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! I just saw one mobile view issue when I was trying to investigate the right way to use shouldFixTableLayout
.
Edit: Sorry I didn't realize that my branch was out of date! I think you fixed this exact thing last night!
Also I noticed one bug -- code isn't from this PR, but the functionality is:
const componentKey = typeLabel === 'Crop Sale' ? 'CROP_SALE' : transactionType;
typeLabel
is translated so this will only work in English. But maybe the componentKeys are due to be revisited in the next PR? I think association of custom crop-associated revenues with this table still has to be set up too, is that right?
packages/webapp/src/components/Finances/Transaction/ExpandedContent/CropSaleTable.jsx
Outdated
Show resolved
Hide resolved
* add cropGenerated to crop sale transaction
* fix amount format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing!
All comments should be addressed, and I fixed the transaction amount format ⬇️ to be "XXX.XX".
Also, I updated mapSalesToRevenueItems
to fix the bug Joyce found, and the test file has also been updated.
Re-review would be appreciated, thank you!
association of custom crop-associated revenues with this table still has to be set up too
True...! Thank you so much for catching this!!! I added cropGenerated
to the transaction!
packages/webapp/src/components/Finances/Transaction/ExpandedContent/CropSaleTable.jsx
Outdated
Show resolved
Hide resolved
@@ -42,7 +43,7 @@ | |||
border-radius: 1px; | |||
} | |||
|
|||
&:hover { | |||
&:hover:not(.expanded) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll confirm with Loïc!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a bit nervous when I noticed transactions weren't storing crop_generated
but you fixed everything so easily!! Looks great!
Description
CropSale
transaction tablemobileView
currencySymbol
toExpandedContent
(mobileView
is for the future, and the style for the desktop view will not be shown and has not been finalized)Some other improvements
ExpandableItem
'skey
. (index
was being used, and it was expanding a different transaction after the date range is updated)h4
(the title of the page "Finances" ish3
so I choseh4
)Jira link: https://lite-farm.atlassian.net/browse/LF-3761
Type of change
How Has This Been Tested?
Checklist: