-
Notifications
You must be signed in to change notification settings - Fork 103
LF-5274 Add animal batch selector with quantity and sale value to the revenue entry form #4170
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
Open
kathyavini
wants to merge
37
commits into
integration
Choose a base branch
from
LF-5274-add-animal-batch-selector-with-quantity-and-sale-value-to-the-revenue-entry-form
base: integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 32 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
9b6319a
LF-5274 Step 17: Add AnimalSaleItem component
kathyavini da269b4
LF-5274 Step 21: Add ANIMAL_SALE and ANIMAL_KEY constants
kathyavini 1e90431
LF-5274 Step 18: Add AnimalSaleInputs container
kathyavini c820543
LF-5274 Step 19: Add RevenueSaleInputs dispatcher; rename EntitySaleI…
kathyavini 9f99348
LF-5274 Step 20: Add animal branches to util.js
kathyavini 779bc71
LF-5274 Step 22: Wire RevenueDetail to RevenueSaleInputs
kathyavini c2cb54a
LF-5274 Step 23: Wire AddSale to RevenueSaleInputs; unblock ANIMAL_SA…
kathyavini 7469dbb
LF-5274 Step 24: Add animalRevenue transaction type
kathyavini 154d2ac
LF-5274 Step 31: Add ANIMAL_SALE revenue translation keys
kathyavini b235e9d
LF-5274 Register ANIMAL_SALE into iconMap
kathyavini 781aa96
LF-5274 Update GeneralRevenue and EntitySaleRows according to Figma
kathyavini 9dea14f
LF-5274 Revert the EntitySaleInputs to EntitySaleRows rename
kathyavini cde473a
LF-5274 Rename RevenueSaleInputs
kathyavini f0fc254
LF-5274 Rename and reorganization of components
kathyavini a88f221
LF-5274 Clean up and update Story
kathyavini ca95e6b
LF-5274 Put child components directly into Revenue Form
kathyavini 843ed58
LF-5274 Expand CropSaleTable into general EntitySaleTable
kathyavini b9edf3e
LF-5274 Remove max character part from notes placeholder and match ma…
kathyavini 180af06
LF-5274 Restore customFormChildren and let containers own ternaries
kathyavini f6d423f
LF-5274 Map-based solution to type switching
kathyavini a2f8c1a
LF-5274 Fix select placeholders
kathyavini fd472c7
LF-5274 Refactor animal and batch formatting functions to use existin…
kathyavini 241e57c
LF-5274 Refactor getAnimalSaleDefaultValues
kathyavini 5b67340
LF-5274 Restore EntitySaleInputs wrapper component (sigh)
kathyavini b7d99d9
LF-5274 Pass animals and batches to ActualRevenue formatting function
kathyavini 1c241ae
LF-5274 Update footer of EntitySaleTable as discussed
kathyavini 1692236
LF-5274 Minor string cleanup
kathyavini c9d9701
LF-5274 Clean up RevenueForm stylesheet; lots of unused classes here
kathyavini a5ce471
LF-5274 Rename customFormChildrenDefaultValues and fix story
kathyavini f826c44
LF-5274 Add missing label to the entity select; match Animal Sale des…
kathyavini 296565c
LF-5274 Remove unused REVENUE_FORM_TYPE and getRevenueFormType
kathyavini b45719e
LF-5274 Rename EntitySaleEntries to EntitySalePicker
kathyavini 2443b18
LF-5274 Minor cleanup and string fix
kathyavini cd6a2dc
LF-5274 Fix circular Redux store import causing Storybook crash
kathyavini a5e5df7
LF-5274 Move selectors out of EntitySalePicker component
kathyavini 073fba6
Merge branch 'integration' into LF-5274-add-animal-batch-selector-wit…
kathyavini 82e86fb
LF-5274 Minor changes: copyright year formatting and more descriptive…
kathyavini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
129 changes: 0 additions & 129 deletions
129
packages/webapp/src/components/Forms/GeneralRevenue/styles.module.scss
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
packages/webapp/src/components/Forms/RevenueForm/AnimalSaleItem.tsx
This file contains hidden or 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,56 @@ | ||
| /* | ||
| * Copyright 2026 LiteFarm.org | ||
| * This file is part of LiteFarm. | ||
| * | ||
| * LiteFarm is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * LiteFarm is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| import { Semibold } from '../../Typography'; | ||
| import SaleLineItem from './SaleLineItem'; | ||
| import styles from './styles.module.scss'; | ||
|
|
||
| interface AnimalSaleItemProps { | ||
| animalName: string; | ||
| entityId: string; | ||
| system: string; | ||
| currency: string; | ||
| fieldPrefix: string; | ||
| entityIdFieldKey: string; | ||
| disabledInput: boolean; | ||
| } | ||
|
|
||
| function AnimalSaleItem({ | ||
| animalName, | ||
| entityId, | ||
| system, | ||
| currency, | ||
| fieldPrefix, | ||
| entityIdFieldKey, | ||
| disabledInput, | ||
| }: AnimalSaleItemProps) { | ||
| return ( | ||
| <div className={styles.saleItemContainer}> | ||
| <div className={styles.saleItemInputGroup}> | ||
| <Semibold>{animalName}</Semibold> | ||
| <SaleLineItem | ||
| fieldPrefix={fieldPrefix} | ||
| entityId={entityId} | ||
| entityIdFieldKey={entityIdFieldKey} | ||
| system={system} | ||
| currency={currency} | ||
| disabledInput={disabledInput} | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default AnimalSaleItem; |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
In addition to making the table general to both crops and animals by passing the column title, this PR removes the quantity sum and changes "DAILY TOTAL" --> "TOTAL" as discussed in dev-design.
Note: only the mobile view of this table is ever used in app (i.e. the footer is always defined by
<FooterCell>, and never by theFooterproperty ofgetColumns); therefore the changes to Footer here ingetColumnsare just for completeness; they don't have any visual effect in app.