Creation of a composite inside a gridstudy node#3928
Open
Mathieu-Deharbe wants to merge 14 commits into
Open
Conversation
This comment was marked as spam.
This comment was marked as spam.
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
|
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/graph/menus/network-modifications/network-modification-node-editor.tsx (1)
969-973:⚠️ Potential issue | 🟠 Major | ⚡ Quick winGuard merge action when no active node is selected.
Line 972 sends
currentNode?.idto the merge API, but Line 1302-1307 does not disable the action whencurrentNodeis missing. With stale selection, this can dispatch a merge request with an undefined node id.🔧 Proposed fix
const doMergeModificationsIntoComposite = useCallback(() => { const selectedModUuids: UUID[] = selectedNetworkModifications.map((item) => item.uuid); + if (!studyUuid || !currentNode?.id || selectedModUuids.length === 0) { + return; + } setSaveInProgress(true); - mergeModificationsIntoComposite(studyUuid, currentNode?.id, selectedModUuids) + mergeModificationsIntoComposite(studyUuid, currentNode.id, selectedModUuids) .then((compositeUuid: UUID) => { dispatch(setHighlightModification(compositeUuid)); setSelectionResetKey((k) => k + 1); @@ <IconButton onClick={doMergeModificationsIntoComposite} size={'small'} disabled={ selectedNetworkModifications?.length === 0 || saveInProgress || + !currentNode || isRootNode || isCompositeNestingLimitReached } >Also applies to: 1302-1307
🤖 Prompt for 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. In `@src/components/graph/menus/network-modifications/network-modification-node-editor.tsx` around lines 969 - 973, The merge action can be invoked with an undefined node id; update doMergeModificationsIntoComposite (and the other merge handler block around the later UI action) to guard against missing currentNode: if currentNode is falsy, do an early return (and do not call setSaveInProgress or mergeModificationsIntoComposite) and ensure any merge button/trigger is disabled when currentNode is null so the API never receives currentNode?.id as undefined. Locate references to doMergeModificationsIntoComposite, mergeModificationsIntoComposite, selectedNetworkModifications and the other merge handler and add the null-check + UI disable logic.
🤖 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.
Outside diff comments:
In
`@src/components/graph/menus/network-modifications/network-modification-node-editor.tsx`:
- Around line 969-973: The merge action can be invoked with an undefined node
id; update doMergeModificationsIntoComposite (and the other merge handler block
around the later UI action) to guard against missing currentNode: if currentNode
is falsy, do an early return (and do not call setSaveInProgress or
mergeModificationsIntoComposite) and ensure any merge button/trigger is disabled
when currentNode is null so the API never receives currentNode?.id as undefined.
Locate references to doMergeModificationsIntoComposite,
mergeModificationsIntoComposite, selectedNetworkModifications and the other
merge handler and add the null-check + UI disable logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bf7ce2b1-d310-4762-ae9a-5b0d318e8447
📒 Files selected for processing (1)
src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



PR Summary
by merging a list of selected modifications