Repository navigation
fix(map): disable use-resource-name on manual label edit - #274
Merged
Merged
Conversation
When a RESOURCE label is edited inline in the editor, flip the cell's useResourceName attribute to false so the user's custom label is kept instead of being overwritten by the live resource name on the next render. The engine already honours the flag (persists it as-is and resolves the display label from it), and the editData action already sends useResourceName to the Centreon wizard, so the switch also reflects OFF before saving. Refs: MON-23599 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refs: MON-23599 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gfontaineCentreon
approved these changes
Oct 20, 2026
Med1233
approved these changes
Oct 21, 2026
flcentreon
added a commit
that referenced
this pull request
Oct 22, 2026
…275) PR #274 added the inline-label-edit flag reset to grapheditor/Graph.js but did not regenerate the minified bundles. The editor loads js/app.min.js (embeds load js/integrate.min.js), not the source, so the fix never ran: editing a RESOURCE label left useResourceName on, and the engine overwrote the custom label with the live resource name on the next render (MON-23599 Scenario 4). Apply the same flip in cellLabelChanged to the committed app.min.js and integrate.min.js bundles. The build:webapp (ant) toolchain was not available in this environment, so this is the equivalent targeted change rather than a full regeneration; it can be replaced by a build:webapp regen if preferred. Verified end-to-end against a live Centreon map editor: double-clicking a resource label and changing it now sets useResourceName=false, the Edit data switch reflects OFF, and the custom label persists after save. Refs: MON-23599 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Context
MON-23599 — Renaming a resource must be taken into account. QA failed acceptance Scenario 4: double-clicking a resource label to edit it inline must turn Use Resource Name OFF and keep the typed label. Currently the label is stored but the flag stays ON, so the engine overwrites it with the live resource name on the next render.
Change
In
Graph.prototype.cellLabelChanged(grapheditor/Graph.js), when a RESOURCE cell label is edited by hand anduseResourceNameis"true", set it to"false"on the same value node.editDataaction already sendsuseResourceNameto the Centreon wizard, so reopening Edit data shows the switch OFF.getFileDataserializesuseResourceName="false"+ the new label; the engine persists it (pass-through) and the read side resolves the custom label.Scoped to RESOURCE cells (links/widgets unaffected). No engine change required — the engine already honours and persists the flag.
Downstream
After merge, the vendored editor build in
centreon-map/web/build/module/editor/must be regenerated/bumped to pick this up.Test
node --checkonGraph.jspasses.🤖 Generated with Claude Code