David Benson 3 éve
szülő
commit
1205d6e14d

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+06-JAN-2023: 20.8.3
+
+- Adds logging for merge fallback success or failure
+- Fires consumeMouseEvent event in consumeMouseEvent
+- Removes edge URL parameter
+- Fixes mouse cursors for direct edge event handling
+
 06-JAN-2023: 20.8.2
 
 - Fixes possible NPE, missing update of page tabs

+ 1 - 1
VERSION

@@ -1 +1 @@
-20.8.2
+20.8.3

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 951 - 951
src/main/webapp/js/app.min.js


+ 43 - 23
src/main/webapp/js/diagramly/DrawioFileSync.js

@@ -1217,32 +1217,52 @@ DrawioFileSync.prototype.merge = function(patches, checksum, desc, success, erro
 			if (checksum != null && checksum != current)
 			{
 				// Logs checksum error
-				try
+				var logError = mxUtils.bind(this, function(failed)
 				{
-					var user = this.file.getCurrentUser();
-					var uid = (user != null) ? user.id : 'unknown';
-					var id = (this.file.getId() != '') ? this.file.getId() :
-						('(' + this.ui.hashValue(this.file.getTitle()) + ')');
-					var bytes = JSON.stringify(patches).length;
-
-					EditorUi.logError('Checksum Error with reload in merge ' + id,
-						null, this.file.getMode() + '.' + this.file.getId(),
-						'user_' + uid + ((this.sync != null) ?
-						'-client_' + this.clientId : '-nosync') +
-						'-bytes_' + bytes + '-patches_' + patches.length +
-						'-size_' + this.file.getSize() +
-						((checksum != null) ? ('-expected_' + checksum) : '') +
-						((current != null) ? ('-current_' + current) : '') +
-						'-from_' + this.ui.hashValue(this.file.getCurrentRevisionId()) +
-						'-to_' + this.ui.hashValue(target));
-				}
-				catch (e)
+					try
+					{
+						var user = this.file.getCurrentUser();
+						var uid = (user != null) ? user.id : 'unknown';
+						var id = (this.file.getId() != '') ? this.file.getId() :
+							('(' + this.ui.hashValue(this.file.getTitle()) + ')');
+						var bytes = JSON.stringify(patches).length;
+	
+						EditorUi.logError('Merge checksum fallback ' + (failed ?
+							'failed' : 'success') + ' ' + id, null,
+							this.file.getMode() + '.' + this.file.getId(),
+							'user_' + uid + ((this.sync != null) ?
+							'-client_' + this.clientId : '-nosync') +
+							'-bytes_' + bytes + '-patches_' + patches.length +
+							'-size_' + this.file.getSize() +
+							((checksum != null) ? ('-expected_' + checksum) : '') +
+							((current != null) ? ('-current_' + current) : '') +
+							'-from_' + this.ui.hashValue(this.file.getCurrentRevisionId()) +
+							'-to_' + this.ui.hashValue(target));
+					}
+					catch (e)
+					{
+						// ignore
+					}
+				});
+
+				// Fallback to full reload with logging
+				this.reload(mxUtils.bind(this, function()
 				{
-					// ignore
-				}
+					logError(false);
 
-				// Fallback to full reload
-				this.reload(success, error, abort);
+					if (success != null)
+					{
+						success();
+					}
+				}), mxUtils.bind(this, function()
+				{
+					logError(true);
+
+					if (error != null)
+					{
+						error();
+					}
+				}), abort);
 
 				// Abnormal termination
 				return;

+ 1 - 6
src/main/webapp/js/diagramly/Editor.js

@@ -5729,7 +5729,7 @@
 	 * Properties for the SVG shadow effect.
 	 */
 	Graph.prototype.svgShadowColor = '#3D4574';
-
+	
 	/**
 	 * Properties for the SVG shadow effect.
 	 */
@@ -5745,11 +5745,6 @@
 	 */
 	Graph.prototype.svgShadowSize = '3';
 
-	/**
-	 * Enables move of bends/segments without selecting.
-	 */
-	Graph.prototype.edgeMode = urlParams['edge'] != 'move';
-			
 	/**
 	 * Enables move of bends/segments without selecting.
 	 */

+ 46 - 39
src/main/webapp/js/grapheditor/Graph.js

@@ -301,8 +301,8 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 		return (style != null) ? (style['html'] == '1' || style[mxConstants.STYLE_WHITE_SPACE] == 'wrap') : false;
 	};
 	
