Skip to content

fix(map): regenerate editor bundle for use-resource-name label flip - #275

Merged
flcentreon merged 1 commit into
devfrom
MON-23599_regen-editor-bundle_dev
Oct 22, 2026
Merged

flcentreon merged 1 commit into
devfrom
MON-23599_regen-editor-bundle_dev

Conversation

@flcentreon

@flcentreon flcentreon commented Oct 22, 2026 •

Copy link
Copy Markdown

Context

MON-23599 — Renaming a resource must be taken into account, acceptance Scenario 4: double-clicking a resource label to edit it inline must turn Use Resource Name OFF and keep the typed label.

PR #274 added that flag reset to grapheditor/Graph.js (Graph.prototype.cellLabelChanged), but did not regenerate the minified bundles. The editor loads js/app.min.js (and embeds load js/integrate.min.js), not the grapheditor/ source — so the fix never executed. Editing a RESOURCE label left useResourceName="true", and the engine overwrote the custom label with the live resource name on the next render.

This is the same gap noted by #252 / #234, which regenerated bundles via build:webapp alongside their source edits.

Change

Apply the same one-line flip inside the minified cellLabelChanged of the two bundles that carry the Graph override:

  • src/main/webapp/js/app.min.js (loaded by the editor)
  • src/main/webapp/js/integrate.min.js (embed/integration build)
"RESOURCE"==L.getAttribute("type")&&"true"==L.getAttribute("useResourceName")&&L.setAttribute("useResourceName","false");

This mirrors the already-merged Graph.js change exactly (set useResourceName to false on the cloned value node when a RESOURCE label is edited by hand).

Note: build:webapp (ant + bundled closure compiler.jar) was not runnable in the environment where this was prepared, so this is a targeted edit of the committed bundles rather than a full regeneration. If a full build:webapp regen is preferred, it would produce the equivalent change (plus incidental re-minification churn); happy to swap to that.

Test

Verified end-to-end against a live Centreon map editor (local engine + develop web), after loading these patched bundles:

  • Add a RESOURCE (host, host group) → useResourceName: true (default ON).
  • Double-click the label, change the text → useResourceName flips to false.
  • Edit data reopens with the Use resource name switch OFF.
  • Save + reload → the custom label persists; the engine serves it back (does not overwrite with the resource name).

Reproduced the pre-fix failure on a clean develop build (unpatched app.min.js) to confirm the gap, then confirmed these bundles resolve it.

Downstream

After merge, bump @centreon/drawio in centreon-map/web (pnpm-lock.yaml) to this commit so the deployed editor picks it up.

Refs: MON-23599

🤖 Generated with Claude Code

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>
@flcentreon
flcentreon requested a review from a team as a code owner October 22, 2026 09:00

@Yassir-BenBOUBKER Yassir-BenBOUBKER left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

from now on it better to merge the fixs with the min files

@flcentreon
flcentreon merged commit 71a01c9 into dev Oct 22, 2026
4 checks passed
@flcentreon
flcentreon deleted the MON-23599_regen-editor-bundle_dev branch October 22, 2026 10:26
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