[WIP] add hvdc filter for electronics clusters#1111
Conversation
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
📝 WalkthroughWalkthroughThe pull request expands short-circuit ICC cluster functionality to support HVDC equipment types by adding Changes
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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.
🧹 Nitpick comments (1)
src/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.tsx (1)
48-48: Extract cluster type options to typed constants for improved maintainability.The hardcoded strings
['GENERATOR', 'HVDC']are already correctly aligned with the backend type definition (type: 'GENERATOR' | 'HVDC'inBasePowerElectronicsCluster). However, extracting these values to a typed constant would improve consistency and reduce duplication across the validation schema and UI component.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.tsx` at line 48, Replace the hardcoded array passed to the options prop in ShortCircuitIccClusterTableCell with a single exported, typed constant (e.g., CLUSTER_TYPES) and derive its TS type so UI and validation share the same source of truth; create something like export const CLUSTER_TYPES = ['GENERATOR','HVDC'] as const and export type ClusterType = typeof CLUSTER_TYPES[number], then import and use CLUSTER_TYPES in the options prop and where the BasePowerElectronicsCluster union type is referenced to remove duplication and keep types consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@src/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.tsx`:
- Line 48: Replace the hardcoded array passed to the options prop in
ShortCircuitIccClusterTableCell with a single exported, typed constant (e.g.,
CLUSTER_TYPES) and derive its TS type so UI and validation share the same source
of truth; create something like export const CLUSTER_TYPES =
['GENERATOR','HVDC'] as const and export type ClusterType = typeof
CLUSTER_TYPES[number], then import and use CLUSTER_TYPES in the options prop and
where the BasePowerElectronicsCluster union type is referenced to remove
duplication and keep types consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3114c9f0-5cf7-4bba-801c-e59d35a50723
📒 Files selected for processing (2)
src/components/parameters/short-circuit/columns-definition.tssrc/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.tsx
|
fix in #1130 |



PR Summary