fix: add title for maximum and minimum additional inputs - #230
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughFor Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/components/mui/formik-inputs/additional-input/additional-input.js (1)
136-136: Remove redundantInputLabelPropsprops—these have no effect since nolabelis passed.
MuiFormikTextFieldforwardsInputLabelPropsvia...propsto the underlyingTextField, but because nolabelprop is provided at these callsites,finalLabelis an empty string. MUI'sTextFielddoes not render theInputLabelcomponent whenlabelis empty, makingInputLabelProps={{ shrink: true }}ineffective and safe to remove.Also applies to: 148-148
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/mui/formik-inputs/additional-input/additional-input.js` at line 136, Remove the redundant InputLabelProps={{ shrink: true }} prop from the places where MuiFormikTextField is instantiated in this AdditionalInput component: because no label prop is passed (finalLabel is empty) the MUI TextField won’t render an InputLabel and these props have no effect; locate the MuiFormikTextField usages in additional-input.js (the two callsites passing InputLabelProps) and delete the InputLabelProps={{ shrink: true }} entries so props are not forwarded unnecessarily.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/i18n/en.json`:
- Around line 82-83: Add the missing JSON keys additional_inputs.minimum and
additional_inputs.maximum to the non-English locale files under the existing
additional_inputs object; use appropriate Spanish/Chinese translations or, if
uncertain, use the English strings "Minimum" and "Maximum" as placeholders so
the keys exist and match the en.json structure.
---
Nitpick comments:
In `@src/components/mui/formik-inputs/additional-input/additional-input.js`:
- Line 136: Remove the redundant InputLabelProps={{ shrink: true }} prop from
the places where MuiFormikTextField is instantiated in this AdditionalInput
component: because no label prop is passed (finalLabel is empty) the MUI
TextField won’t render an InputLabel and these props have no effect; locate the
MuiFormikTextField usages in additional-input.js (the two callsites passing
InputLabelProps) and delete the InputLabelProps={{ shrink: true }} entries so
props are not forwarded unnecessarily.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 693dd2f9-6e60-40a7-b4a0-1f357544f9a7
📒 Files selected for processing (2)
src/components/mui/formik-inputs/additional-input/additional-input.jssrc/i18n/en.json
4772506 to
125560a
Compare
| /> | ||
| </Grid2> | ||
| <Grid2 size={4}> | ||
| <InputLabel htmlFor={buildFieldName("maximum_quantity")}>{T.translate("additional_inputs.maximum")}</InputLabel> |
There was a problem hiding this comment.
MuiFormikTextField has a label prop, can't we use that ?
There was a problem hiding this comment.
You are right! Thank you! Already updated it.
125560a to
9be4aa0
Compare
ref: https://app.clickup.com/t/86b8ejhum
fntechgit/summit-admin#884
Summary by CodeRabbit