forked from OpenStackweb/summit-admin
-
Notifications
You must be signed in to change notification settings - Fork 4
fix: adjust format on form items from inventary popup #817
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 952
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 969
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 407
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 4975
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 6308
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 137
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 7049
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 2200
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 609
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 1096
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 48
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 2775
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 48
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 437
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 48
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 768
🏁 Script executed:
# Look at the reducer file that uses amountFromCents head -20 src/reducers/sponsors_inventory/inventory-item-reducer.jsRepository: fntechgit/summit-admin
Length of output: 933
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 1314
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 80
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 229
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 2561
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 1556
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 1192
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 1581
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 1126
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 48
🏁 Script executed:
# Check if inventory-item-list-reducer should be importing and using amountFromCents head -25 src/reducers/sponsors_inventory/inventory-item-list-reducer.jsRepository: fntechgit/summit-admin
Length of output: 1048
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 373
🏁 Script executed:
Repository: fntechgit/summit-admin
Length of output: 48
Fix the rate field transformation in the reducer, not the component.
The
inventory-item-list-reducer.jsis missing the rate field transformation that other similar reducers apply. When inventory items are received from the API (lines 87-89), theearly_bird_rate,standard_rate, andonsite_ratefields should be transformed in the reducer—not in the component's render function.Compare with
sponsor-customized-form-items-list-reducer.js(lines 95-97), which correctly applies the transformation at the reducer level. The component render functions should receive already-formatted data.Update
src/reducers/sponsors_inventory/inventory-item-list-reducer.jsto importcurrencyAmountFromCentsand transform the rate fields in theRECEIVE_INVENTORY_ITEMScase:Then remove the formatting calls from the component's render functions (lines 126, 134, 142) and render the values directly.
🧰 Tools
🪛 GitHub Actions: jest
[error] 126-126: cents must be an integer number. Error originates from money.js when rendering currency via currencyAmountFromCents(row.early_bird_rate). Likely a non-integer value is being passed to currency formatter during inventory popup render.
🤖 Prompt for AI Agents