Share a composite modification nested in another composite - #4192
Share a composite modification nested in another composite#4192flomillot wants to merge 1 commit into
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>
|
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 selected for processing (3)
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 checks sharing eligibility through a study-server query before enabling shared saving. The network modification editor passes selected modifications and save handlers to the new dialog. ChangesNetwork modification sharing
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant NetworkModificationNodeEditor
participant SaveNetworkModificationsDialog
participant StudyNetworkModificationsService
participant StudyServer
NetworkModificationNodeEditor->>SaveNetworkModificationsDialog: open with selected modifications and handlers
SaveNetworkModificationsDialog->>StudyNetworkModificationsService: check composite UUID
StudyNetworkModificationsService->>StudyServer: GET contains-shared-modification
StudyServer-->>StudyNetworkModificationsService: return boolean
StudyNetworkModificationsService-->>SaveNetworkModificationsDialog: return sharing status
SaveNetworkModificationsDialog-->>NetworkModificationNodeEditor: enable or disable shared save
Merge Risk: ⚪ Minimal · up to This change enables nested composite sharing while keeping shared saving disabled when eligibility cannot be confirmed. The current implementation shows no concrete merge-blocking correctness or availability risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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
| 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



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 sharing logic moves out of the node editor into a dedicated
SaveNetworkModificationsDialogwrappingElementSaveDialog.Requires gridsuite/study-server#1089 and gridsuite/commons-ui#1336.