Skip to content

Conversation

@klesaulnier
Copy link
Contributor

PR Summary

Before this fix, voltage level menu was displaying empty string instead of substation ID in several submenus

Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
@antoinebhs antoinebhs self-requested a review December 31, 2025 08:25
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Comment on lines 25 to 27
const studyUuid = useSelector((state: AppState) => state.studyUuid);
const currentNodeUuid = useSelector((state: AppState) => state.currentTreeNode)?.id;
const currentRootNetworkUuid = useSelector((state: AppState) => state.currentRootNetworkUuid);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not pass them from use-equipment-menu?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's better to do this way
It reduces the number of params that are necessary for the component to work anyway

antoinebhs

This comment was marked as outdated.

FEEDER_TYPES.GENERATOR,
];

export const equipmentsWithContextualMenu = [
Copy link
Contributor

Choose a reason for hiding this comment

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

not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed too much code with my last commit while debugging
It's now used for white listing

Copy link
Contributor

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

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

Why don't we need this extra fetch in the map (on main)?

};
}, [voltageLevel.id, studyUuid, currentNodeUuid, currentRootNetworkUuid]);

if (!voltageLevelInfos?.substationId || isLoading) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isLoading redundant with voltageLevelInfos?.substationId ?

Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Copy link
Contributor

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

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

Code OK
Test OK


const showEquipmentMenu = useCallback(
(svgId: string, equipmentId: string, equipmentType: string, mousePosition: Point) => {
// don't display the equipment menu in edit mode.
Copy link
Contributor

Choose a reason for hiding this comment

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

delete outdated comment?

klesaulnier and others added 2 commits December 31, 2025 14:38
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
@sonarqubecloud
Copy link

@klesaulnier klesaulnier merged commit a0564af into main Dec 31, 2025
5 checks passed
@klesaulnier klesaulnier deleted the fix-vl-tooltip-nad branch December 31, 2025 13:43
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.

3 participants