David Benson 3 лет назад
Родитель
Сommit
2691bb7621

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+19-JAN-2023: 20.8.7
+
+- Fixes initial page ID and name when creating files [DS-941]
+- [vsdx] Fixed edge/vertex detection [DID-7208]
+- Fixes log of ignored anoymous and extension errors
+
 18-JAN-2023: 20.8.6
 
 - Returns trash URL for trashed Google Drive files

+ 1 - 1
VERSION

@@ -1 +1 @@
-20.8.6
+20.8.7

Разница между файлами не показана из-за своего большого размера
+ 34 - 34
src/main/webapp/js/app.min.js


+ 6 - 4
src/main/webapp/js/diagramly/EditorUi.js

@@ -164,8 +164,8 @@
 			{
 				if (message == EditorUi.lastErrorMessage || (message != null && url != null &&
 					((message.indexOf('Script error') != -1) || (message.indexOf('extension:') != -1))) ||
-					(err != null && err.stack != null && err.stack.indexOf('extension:') != -1 &&
-					err.stack.indexOf('<anonymous>:') != -1))
+					(err != null && err.stack != null && ((err.stack.indexOf('extension:') != -1) ||
+					(err.stack.indexOf('<anonymous>:') != -1))))
 				{
 					// TODO log external domain script failure "Script error." is
 					// reported when the error occurs in a script that is hosted
@@ -1107,6 +1107,7 @@
 				if (uncompressed)
 				{
 					var diagramNode = node.ownerDocument.createElement('diagram');
+					diagramNode.setAttribute('name', mxResources.get('pageWithNumber', [1]));
 					diagramNode.setAttribute('id', Editor.guid());
 					diagramNode.appendChild(node);
 					
@@ -1128,6 +1129,7 @@
 					else
 					{
 						var diagramNode = node.ownerDocument.createElement('diagram');
+						diagramNode.setAttribute('name', mxResources.get('pageWithNumber', [1]));
 						diagramNode.setAttribute('id', Editor.guid());
 						mxUtils.setTextContent(diagramNode, data);
 						
@@ -1837,8 +1839,8 @@
 			if (node != null && node.nodeName == 'mxfile')
 			{
 				var nodes = node.getElementsByTagName('diagram');
-	
-				if (nodes.length > 1 || (nodes.length == 1 && nodes[0].hasAttribute('name')))
+
+				if (nodes.length > 0)
 				{
 					var selectedPage = null;
 					this.fileNode = node;

+ 32 - 18
src/main/webapp/js/diagramly/vsdx/importer.js

@@ -3601,6 +3601,7 @@ var com;
                         this.model = null;
                         this.shapes = ({});
                         this.connects = ({});
+                        this.connectsMap = {};
                         this.cellElements = ({});
                         this.model = model;
                         this.pageElement = pageElem;
@@ -3666,6 +3667,7 @@ var com;
                      */
                     mxVsdxPage.prototype.parseNodes = function (pageElem, model, pageName) {
                         var pageChild = pageElem.firstChild;
+                        // Parse connects first as it is needed in shapes types
                         while ((pageChild != null)) {
                             if (pageChild != null && (pageChild.nodeType == 1)) {
                                 var pageChildElem = pageChild;
@@ -3673,22 +3675,6 @@ var com;
                                 if ((function (o1, o2) { if (o1 && o1.equals) {
                                     return o1.equals(o2);
                                 }
-                                else {
-                                    return o1 === o2;
-                                } })(childName, "Rel")) {
-                                    this.resolveRel(pageChildElem, model, pageName);
-                                }
-                                else if ((function (o1, o2) { if (o1 && o1.equals) {
-                                    return o1.equals(o2);
-                                }
-                                else {
-                                    return o1 === o2;
-                                } })(childName, "Shapes")) {
-                                    this.shapes = this.parseShapes(pageChildElem, null, false);
-                                }
-                                else if ((function (o1, o2) { if (o1 && o1.equals) {
-                                    return o1.equals(o2);
-                                }
                                 else {
                                     return o1 === o2;
                                 } })(childName, "Connects")) {
@@ -3699,6 +3685,7 @@ var com;
                                             var connectElem = connectNode;
                                             var connect = new com.mxgraph.io.vsdx.mxVsdxConnect(connectElem);
                                             var fromSheet = connect.getFromSheet();
+                                            this.connectsMap[fromSheet] = true;
                                             var previousConnect = (fromSheet != null && fromSheet > -1) ? (function (m, k) { if (m.entries == null)
                                                 m.entries = []; for (var i = 0; i < m.entries.length; i++)
                                                 if (m.entries[i].key.equals != null && m.entries[i].key.equals(k) || m.entries[i].key === k) {
@@ -3720,6 +3707,32 @@ var com;
                                     }
                                     ;
                                 }
+                            }
+                            pageChild = pageChild.nextSibling;
+                        }
+                        ;
+
+                        pageChild = pageElem.firstChild;
+                        while ((pageChild != null)) {
+                            if (pageChild != null && (pageChild.nodeType == 1)) {
+                                var pageChildElem = pageChild;
+                                var childName = pageChildElem.nodeName;
+                                if ((function (o1, o2) { if (o1 && o1.equals) {
+                                    return o1.equals(o2);
+                                }
+                                else {
+                                    return o1 === o2;
+                                } })(childName, "Rel")) {
+                                    this.resolveRel(pageChildElem, model, pageName);
+                                }
+                                else if ((function (o1, o2) { if (o1 && o1.equals) {
+                                    return o1.equals(o2);
+                                }
+                                else {
+                                    return o1 === o2;
+                                } })(childName, "Shapes")) {
+                                    this.shapes = this.parseShapes(pageChildElem, null, false);
+                                }
                                 else if ((function (o1, o2) { if (o1 && o1.equals) {
                                     return o1.equals(o2);
                                 }
@@ -10015,10 +10028,11 @@ var com;
                         else {
                             _this.processGeomList(null);
                         }
+
                         // TODO It's hard to detect edges that should be treated like vertexes whhen they are groups and have child shapes.
                         // TODO Check this again if more complains are received or if we can have an edge group
-                        _this.vertex = vertex; /* || (_this.childShapes != null && !(function (m) { if (m.entries == null)
-                            m.entries = []; return m.entries.length == 0; })(_this.childShapes)) || (_this.geomList != null && (!_this.geomList.isNoFill()  || _this.geomList.getGeoCount() > 1)); */
+                        _this.vertex = vertex || (!page.connectsMap[_this.Id] && (_this.childShapes != null && !(function (m) { if (m.entries == null)
+                            m.entries = []; return m.entries.length == 0; })(_this.childShapes)) || (_this.geomList != null && (!_this.geomList.isNoFill()  || _this.geomList.getGeoCount() > 1)));
                         _this.layerMember = _this.getValue(_this.getCellElement$java_lang_String("LayerMember"));
                         
                         if (_this.layerMember)

Разница между файлами не показана из-за своего большого размера
+ 283 - 283
src/main/webapp/js/extensions.min.js


Разница между файлами не показана из-за своего большого размера
+ 317 - 317
src/main/webapp/js/integrate.min.js


Разница между файлами не показана из-за своего большого размера
+ 160 - 160
src/main/webapp/js/viewer-static.min.js


Разница между файлами не показана из-за своего большого размера
+ 160 - 160
src/main/webapp/js/viewer.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
src/main/webapp/mxgraph/mxClient.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
src/main/webapp/service-worker.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
src/main/webapp/service-worker.js.map