feat: handle p and q measurement modification in battery modification…#3949
feat: handle p and q measurement modification in battery modification…#3949KoloMenek wants to merge 1 commit into
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR extends battery modification dialogs to capture state estimation measurement data for active and reactive power. It updates type contracts, adds a new measurements UI section, and wires form initialization, validation, editing, and submission to handle the measurement fields through the backend API. ChangesBattery State Estimation Measurements
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/dialogs/network-modifications/battery/modification/battery-modification-dialog.tsx (1)
62-63: ⚡ Quick winUse one constant source for measurement keys (
FieldConstants)Schema/types in this PR define measurement paths with
FieldConstants.MEASUREMENT_P/Q, but submit mapping reads withMEASUREMENT_P/Qfrom another constants module. Unifying this avoids silent key drift.Proposed patch
-import { MEASUREMENT_P, MEASUREMENT_Q, VALIDITY } from '../../../../utils/field-constants'; +import { VALIDITY } from '../../../../utils/field-constants'; @@ pMeasurementValue: toModificationOperation( - stateEstimationData?.[MEASUREMENT_P]?.[FieldConstants.VALUE] + stateEstimationData?.[FieldConstants.MEASUREMENT_P]?.[FieldConstants.VALUE] ), - pMeasurementValidity: toModificationOperation(stateEstimationData?.[MEASUREMENT_P]?.[VALIDITY]), + pMeasurementValidity: toModificationOperation( + stateEstimationData?.[FieldConstants.MEASUREMENT_P]?.[VALIDITY] + ), qMeasurementValue: toModificationOperation( - stateEstimationData?.[MEASUREMENT_Q]?.[FieldConstants.VALUE] + stateEstimationData?.[FieldConstants.MEASUREMENT_Q]?.[FieldConstants.VALUE] ), - qMeasurementValidity: toModificationOperation(stateEstimationData?.[MEASUREMENT_Q]?.[VALIDITY]), + qMeasurementValidity: toModificationOperation( + stateEstimationData?.[FieldConstants.MEASUREMENT_Q]?.[VALIDITY] + ),Also applies to: 322-329
🤖 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/components/dialogs/network-modifications/battery/modification/battery-modification-dialog.tsx` around lines 62 - 63, The submit mapping in BatteryModificationDialog is using MEASUREMENT_P and MEASUREMENT_Q from a different constants module instead of the canonical FieldConstants used by your schema/types; update the code to import and use FieldConstants.MEASUREMENT_P and FieldConstants.MEASUREMENT_Q (and the VALIDITY key from FieldConstants if present) everywhere in this file—specifically in the submit/mapping logic (e.g., the function that builds the submission payload or handleSubmit) so the same FieldConstants keys are the single source of truth and avoid key drift.
🤖 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.
Nitpick comments:
In
`@src/components/dialogs/network-modifications/battery/modification/battery-modification-dialog.tsx`:
- Around line 62-63: The submit mapping in BatteryModificationDialog is using
MEASUREMENT_P and MEASUREMENT_Q from a different constants module instead of the
canonical FieldConstants used by your schema/types; update the code to import
and use FieldConstants.MEASUREMENT_P and FieldConstants.MEASUREMENT_Q (and the
VALIDITY key from FieldConstants if present) everywhere in this
file—specifically in the submit/mapping logic (e.g., the function that builds
the submission payload or handleSubmit) so the same FieldConstants keys are the
single source of truth and avoid key drift.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ff5fd8d4-ce21-4f22-9205-3291692c30f9
📒 Files selected for processing (4)
src/components/dialogs/network-modifications/battery/battery-dialog.type.tssrc/components/dialogs/network-modifications/battery/modification/BatteryDialogTabsContent.tsxsrc/components/dialogs/network-modifications/battery/modification/battery-modification-dialog.tsxsrc/services/network-modification-types.ts
… dialog Signed-off-by: Kamil MARUT <kamil.marut@rte-france.com>
cd5b181 to
e163e7a
Compare
|



… dialog
PR Summary