Skip to content

fix: add title for maximum and minimum additional inputs - #230

Merged
smarcet merged 1 commit into
OpenStackweb:mainfrom
priscila-moneo:fix/add-title-maximum-minimum-additional-inputs
May 4, 2026
Merged

fix: add title for maximum and minimum additional inputs#230
smarcet merged 1 commit into
OpenStackweb:mainfrom
priscila-moneo:fix/add-title-maximum-minimum-additional-inputs

Conversation

@priscila-moneo

@priscila-moneo priscila-moneo commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

ref: https://app.clickup.com/t/86b8ejhum

fntechgit/summit-admin#884

image

Summary by CodeRabbit

  • New Features
    • Quantity inputs now show localized "Minimum" and "Maximum" labels and streamlined placeholder text for clarity.
    • Improved accessibility for quantity fields with explicit identifiers, enhancing form interaction and screen reader support.

@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d559ff8a-28df-4b13-b22f-c7529a968919

📥 Commits

Reviewing files that changed from the base of the PR and between 4772506 and 9be4aa0.

📒 Files selected for processing (2)
  • src/components/mui/formik-inputs/additional-input/additional-input.js
  • src/i18n/en.json
✅ Files skipped from review due to trivial changes (1)
  • src/i18n/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/mui/formik-inputs/additional-input/additional-input.js

📝 Walkthrough

Walkthrough

For currentType === "Quantity", the minimum and maximum quantity Formik fields receive explicit id values via buildFieldName(...), translated label props are added to their MuiFormikTextField components, and placeholder translations are reformatted to single-line expressions. Two i18n entries for these labels were added.

Changes

Cohort / File(s) Summary
Component
src/components/mui/formik-inputs/additional-input/additional-input.js
Adds explicit id attributes for minimum_quantity/maximum_quantity via buildFieldName(...), supplies translated label props to MuiFormikTextField, and refactors placeholder translations to single-line expressions.
Internationalization
src/i18n/en.json
Adds additional_inputs.minimum ("Minimum") and additional_inputs.maximum ("Maximum") localization entries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped in with a twitchy nose,
Gave labels names where data flows,
IDs and labels side by side,
Minimum, Maximum take the stride,
Accessibility — a bunny's prose.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding labels/titles for the minimum and maximum additional input fields by introducing i18n entries and updating the component to use these translated labels.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/mui/formik-inputs/additional-input/additional-input.js (1)

136-136: Remove redundant InputLabelProps props—these have no effect since no label is passed.

MuiFormikTextField forwards InputLabelProps via ...props to the underlying TextField, but because no label prop is provided at these callsites, finalLabel is an empty string. MUI's TextField does not render the InputLabel component when label is empty, making InputLabelProps={{ 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

📥 Commits

Reviewing files that changed from the base of the PR and between 373c59f and 4772506.

📒 Files selected for processing (2)
  • src/components/mui/formik-inputs/additional-input/additional-input.js
  • src/i18n/en.json

Comment thread src/i18n/en.json
@priscila-moneo
priscila-moneo force-pushed the fix/add-title-maximum-minimum-additional-inputs branch from 4772506 to 125560a Compare April 28, 2026 22:31
/>
</Grid2>
<Grid2 size={4}>
<InputLabel htmlFor={buildFieldName("maximum_quantity")}>{T.translate("additional_inputs.maximum")}</InputLabel>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MuiFormikTextField has a label prop, can't we use that ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right! Thank you! Already updated it.

@priscila-moneo
priscila-moneo force-pushed the fix/add-title-maximum-minimum-additional-inputs branch from 125560a to 9be4aa0 Compare April 29, 2026 15:15

@santipalenque santipalenque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarcet smarcet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarcet
smarcet merged commit ee25c9d into OpenStackweb:main May 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants