Skip to content

chore(LineModification): use form from commons-UI#4083

Open
dbraquart wants to merge 5 commits into
mainfrom
dbraquart/use-line-modification-form-from-commons-UI
Open

chore(LineModification): use form from commons-UI#4083
dbraquart wants to merge 5 commits into
mainfrom
dbraquart/use-line-modification-form-from-commons-UI

Conversation

@dbraquart

@dbraquart dbraquart commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

PR Summary

We remove from grid-study what has been moved to commons-ui by gridsuite/commons-ui#1232.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dbraquart, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ea2ab6e-1582-407f-82b1-a30f84c4501e

📥 Commits

Reviewing files that changed from the base of the PR and between 15e7467 and 5e4814c.

📒 Files selected for processing (1)
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx
📝 Walkthrough

Walkthrough

This PR unifies line segment save handling through shared onSave and editData props, rewires line creation and modification dialogs, replaces modification form handling with shared schema and DTO utilities, updates modifyLine to accept a DTO, and removes obsolete tab, type, and translation entries.

Changes

Line segment and line modification flow

Layer / File(s) Summary
Line segment save contract
src/components/dialogs/line-types-catalog/line-type-segment-dialog.tsx, src/components/dialogs/line-types-catalog/line-type-segment-form.tsx
Replaces separate creation/modification callbacks and edit-data props with shared onSave and editData props, simplifying submission and segment-limit rebuilding.
Line creation dialog wiring
src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx
Builds memoized segment edit data and passes it through the unified dialog contract.
Line modification DTO form flow
src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx, src/components/dialogs/network-modifications/line/modification/line-modification-dialog-tabs.tsx
Uses shared line form schemas and DTO converters, rewrites equipment and segment handling, and replaces the tabbed content with LineForm and LineTypeSegmentDialog.
Line modification service contract
src/services/network-modification-types.ts, src/services/study/network-modifications.ts, src/translations/en.json, src/translations/fr.json
Removes the legacy line modification type, sends LineModificationDto directly through modifyLine, and removes obsolete translation keys.

Sequence Diagram(s)

sequenceDiagram
  participant LineForm
  participant LineTypeSegmentDialog
  participant LineModificationDialog
  participant modifyLine
  LineForm->>LineModificationDialog: form field updates
  LineTypeSegmentDialog->>LineModificationDialog: onSave(data, lineSegments, applyLimits)
  LineModificationDialog->>LineModificationDialog: merge segments and build DTO
  LineModificationDialog->>modifyLine: modifyLine(studyUuid, nodeUuid, modificationUuid, dto)
  modifyLine-->>LineModificationDialog: PUT or POST request result
Loading

Suggested reviewers: achour94, flomillot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: moving LineModification form logic to commons-ui.
Description check ✅ Passed The description is related to the PR and matches the removal of code that was moved to commons-ui.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dbraquart dbraquart force-pushed the dbraquart/use-line-modification-form-from-commons-UI branch 2 times, most recently from 7b7bad6 to d66e01e Compare July 8, 2026 13:49
Base automatically changed from dbraquart/use-line-creation-form-from-commons-UI to main July 9, 2026 14:04
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
@dbraquart dbraquart force-pushed the dbraquart/use-line-modification-form-from-commons-UI branch from d66e01e to 493d5d6 Compare July 9, 2026 15:19
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx`:
- Around line 24-57: The imports from `@gridsuite/commons-ui` in
`LineModificationDialog` reference line-modification symbols that are not
available in the currently published type declarations, so this will not
type-check. Either update the dependency to the version that exports
`lineModificationFormSchema`, `lineModificationEmptyFormData`,
`LineModificationFormData`, `lineModificationFormToDto`,
`lineModificationDtoToForm`, and `LineModificationDto`, or switch this dialog to
the older line-modification API and remove the unavailable imports.
🪄 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: 1d88b086-5afb-47ca-b75c-84d042c4e343

📥 Commits

Reviewing files that changed from the base of the PR and between e1e6467 and fcdced4.

📒 Files selected for processing (13)
  • src/components/dialogs/line-types-catalog/line-type-segment-dialog.tsx
  • src/components/dialogs/line-types-catalog/line-type-segment-form.tsx
  • src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx
  • src/components/dialogs/network-modifications/line/modification/line-dialog-tabs.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-header.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-tabs.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-type.ts
  • src/components/dialogs/network-modifications/line/modification/line-utils.ts
  • src/services/network-modification-types.ts
  • src/services/study/network-modifications.ts
  • src/translations/en.json
  • src/translations/fr.json
💤 Files with no reviewable changes (8)
  • src/components/dialogs/network-modifications/line/modification/line-modification-type.ts
  • src/components/dialogs/network-modifications/line/modification/line-dialog-tabs.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-header.tsx
  • src/components/dialogs/network-modifications/line/modification/line-utils.ts
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-tabs.tsx
  • src/translations/fr.json
  • src/services/network-modification-types.ts
  • src/translations/en.json

Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx`:
- Around line 176-178: Annotate the reset callback’s formValues parameter in the
line modification dialog with the same form-values type used by the typed
callback near Line 147, while preserving the existing spread, equipment ID
update, and keepDirty behavior.
🪄 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: a4cf6e0e-fe5d-4258-a843-b0a8fc587641

📥 Commits

Reviewing files that changed from the base of the PR and between 7e12d60 and 15e7467.

📒 Files selected for processing (2)
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx
  • src/components/dialogs/network-modifications/load/modification/load-modification-dialog.tsx

Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant