From f1cde4359fda506e19252591e76a0b8fcef94280 Mon Sep 17 00:00:00 2001 From: Yassir-BenBOUBKER <97686091+Yassir-BenBOUBKER@users.noreply.github.com> Date: Tue, 21 May 2024 11:13:04 +0100 Subject: [PATCH] add display label to container (#139) --- src/main/webapp/js/app.min.js | 2 +- src/main/webapp/js/grapheditor/Actions.js | 2 +- src/main/webapp/js/integrate.min.js | 2 +- src/main/webapp/js/viewer-static.min.js | 2 +- src/main/webapp/js/viewer.min.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index 5d57cee538..58ac598479 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -3481,7 +3481,7 @@ function(k){d.orderCells(!1,null,!0)});this.addAction("sendBackward",function(k) d.model.beginUpdate();try{var q=d.ungroupCells();if(null!=k)for(var x=0;x/g," ").replace(/ /g," "):U,R}}).filter(function(T){return void 0!==T})}var q=d.getSelectionCell()||d.getModel().getRoot();if(q&&q.value){var x=q.getAttribute("type");if(!("WIDGET"===x&&"LINK_LEGEND"=== q.getAttribute("widgetType")||"LINK"===x&&"SIMPLE"===q.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(x)){x="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),D="type mediaType newTab elementUrl imageName centreonImageId label".split(" "), -F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label".split(" "), +F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label displayLabel".split(" "), E=[];void 0!==q.getAttribute("resourceType")&&(E=k(x));void 0!==q.getAttribute("linkType")&&(E=k(B));void 0!==q.getAttribute("mediaType")&&(E=k(D));void 0!==q.getAttribute("widgetType")&&(E=k(F));"CONTAINER"===q.getAttribute("type")&&(E=k(I));parent.postMessage(JSON.stringify({mxObject:E,mxStyle:q.getStyle(),event:"setShowWizardShapeProperties"}),"*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var k=d.getSelectionCells()||d.getModel().getRoot();if(k){var q=["RESOURCE", "CONTAINER"];k=k.filter(function(x){x=x.getAttribute("type");return q.includes(x)});1>k.length||(1===k.length?(k=d.getCellStyle(k[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:k||"ICON",event:"setCentreonStyle"}),"*")):parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:"ICON",event:"setCentreonStyle"}),"*"))}},null,null,Editor.ctrlKey+"+E");this.addAction("createMapFromContainer",function(){function k(B){return B.map(function(D){if(void 0!== q.getAttribute(D)){var F=q.getAttribute(D),I={};return I[D]="label"===D?F.replace(/
/g," ").replace(/ /g," "):F,I}}).filter(function(D){return void 0!==D})}var q=d.getSelectionCell()||d.getModel().getRoot(),x="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===q.getAttribute("type")&&(cellAttributes=k(x),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:q.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent", diff --git a/src/main/webapp/js/grapheditor/Actions.js b/src/main/webapp/js/grapheditor/Actions.js index fe19ca6e6e..ccb6a252b7 100644 --- a/src/main/webapp/js/grapheditor/Actions.js +++ b/src/main/webapp/js/grapheditor/Actions.js @@ -741,7 +741,7 @@ Actions.prototype.init = function() 'metricsColorStart', 'metricsColorEnd', 'parentName', 'parentType', 'parentId', 'resourceName', 'orientation', ]; - const containerProps = ['type', 'modelId', 'viewId', 'imageName', 'centreonImageId', 'label']; + const containerProps = ['type', 'modelId', 'viewId', 'imageName', 'centreonImageId', 'label', 'displayLabel']; let cellAttributes = []; diff --git a/src/main/webapp/js/integrate.min.js b/src/main/webapp/js/integrate.min.js index f8a3f559f8..4e55ad44d6 100644 --- a/src/main/webapp/js/integrate.min.js +++ b/src/main/webapp/js/integrate.min.js @@ -3481,7 +3481,7 @@ function(k){d.orderCells(!1,null,!0)});this.addAction("sendBackward",function(k) d.model.beginUpdate();try{var q=d.ungroupCells();if(null!=k)for(var x=0;x/g," ").replace(/ /g," "):U,R}}).filter(function(T){return void 0!==T})}var q=d.getSelectionCell()||d.getModel().getRoot();if(q&&q.value){var x=q.getAttribute("type");if(!("WIDGET"===x&&"LINK_LEGEND"=== q.getAttribute("widgetType")||"LINK"===x&&"SIMPLE"===q.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(x)){x="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId".split(" ");var B="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),D="type mediaType newTab elementUrl imageName centreonImageId label".split(" "), -F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label".split(" "), +F="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),I="type modelId viewId imageName centreonImageId label displayLabel".split(" "), E=[];void 0!==q.getAttribute("resourceType")&&(E=k(x));void 0!==q.getAttribute("linkType")&&(E=k(B));void 0!==q.getAttribute("mediaType")&&(E=k(D));void 0!==q.getAttribute("widgetType")&&(E=k(F));"CONTAINER"===q.getAttribute("type")&&(E=k(I));parent.postMessage(JSON.stringify({mxObject:E,mxStyle:q.getStyle(),event:"setShowWizardShapeProperties"}),"*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var k=d.getSelectionCells()||d.getModel().getRoot();if(k){var q=["RESOURCE", "CONTAINER"];k=k.filter(function(x){x=x.getAttribute("type");return q.includes(x)});1>k.length||(1===k.length?(k=d.getCellStyle(k[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:k||"ICON",event:"setCentreonStyle"}),"*")):parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:"ICON",event:"setCentreonStyle"}),"*"))}},null,null,Editor.ctrlKey+"+E");this.addAction("createMapFromContainer",function(){function k(B){return B.map(function(D){if(void 0!== q.getAttribute(D)){var F=q.getAttribute(D),I={};return I[D]="label"===D?F.replace(/
/g," ").replace(/ /g," "):F,I}}).filter(function(D){return void 0!==D})}var q=d.getSelectionCell()||d.getModel().getRoot(),x="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===q.getAttribute("type")&&(cellAttributes=k(x),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:q.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent", diff --git a/src/main/webapp/js/viewer-static.min.js b/src/main/webapp/js/viewer-static.min.js index b6a1954865..5e0fdc8406 100644 --- a/src/main/webapp/js/viewer-static.min.js +++ b/src/main/webapp/js/viewer-static.min.js @@ -2994,7 +2994,7 @@ function(D){p.orderCells(!1,null,!0)});this.addAction("sendBackward",function(D) p.model.beginUpdate();try{var H=p.ungroupCells();if(null!=D)for(var N=0;N/g," ").replace(/ /g," "):P,M}}).filter(function(F){return void 0!==F})}var H=p.getSelectionCell()||p.getModel().getRoot();if(H&&H.value){var N=H.getAttribute("type");if(!("WIDGET"===N&&"LINK_LEGEND"=== H.getAttribute("widgetType")||"LINK"===N&&"SIMPLE"===H.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(N)){N="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId".split(" ");var d="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),f="type mediaType newTab elementUrl imageName centreonImageId label".split(" "), -g="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),v="type modelId viewId imageName centreonImageId label".split(" "), +g="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),v="type modelId viewId imageName centreonImageId label displayLabel".split(" "), q=[];void 0!==H.getAttribute("resourceType")&&(q=D(N));void 0!==H.getAttribute("linkType")&&(q=D(d));void 0!==H.getAttribute("mediaType")&&(q=D(f));void 0!==H.getAttribute("widgetType")&&(q=D(g));"CONTAINER"===H.getAttribute("type")&&(q=D(v));parent.postMessage(JSON.stringify({mxObject:q,mxStyle:H.getStyle(),event:"setShowWizardShapeProperties"}),"*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var D=p.getSelectionCells()||p.getModel().getRoot();if(D){var H=["RESOURCE", "CONTAINER"];D=D.filter(function(N){N=N.getAttribute("type");return H.includes(N)});1>D.length||(1===D.length?(D=p.getCellStyle(D[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:D||"ICON",event:"setCentreonStyle"}),"*")):parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:"ICON",event:"setCentreonStyle"}),"*"))}},null,null,Editor.ctrlKey+"+E");this.addAction("createMapFromContainer",function(){function D(d){return d.map(function(f){if(void 0!== H.getAttribute(f)){var g=H.getAttribute(f),v={};return v[f]="label"===f?g.replace(/
/g," ").replace(/ /g," "):g,v}}).filter(function(f){return void 0!==f})}var H=p.getSelectionCell()||p.getModel().getRoot(),N="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===H.getAttribute("type")&&(cellAttributes=D(N),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:H.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent", diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js index 0d0776cdb9..a68b7b1f4b 100644 --- a/src/main/webapp/js/viewer.min.js +++ b/src/main/webapp/js/viewer.min.js @@ -2994,7 +2994,7 @@ function(D){p.orderCells(!1,null,!0)});this.addAction("sendBackward",function(D) p.model.beginUpdate();try{var H=p.ungroupCells();if(null!=D)for(var N=0;N/g," ").replace(/ /g," "):P,M}}).filter(function(F){return void 0!==F})}var H=p.getSelectionCell()||p.getModel().getRoot();if(H&&H.value){var N=H.getAttribute("type");if(!("WIDGET"===N&&"LINK_LEGEND"=== H.getAttribute("widgetType")||"LINK"===N&&"SIMPLE"===H.getAttribute("linkType"))&&["LINK","MEDIA","RESOURCE","WIDGET","CONTAINER"].includes(N)){N="type resourceType resourceId displayLabel resourceName modelId viewId parentName parentType parentId".split(" ");var d="type linkType parentName parentType parentId resourceType resourceId resourceName modelId metric1Min metric1Max metric2Min metric2Max metricName1 metricName2 displayPercent".split(" "),f="type mediaType newTab elementUrl imageName centreonImageId label".split(" "), -g="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),v="type modelId viewId imageName centreonImageId label".split(" "), +g="type widgetType resourceType useFontStatusColor useBackgroundStatusColor applyStatusColor resourceId pieChartInnerRadius useFontStatusColor pieChartDisplayLabel pieChartExplosion outputWidgetFormat chartDisplayThreshold chartFillLines chartNbPoints chartPeriod chartShowGrid chartStack displayLegend hiddenLine metric1Max metric1Min metricName1 metric2Max metric2Min metricName2 metricsColorStart metricsColorEnd parentName parentType parentId resourceName orientation".split(" "),v="type modelId viewId imageName centreonImageId label displayLabel".split(" "), q=[];void 0!==H.getAttribute("resourceType")&&(q=D(N));void 0!==H.getAttribute("linkType")&&(q=D(d));void 0!==H.getAttribute("mediaType")&&(q=D(f));void 0!==H.getAttribute("widgetType")&&(q=D(g));"CONTAINER"===H.getAttribute("type")&&(q=D(v));parent.postMessage(JSON.stringify({mxObject:q,mxStyle:H.getStyle(),event:"setShowWizardShapeProperties"}),"*")}}},null,null,Editor.ctrlKey+"+E");this.addAction("editCentreonStyle",function(){var D=p.getSelectionCells()||p.getModel().getRoot();if(D){var H=["RESOURCE", "CONTAINER"];D=D.filter(function(N){N=N.getAttribute("type");return H.includes(N)});1>D.length||(1===D.length?(D=p.getCellStyle(D[0]).style,parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:D||"ICON",event:"setCentreonStyle"}),"*")):parent.postMessage(JSON.stringify({mxObject:[{type:"RESOURCE_AND_CONTAINER"}],mxStyle:"ICON",event:"setCentreonStyle"}),"*"))}},null,null,Editor.ctrlKey+"+E");this.addAction("createMapFromContainer",function(){function D(d){return d.map(function(f){if(void 0!== H.getAttribute(f)){var g=H.getAttribute(f),v={};return v[f]="label"===f?g.replace(/
/g," ").replace(/ /g," "):g,v}}).filter(function(f){return void 0!==f})}var H=p.getSelectionCell()||p.getModel().getRoot(),N="type modelId viewId imageName centreonImageId label".split(" ");"CONTAINER"===H.getAttribute("type")&&(cellAttributes=D(N),parent.postMessage(JSON.stringify({mxObject:cellAttributes,mxStyle:H.getStyle(),event:"createMapFromContainer"}),"*"))},null,null,Editor.ctrlKey+"+Shift+C");this.addAction("editContent",