Share a composite modification nested in another composite - #4192
Conversation
The shared option of the save dialog is only enabled in developer mode, and stays disabled when the selected composite contains a shared modification, which the server is asked once the dialog is open. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe composite modification save flow now uses a dedicated dialog. The dialog validates sharing eligibility, checks nested shared references when needed, reports query errors, and passes save actions through the network modification editor. ChangesNetwork modification sharing
Sequence Diagram(s)sequenceDiagram
participant NetworkModificationEditor
participant SaveNetworkModificationsDialog
participant hasModificationReferences
participant StudyServer
NetworkModificationEditor->>SaveNetworkModificationsDialog: open with selected modifications
SaveNetworkModificationsDialog->>hasModificationReferences: query composite UUIDs
hasModificationReferences->>StudyServer: check nested shared references
StudyServer-->>hasModificationReferences: return shared-content result
hasModificationReferences-->>SaveNetworkModificationsDialog: set sharing eligibility
Suggested reviewers: Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The reviewed sharing-flow changes have no confirmed merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)
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 |
| } | ||
| }) | ||
| .catch((error) => { | ||
| console.error( |
There was a problem hiding this comment.
snackWithFallback(snackError, error, { headerId: 'errContainsSharedModificationMsg' });
| const url = `${PREFIX_STUDY_QUERIES}/v1/network-composite-modifications/${safeEncodeURIComponent( | ||
| compositeModificationUuid | ||
| )}/contains-shared-modification`; | ||
| console.debug(url); |
There was a problem hiding this comment.
console.debug(url); to be cleaned up maybe
There was a problem hiding this comment.
Its just how its done everywhere
| onSave={onSave} | ||
| onSaveShared={onSaveShared} | ||
| createSharedDisabled={!isSharingAvailable} | ||
| OnUpdate={onUpdate} |
There was a problem hiding this comment.
It would be better to use onUpdate instead of OnUpdate
There was a problem hiding this comment.
Yup but not my code
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
It brings the message of the modification.containsShared business error. Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
|



Follow-up of #4157.
The "New (shared)" option of the dialog saving modifications into GridExplore is now only enabled in developer mode — it stays visible but greyed out otherwise.
A composite modification nested in another composite of the node can now be shared, as long as it is not contained by an already shared composite. The option is also greyed out when the selected composite contains a shared modification, at any depth: since the table only loads the content of a composite as it is unfolded, the server is asked, once the dialog is open.
The saving logic moves out of the node editor into a dedicated
SaveNetworkModificationsDialogwrappingElementSaveDialog. A single server call there both warns that shared modifications are saved as a copy and greys out the sharing.Requires gridsuite/study-server#1089 and gridsuite/commons-ui#1336.