feat(map): expose resource fill color in editor#247
Open
vuntz wants to merge 2 commits into
Open
Conversation
Previously the Format panel always hid the fill picker for RESOURCE and CONTAINER cells. Match the existing WIDGET OUTPUT behavior: hide it only when useBackgroundStatusColor is true, since the status color would otherwise override the picked fill. The stroke panel continues to hide for all RESOURCE and CONTAINER cells. Assisted-by: Claude Code (claude-opus-4-7)
GEOMETRIC resources always render the status color and ignore the user's fill. Hide the fill picker for GEOMETRIC cells in the Format panel. In handleCentreonStyleChange, save the current imageBackground onto fillColor when switching to GEOMETRIC, then clear imageBackground; on the way back, restore imageBackground from the saved fillColor. Also fix the setStyleProperties handler to re-read the cell's style after handleCentreonStyleChange, since the latter writes through setCellStyles. Without the re-read, the final setStyle() call clobbers those changes. The Resource wizard hit this; the ResourcesAndContainer path already used setCellStyles per key and was unaffected. Assisted-by: Claude Code (claude-opus-4-7)
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.
Description
Fixes: MON-199583
centreon-modules: centreon/centreon-modules#8190. This drawio PR must merge first so the@centreon/drawiodependency in modules4 can be bumped to a commit including these changes.Expose the existing
fillColorsetting for Centreon RESOURCE and CONTAINER cells in the editor's Format panel, and preserve it across style changes. The map viewer already honorsfillColorwhen "Apply status color to background" is disabled, but the editor previously hid the picker for these cell types — making the value unreachable, especially on maps migrated from the legacy map software.Changes
useBackgroundStatusColoris false and the cell's style is not GEOMETRIC (GEOMETRIC always paints the status color and ignores the user fill).handleCentreonStyleChange, save the currentimageBackgroundontofillColorwhen switching to GEOMETRIC, then clearimageBackgroundso drawio stops painting it. Restore on the way back.setStylePropertieshandler: re-readcellStylefrom the model afterhandleCentreonStyleChange, since the latter now writes throughsetCellStyles. Without the re-read, the finalsetStyle()would clobber those changes.Type of change
Target serie
How this pull request can be tested ?
Checklist