Skip to content

fix(map): disable use-resource-name on manual label edit - #274

Merged
flcentreon merged 2 commits into
devfrom
MON-23599_resource-rename-label-flip_dev
Oct 21, 2026
Merged

flcentreon merged 2 commits into
devfrom
MON-23599_resource-rename-label-flip_dev

Conversation

@flcentreon

@flcentreon flcentreon commented Oct 20, 2026 •

Copy link
Copy Markdown

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 and useResourceName is "true", set it to "false" on the same value node.

  • Before save: the editData action already sends useResourceName to the Centreon wizard, so reopening Edit data shows the switch OFF.
  • On save: getFileData serializes useResourceName="false" + the new label; the engine persists it (pass-through) and the read side resolves the custom label.
  • Scenario 5 (renaming a resource after a custom label) then follows: with the flag off, the engine keeps 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 --check on Graph.js passes.
  • Manual: edit a resource label inline → Edit data shows OFF → save → viewer/editor show the custom label.

🤖 Generated with Claude Code

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>
@flcentreon
flcentreon requested a review from a team as a code owner October 20, 2026 14:12
Refs: MON-23599

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@flcentreon
flcentreon requested review from Thebarda and vuntz October 20, 2026 15:29
@flcentreon
flcentreon merged commit bde86df into dev Oct 21, 2026
4 checks passed
@flcentreon
flcentreon deleted the MON-23599_resource-rename-label-flip_dev branch October 21, 2026 12:16
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>
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