Skip to content

fix(ui): Enforce single port mapping across front and rear images in Network Equipment Models - #25035

Open
eduardomozart wants to merge 1 commit into
glpi-project:11.0/bugfixesfrom
eduardomozart:fix-issue-23608
Open

fix(ui): Enforce single port mapping across front and rear images in Network Equipment Models#25035
eduardomozart wants to merge 1 commit into
glpi-project:11.0/bugfixesfrom
eduardomozart:fix-issue-23608

Conversation

@eduardomozart

@eduardomozart eduardomozart commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

Previously, when a Network Equipment Model had both front and rear images, the UI allowed a user to draw mapping squares for the same port on both images simultaneously. However, because the database only supports one set of coordinates per port, the secondary mapping was silently discarded upon saving, leading to confusion and data loss (Closes #23608).

This PR enforces a strict Single Mapping policy directly in the UI to match the database limitations.

  • Modified js/stencil-editor.js to attach pointerdown, touchstart, and mousedown event listeners to the cropper instances.
  • When a user interacts with the cropper on one image (e.g., drawing on the front image), any active selection on the other image (e.g., the rear image) is automatically cleared.

This provides immediate visual feedback that a port can only exist on one visual plane at a time.

Screenshots (if appropriate):

Gravacao.de.Tela.2026-07-30.as.10.48.47.mov

…ork Equipment Models

Previously, when a Network Equipment Model had both front and rear images, the UI allowed a user to draw mapping squares for the same port on both images simultaneously. However, because the database only supports one set of coordinates per port, the secondary mapping was silently discarded upon saving.

This commit enforces a strict Single Mapping policy directly in the UI. Modified js/stencil-editor.js to attach pointerdown, touchstart, and mousedown event listeners to the cropper instances. When a user interacts with the cropper on one image, any active selection on the other image is automatically cleared.
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.

Port mapping inconsistency on dual-image Network Device Models

1 participant