Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 135 additions & 133 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/main/webapp/js/diagramly/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -15248,6 +15248,10 @@
if(key === 'style')
{
graph.handleCentreonStyleChange(cell, cellStyle, value);
// handleCentreonStyleChange writes through the model
// (setCellStyles); re-read the cell's style so the
// final setStyle below preserves those changes.
cellStyle = graph.getModel().getStyle(cell);
}

cellStyle = cellStyle.replace(search, `${key}=${value};`);
Expand Down
13 changes: 10 additions & 3 deletions src/main/webapp/js/grapheditor/Format.js
Original file line number Diff line number Diff line change
Expand Up @@ -4191,14 +4191,21 @@ StyleFormatPanel.prototype.init = function()
{
const CellType = ['RESOURCE', 'CONTAINER'];
let hasCentreonResource = false;
let hideCentreonResourceFill = false;
let hasCentreonWidget = false;

for (var i = 0; i < cells.length; i++)
{
const typeCell = cells[i].getAttribute('type');
if(!hasCentreonResource && CellType.includes(typeCell))
if(CellType.includes(typeCell))
{
hasCentreonResource = true;
if(!hideCentreonResourceFill &&
(cells[i].getAttribute('useBackgroundStatusColor') === 'true' ||
graph.getCellStyle(cells[i])['style'] === 'GEOMETRIC'))
{
hideCentreonResourceFill = true;
}
}

if(!hasCentreonWidget && typeCell === 'WIDGET' && cells[i].getAttribute('widgetType') === 'OUTPUT')
Expand All @@ -4207,7 +4214,7 @@ StyleFormatPanel.prototype.init = function()
hasCentreonWidget = useBackgroundStatusColor;
}

if(hasCentreonWidget && hasCentreonResource)
if(hasCentreonWidget && hasCentreonResource && hideCentreonResourceFill)
{
break;
}
Expand All @@ -4219,7 +4226,7 @@ StyleFormatPanel.prototype.init = function()
this.container.appendChild(this.addSvgStyles(this.createPanel('StyleFormatPanel-addSvgStyles')));
}

if (ss.fill && !hasCentreonResource && !hasCentreonWidget )
if (ss.fill && !hideCentreonResourceFill && !hasCentreonWidget )
{
this.container.appendChild(this.addFill(this.createPanel('StyleFormatPanel-addFill')));
}
Expand Down
18 changes: 18 additions & 0 deletions src/main/webapp/js/grapheditor/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -11649,10 +11649,28 @@ if (typeof mxVertexHandler !== 'undefined')
if(value === 'GEOMETRIC' && !cellStyle.includes('style=GEOMETRIC;'))
{
this.setCellDimensions(cell, 20, 20); // or change it to 84, to see with romain
// GEOMETRIC paints the status color and ignores the user's
// fill. Clear imageBackground (what drawio actually renders)
// but copy its current value onto fillColor so the picked
// color is preserved and can be restored when the style is
// switched back.
var imageBg = this.getCellStyle(cell)[mxConstants.STYLE_IMAGE_BACKGROUND];
if(imageBg != null)
{
this.setCellStyles(mxConstants.STYLE_FILLCOLOR, imageBg, [cell]);
this.setCellStyles(mxConstants.STYLE_IMAGE_BACKGROUND, null, [cell]);
}
}
else if(value !== 'GEOMETRIC' && cellStyle.includes('style=GEOMETRIC;'))
{
this.setCellDimensions(cell, 84, 84);
// Restore the saved fill onto imageBackground so drawio
// renders it.
var fillColor = this.getCellStyle(cell)[mxConstants.STYLE_FILLCOLOR];
if(fillColor != null)
{
this.setCellStyles(mxConstants.STYLE_IMAGE_BACKGROUND, fillColor, [cell]);
}
}

if(value === 'WEATHER' && !cellStyle.includes('style=WEATHER;'))
Expand Down
618 changes: 310 additions & 308 deletions src/main/webapp/js/integrate.min.js

Large diffs are not rendered by default.

1,567 changes: 784 additions & 783 deletions src/main/webapp/js/viewer-static.min.js

Large diffs are not rendered by default.

1,567 changes: 784 additions & 783 deletions src/main/webapp/js/viewer.min.js

Large diffs are not rendered by default.

Loading