Conversation
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
src/services/study/index.ts
Outdated
| return backendFetchJson(url); | ||
| } | ||
|
|
||
| export function insertCompositeModifications( |
There was a problem hiding this comment.
Minor tidbit, but since "insert" is one the two actions carried on by this function (insert and split) maybe the naming should also reflect that with a more englobing prefix ?
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
📝 WalkthroughWalkthroughThe changes refactor composite modification handling by introducing a dedicated Changes
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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/services/study/index.ts (1)
22-25: Decouple service-layer types from component-layer modules.
src/services/study/index.tsimporting fromcomponents/graph/.../network-modification-menu.typecreates an inverted dependency. Consider moving shared enums/interfaces (CompositeModificationAction,NetworkModificationCopyInfos) to a neutral shared/domain types module consumed by both layers.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/services/study/index.ts` around lines 22 - 25, The service layer is importing UI component types (CompositeModificationAction, NetworkModificationCopyInfos) which inverts dependencies; extract those shared enums/interfaces into a neutral shared/domain types module (e.g., a new shared-types or domain/types file), move the definitions of CompositeModificationAction and NetworkModificationCopyInfos there, update the import in the service module (src/services/study/index.ts) to import from the new shared module, and update the component that originally owned them to import from the same shared module so both layers depend on the neutral types instead of components.
🤖 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/services/study/index.ts`:
- Around line 22-25: The service layer is importing UI component types
(CompositeModificationAction, NetworkModificationCopyInfos) which inverts
dependencies; extract those shared enums/interfaces into a neutral shared/domain
types module (e.g., a new shared-types or domain/types file), move the
definitions of CompositeModificationAction and NetworkModificationCopyInfos
there, update the import in the service module (src/services/study/index.ts) to
import from the new shared module, and update the component that originally
owned them to import from the same shared module so both layers depend on the
neutral types instead of components.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bd0a139b-b59a-43ca-8ba9-637cbe71bd9a
📒 Files selected for processing (3)
src/components/dialogs/import-modification-dialog.tsxsrc/components/graph/menus/network-modifications/network-modification-menu.type.tssrc/services/study/index.ts



Separates the netmod move/copy functions from the composite insert functions.