add computation quotas per study#189
Conversation
Signed-off-by: Etienne LESOT <etienne.lesot@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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughProfile modification now stores quotas in ChangesUser Quota Expansion
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
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 |
| <FormattedMessage id={'profiles.form.modification.userQuotas'} /> | ||
| </h3> | ||
| </Grid> | ||
| <Grid item xs={12} style={{ paddingTop: 0 }}> |
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/pages/profiles/modification/profile-modification-dialog.tsx (1)
110-124: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winUse
MAX_ALLOWED_*constants when buildingmaxAllowValues.This object duplicates literal key strings already exported as constants, which makes submit/reset contracts easier to drift.
♻️ Suggested refactor
const maxAllowValues = { - maxAllowedCases: profileFormData[USER_QUOTA_CASE_NB], - maxAllowedBuilds: profileFormData[USER_QUOTA_BUILD_NB], - maxAllowedLoadflow: profileFormData[USER_QUOTA_LOADFLOW_NB], - maxAllowedSecurity: profileFormData[USER_QUOTA_SECURITY_NB], - maxAllowedSensitivity: profileFormData[USER_QUOTA_SENSITIVITY_NB], - maxAllowedShortCircuit: profileFormData[USER_QUOTA_SHORTCIRCUIT_NB], - maxAllowedVoltageInit: profileFormData[USER_QUOTA_VOLTAGE_INIT_NB], - maxAllowedPccMin: profileFormData[USER_QUOTA_PCC_MIN_NB], - maxAllowedStateEstimation: profileFormData[USER_QUOTA_STATE_ESTIMATION_NB], - maxAllowedBalanceAdjustement: profileFormData[USER_QUOTA_BALANCE_ADJUSTEMENT_NB], - maxAllowedDynamicSimulation: profileFormData[USER_QUOTA_DYNAMIC_SIMULATION_INIT_NB], - maxAllowedDynamicSecurity: profileFormData[USER_QUOTA_DYNAMIC_SECURITY_INIT_NB], - maxAllowedDynamicMargin: profileFormData[USER_QUOTA_DYNAMIC_MARGIN_INIT_NB], + [MAX_ALLOWED_CASES]: profileFormData[USER_QUOTA_CASE_NB], + [MAX_ALLOWED_BUILD]: profileFormData[USER_QUOTA_BUILD_NB], + [MAX_ALLOWED_LOADFLOW]: profileFormData[USER_QUOTA_LOADFLOW_NB], + [MAX_ALLOWED_SECURITY]: profileFormData[USER_QUOTA_SECURITY_NB], + [MAX_ALLOWED_SENSITIVITY]: profileFormData[USER_QUOTA_SENSITIVITY_NB], + [MAX_ALLOWED_SHORT_CIRCUIT]: profileFormData[USER_QUOTA_SHORTCIRCUIT_NB], + [MAX_ALLOWED_VOLTAGE_INIT]: profileFormData[USER_QUOTA_VOLTAGE_INIT_NB], + [MAX_ALLOWED_PCC_MIN]: profileFormData[USER_QUOTA_PCC_MIN_NB], + [MAX_ALLOWED_STATE_ESTIMATION]: profileFormData[USER_QUOTA_STATE_ESTIMATION_NB], + [MAX_ALLOWED_BALANCE_ADJUSTEMENT]: profileFormData[USER_QUOTA_BALANCE_ADJUSTEMENT_NB], + [MAX_ALLOWED_DYNAMIC_SIMULATION]: profileFormData[USER_QUOTA_DYNAMIC_SIMULATION_INIT_NB], + [MAX_ALLOWED_DYNAMIC_SECURITY]: profileFormData[USER_QUOTA_DYNAMIC_SECURITY_INIT_NB], + [MAX_ALLOWED_DYNAMIC_MARGIN]: profileFormData[USER_QUOTA_DYNAMIC_MARGIN_INIT_NB], };🤖 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/pages/profiles/modification/profile-modification-dialog.tsx` around lines 110 - 124, The maxAllowValues object in profile-modification-dialog.tsx is using hardcoded literal strings as keys (maxAllowedCases, maxAllowedBuilds, etc.) which can drift from contracts used in submit and reset handlers. Replace each literal key name with the corresponding MAX_ALLOWED_* constant that should already be exported. For example, the key maxAllowedCases should be replaced with the MAX_ALLOWED_CASES constant, maxAllowedBuilds with MAX_ALLOWED_BUILDS, and so on for all keys in the maxAllowValues object definition.
🤖 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/pages/profiles/modification/profile-modification-dialog.tsx`:
- Around line 188-193: The form reset mapping has swapped quota keys where
USER_QUOTA_PCC_MIN_NB is incorrectly mapped from MAX_ALLOWED_VOLTAGE_INIT and
USER_QUOTA_VOLTAGE_INIT_NB is incorrectly mapped from MAX_ALLOWED_PCC_MIN. Fix
this by swapping the values so that USER_QUOTA_PCC_MIN_NB maps to
MAX_ALLOWED_PCC_MIN and USER_QUOTA_VOLTAGE_INIT_NB maps to
MAX_ALLOWED_VOLTAGE_INIT, ensuring the correct quota values are loaded and
persisted.
---
Nitpick comments:
In `@src/pages/profiles/modification/profile-modification-dialog.tsx`:
- Around line 110-124: The maxAllowValues object in
profile-modification-dialog.tsx is using hardcoded literal strings as keys
(maxAllowedCases, maxAllowedBuilds, etc.) which can drift from contracts used in
submit and reset handlers. Replace each literal key name with the corresponding
MAX_ALLOWED_* constant that should already be exported. For example, the key
maxAllowedCases should be replaced with the MAX_ALLOWED_CASES constant,
maxAllowedBuilds with MAX_ALLOWED_BUILDS, and so on for all keys in the
maxAllowValues object definition.
🪄 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: 2f13b447-6e65-41ed-a590-0f1373d11e01
📒 Files selected for processing (5)
src/pages/profiles/modification/profile-modification-dialog.tsxsrc/pages/profiles/modification/profile-modification-form.tsxsrc/services/user-admin.tssrc/translations/en.jsonsrc/translations/fr.json
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
|



PR Summary