-	// Implements a listener for hover and click handling on edges
-	if (this.edgeMode)
+	// Implements a listener for hover and click handling on edges and tables
+	if (this.immediateHandling)
 	{
 		var start = {
 			point: null,
@@ -311,7 +311,7 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 			handle: null,
 			selected: false
 		};
-		
+
 		// Uses this event to process mouseDown to check the selection state before it is changed
 		this.addListener(mxEvent.FIRE_MOUSE_EVENT, mxUtils.bind(this, function(sender, evt)
 		{
@@ -320,33 +320,10 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 				var me = evt.getProperty('event');
 		    	var state = me.getState();
 				var s = this.view.scale;
-	
+				
 		    	if (!mxEvent.isAltDown(me.getEvent()) && state != null)
 		    	{
-		    		// Checks if state was removed in call to stopEditing above
-		    		if (this.model.isEdge(state.cell))
-		    		{
-		    			start.point = new mxPoint(me.getGraphX(), me.getGraphY());
-		    			start.selected = this.isCellSelected(state.cell);
-		    			start.state = state;
-		    			start.event = me;
-		    			
-    					if (state.text != null && state.text.boundingBox != null &&
-    						mxUtils.contains(state.text.boundingBox, me.getGraphX(), me.getGraphY()))
-    					{
-    						start.handle = mxEvent.LABEL_HANDLE;
-    					}
-    					else
-    					{
-							var handler = this.selectionCellsHandler.getHandler(state.cell);
-
-			    			if (handler != null && handler.bends != null && handler.bends.length > 0)
-			    			{
-			    				start.handle = handler.getHandleForEvent(me);
-			    			}
-    					}
-		    		}
-		    		else if (!this.panningHandler.isActive() && !mxEvent.isControlDown(me.getEvent()))
+		    		if (!this.panningHandler.isActive() && !mxEvent.isControlDown(me.getEvent()))
 		    		{
 			   			var handler = this.selectionCellsHandler.getHandler(state.cell);
 
@@ -441,6 +418,40 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 			}
 		}));
 		
+		// Uses this event to process mouseDown to check the selection state before it is changed
+		this.addListener(mxEvent.CONSUME_MOUSE_EVENT, mxUtils.bind(this, function(sender, evt)
+		{
+			if (evt.getProperty('eventName') == 'mouseDown' && this.isEnabled())
+			{
+				var me = evt.getProperty('event');
+				var state = me.getState();
+				
+				if (!mxEvent.isAltDown(me.getEvent()) && state != null &&
+					this.model.isEdge(state.cell))
+				{
+					start.point = new mxPoint(me.getGraphX(), me.getGraphY());
+					start.selected = this.isCellSelected(state.cell);
+					start.state = state;
+					start.event = me;
+					
+					if (state.text != null && state.text.boundingBox != null &&
+						mxUtils.contains(state.text.boundingBox, me.getGraphX(), me.getGraphY()))
+					{
+						start.handle = mxEvent.LABEL_HANDLE;
+					}
+					else
+					{
+						var handler = this.selectionCellsHandler.getHandler(state.cell);
+
+						if (handler != null && handler.bends != null && handler.bends.length > 0)
+						{
+							start.handle = handler.getHandleForEvent(me);
+						}
+					}
+				}
+			}
+		}));
+
 		this.addMouseListener(
 		{
 			mouseDown: function(sender, me) {},
@@ -465,23 +476,19 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 			    	{
 			    		var state = start.state;
 			    		
-			    		if (Math.abs(start.point.x - me.getGraphX()) > tol ||
+			    		if (start.handle != null || Math.abs(start.point.x - me.getGraphX()) > tol ||
 			    			Math.abs(start.point.y - me.getGraphY()) > tol)
 			    		{
 			    			var handler = this.selectionCellsHandler.getHandler(state.cell);
 			    			
-			    			if (handler == null && this.model.isEdge(state.cell))
-			    			{
-			    				handler = this.createHandler(state);
-			    			}
-			    			
 			    			if (handler != null && handler.bends != null && handler.bends.length > 0)
 			    			{
 								handler.redrawHandles();
-			    				var handle = handler.getHandleForEvent(start.event, true);
+			    				var handle = (start.handle != null) ? start.handle :
+									handler.getHandleForEvent(start.event);
 			    				var edgeStyle = this.view.getEdgeStyle(state);
 			    				var entity = edgeStyle == mxEdgeStyle.EntityRelation;
-								
+
 			    				// Handles special case where label was clicked on unselected edge in which
 			    				// case the label will be moved regardless of the handle that is returned
 			    				if (!start.selected && start.handle == mxEvent.LABEL_HANDLE)
@@ -608,7 +615,7 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 			    	{
 			    		// Updates cursor for unselected edges under the mouse
 				    	var state = me.getState();
-				    	
+						
 				    	if (state != null && this.isCellEditable(state.cell))
 				    	{
 				    		var cursor = null;
@@ -2113,9 +2120,9 @@ Graph.prototype.selectParentAfterDelete = false;
 Graph.prototype.defaultEdgeLength = 80;
 
 /**
- * Disables move of bends/segments without selecting.
+ * Enables activation of special handles on unselected cells.
  */
-Graph.prototype.edgeMode = false;
+Graph.prototype.immediateHandling = true;
 
 /**
  * Allows all values in fit.

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 795 - 795
src/main/webapp/js/integrate.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 778 - 777
src/main/webapp/js/viewer-static.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 778 - 777
src/main/webapp/js/viewer.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 10 - 9
src/main/webapp/mxgraph/mxClient.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
src/main/webapp/service-worker.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
src/main/webapp/service-worker.js.map