Fix reset as parameters with contingencies#1071
Conversation
|
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)
📝 WalkthroughWalkthroughTwo tweaks refine contingency-list handling: the contingency-table useEffect now treats lists with only empty CONTINGENCY_LISTS entries as "no contingencies" and avoids fetching counts, setting simulatedContingencyCount to null; the security-analysis transformer now supplies an empty array (not undefined) when contingency infos are missing. Changes
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 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 |
…ix_reset_as_parameters_with_contingencies
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/components/parameters/common/contingency-table/contingency-table.tsx`:
- Around line 47-50: The current guard in the useEffect reads
contingencyListsInfos[0][CONTINGENCY_LISTS].length without checking that
CONTINGENCY_LISTS exists, which can throw if that key is undefined; update the
condition to safely handle missing or non-array CONTINGENCY_LISTS (e.g., use
optional chaining and Array.isArray checks or a check like
contingencyListsInfos.every(row => Array.isArray(row[CONTINGENCY_LISTS]) &&
row[CONTINGENCY_LISTS].length === 0)) so the guard treats rows with undefined
CONTINGENCY_LISTS as empty and avoids accessing .length on undefined; locate the
check around contingencyListsInfos and CONTINGENCY_LISTS in the
contingency-table component's useEffect and replace it with the safe form.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 68bf4ac5-b9dc-425f-a258-7fc4ff443efc
📒 Files selected for processing (2)
src/components/parameters/common/contingency-table/contingency-table.tsxsrc/components/parameters/security-analysis/columns-definitions.ts
src/components/parameters/common/contingency-table/contingency-table.tsx
Outdated
Show resolved
Hide resolved
…ix_reset_as_parameters_with_contingencies
|



PR Summary