fix(BatteryCreation) : yup error messages issues#1131
Conversation
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSix form validation schemas across network modification modules are updated to apply consistent type error handling for numeric fields. Each imports ChangesNumeric field type error validation consistency
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/translations/fr/networkModificationsFr.ts (1)
213-213:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winVerify whether both
FieldIsRequiredandYUP_REQUIREDare needed.The new
FieldIsRequiredkey has the same message as the existingYUP_REQUIREDkey on line 136. This duplication could lead to maintenance issues if the message needs updating in the future.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/translations/fr/networkModificationsFr.ts` at line 213, There’s a duplicate French message defined under FieldIsRequired that matches the existing YUP_REQUIRED; decide on a single canonical key (prefer reusing YUP_REQUIRED) and remove the duplicate string: either delete the FieldIsRequired entry and update any code or components that reference FieldIsRequired to use YUP_REQUIRED, or keep FieldIsRequired but set it as an alias (assign it the value of YUP_REQUIRED) and update usages accordingly; ensure you update all references to the chosen key (FieldIsRequired or YUP_REQUIRED) so no lookup breaks and adjust any translation tests or snapshots that expect the removed key.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/translations/en/networkModificationsEn.ts`:
- Line 210: Remove the duplicate "FieldIsRequired" translation key and
consolidate all usages to the existing "YUP_REQUIRED" key; specifically, delete
the FieldIsRequired entry from the translations object and update the ~7 places
where the literal "FieldIsRequired" string or translation key is referenced to
instead reference YUP_REQUIRED (or translations.YUP_REQUIRED) so schemas and UI
use the single constant YUP_REQUIRED already imported across the codebase;
ensure imports/exports remain correct after removing FieldIsRequired and run
tests/lint to catch any leftover references.
---
Duplicate comments:
In `@src/translations/fr/networkModificationsFr.ts`:
- Line 213: There’s a duplicate French message defined under FieldIsRequired
that matches the existing YUP_REQUIRED; decide on a single canonical key (prefer
reusing YUP_REQUIRED) and remove the duplicate string: either delete the
FieldIsRequired entry and update any code or components that reference
FieldIsRequired to use YUP_REQUIRED, or keep FieldIsRequired but set it as an
alias (assign it the value of YUP_REQUIRED) and update usages accordingly;
ensure you update all references to the chosen key (FieldIsRequired or
YUP_REQUIRED) so no lookup breaks and adjust any translation tests or snapshots
that expect the removed key.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ada26bd0-cc18-46a0-9ec0-a52f7f83e2cc
📒 Files selected for processing (7)
src/components/network-modifications/battery/creation/batteryCreation.utils.tssrc/components/network-modifications/common/activePowerControl/activePowerControlForm.utils.tssrc/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.tssrc/components/network-modifications/common/reactiveLimits/reactiveLimits.utils.tssrc/components/network-modifications/common/shortCircuit/shortCircuitForm.utils.tssrc/translations/en/networkModificationsEn.tssrc/translations/fr/networkModificationsFr.ts
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
|



PR Summary
2 issues: