From 672ea1153d1383c3c2f030485c07a656b19880da Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 16 Jan 2024 14:31:33 +0100 Subject: [PATCH] chore: remove touch interaction Related to https://github.com/bpmn-io/diagram-js/issues/796 --- lib/Modeler.js | 2 - .../label-editing/LabelEditingProvider.js | 15 +------ test/integration/CustomElementsSpec.js | 5 +-- .../label-editing/TouchIntegrationSpec.js | 41 ------------------- .../behavior/DropOnFlowBehaviorSpec.js | 3 -- 5 files changed, 3 insertions(+), 63 deletions(-) delete mode 100644 test/spec/features/label-editing/TouchIntegrationSpec.js diff --git a/lib/Modeler.js b/lib/Modeler.js index ad84b8a553..d9bc0f7617 100644 --- a/lib/Modeler.js +++ b/lib/Modeler.js @@ -7,7 +7,6 @@ import NavigatedViewer from './NavigatedViewer'; import KeyboardMoveModule from 'diagram-js/lib/navigation/keyboard-move'; import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas'; -import TouchModule from 'diagram-js/lib/navigation/touch'; import ZoomScrollModule from 'diagram-js/lib/navigation/zoomscroll'; import AlignElementsModule from './features/align-elements'; @@ -156,7 +155,6 @@ Modeler.prototype._interactionModules = [ // non-modeling components KeyboardMoveModule, MoveCanvasModule, - TouchModule, ZoomScrollModule ]; diff --git a/lib/features/label-editing/LabelEditingProvider.js b/lib/features/label-editing/LabelEditingProvider.js index 1a09456377..e14521e01b 100644 --- a/lib/features/label-editing/LabelEditingProvider.js +++ b/lib/features/label-editing/LabelEditingProvider.js @@ -116,20 +116,7 @@ export default function LabelEditingProvider( var context = event.context, element = context.shape, - canExecute = event.context.canExecute, - isTouch = event.isTouch; - - // TODO(nikku): we need to find a way to support the - // direct editing on mobile devices; right now this will - // break for desworkflowediting on mobile devices - // as it breaks the user interaction workflow - - // TODO(nikku): we should temporarily focus the edited element - // here and release the focused viewport after the direct edit - // operation is finished - if (isTouch) { - return; - } + canExecute = event.context.canExecute; if (!canExecute) { return; diff --git a/test/integration/CustomElementsSpec.js b/test/integration/CustomElementsSpec.js index 7b205823be..ba41a372cb 100644 --- a/test/integration/CustomElementsSpec.js +++ b/test/integration/CustomElementsSpec.js @@ -12,9 +12,8 @@ import { import customElementsModules from './custom-elements'; -var noTouchInteractionModule = { touchInteractionEvents: [ 'value', null ] }, - modelerModules = Modeler.prototype._modules, - customModules = [ customElementsModules, noTouchInteractionModule ]; +var modelerModules = Modeler.prototype._modules, + customModules = [ customElementsModules ]; var testModules = [].concat(modelerModules, customModules); diff --git a/test/spec/features/label-editing/TouchIntegrationSpec.js b/test/spec/features/label-editing/TouchIntegrationSpec.js deleted file mode 100644 index 26b3513bda..0000000000 --- a/test/spec/features/label-editing/TouchIntegrationSpec.js +++ /dev/null @@ -1,41 +0,0 @@ -import TestContainer from 'mocha-test-container-support'; - -import Modeler from 'lib/Modeler'; - - -describe('direct editing - touch integration', function() { - - var container; - - beforeEach(function() { - container = TestContainer.get(this); - }); - - - function createModeler(xml) { - var modeler = new Modeler({ container: container }); - - return modeler.importXML(xml).then(function(result) { - return { error: null, modeler: modeler }; - }).catch(function(err) { - return { error: err, modeler: modeler }; - }); - } - - - it('should work on modeler (manual test)', function() { - var xml = require('../../../fixtures/bpmn/simple.bpmn'); - return createModeler(xml).then(function(result) { - expect(result.error).not.to.exist; - }); - }); - - - it('should edit labels via double tap (manual test)', function() { - var xml = require('./LabelEditing.bpmn'); - return createModeler(xml).then(function(result) { - expect(result.error).not.to.exist; - }); - }); - -}); diff --git a/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js b/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js index 5254551575..eef2da5852 100644 --- a/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js @@ -11,8 +11,6 @@ import coreModule from 'lib/core'; import moveModule from 'diagram-js/lib/features/move'; import modelingModule from 'lib/features/modeling'; -var noTouchInteractionModule = { touchInteractionEvents: [ 'value', null ] }; - import { createCanvasEvent as canvasEvent } from '../../../../util/MockEvents'; @@ -26,7 +24,6 @@ describe('modeling/behavior - drop on connection', function() { beforeEach(bootstrapModeler(diagramXML, { modules: [ - noTouchInteractionModule, moveModule, modelingModule, coreModule