From ec5e08a721ab4024104e5316a2d78702f9b9cd22 Mon Sep 17 00:00:00 2001 From: Jon Gadsden Date: Mon, 10 Feb 2025 21:11:13 +0000 Subject: [PATCH 1/3] remove client webSocketURL devServer config --- td.vue/vue.config.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/td.vue/vue.config.js b/td.vue/vue.config.js index c6268ce5..35cc75ec 100644 --- a/td.vue/vue.config.js +++ b/td.vue/vue.config.js @@ -30,13 +30,7 @@ const devServerConfig = hasTlsCredentials allowedHosts: [appHostname], } : { - client: { - webSocketURL: { - protocol: 'wss', // Use secure WebSocket protocol - hostname: appHostname, - port: 443, // HTTPS port - }, - }, + // note that client webSocketURL config has been removed, as it was incompatible with desktop version port: 8080, proxy: { '^/api': { From 684017de18fad7881bce2340bb31c9e89030dcba Mon Sep 17 00:00:00 2001 From: Jon Gadsden Date: Mon, 10 Feb 2025 21:41:15 +0000 Subject: [PATCH 2/3] add passive events support to touchstart and mousewheel events --- td.vue/package-lock.json | 7 +++++++ td.vue/package.json | 1 + td.vue/src/service/migration/diagram.js | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/td.vue/package-lock.json b/td.vue/package-lock.json index 9d9ad088..bbad7b12 100644 --- a/td.vue/package-lock.json +++ b/td.vue/package-lock.json @@ -33,6 +33,7 @@ "electron-updater": "^6.3.0", "is-electron": "^2.2.1", "jquery": "^3.7.1", + "passive-events-support": "^1.1.0", "uuid": "^8.3.2", "vue": "^2.7.3", "vue-i18n": "^8.27.2", @@ -27827,6 +27828,12 @@ "node": ">=0.10.0" } }, + "node_modules/passive-events-support": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/passive-events-support/-/passive-events-support-1.1.0.tgz", + "integrity": "sha512-MNkNItIS7Ufwp0OrBIImkYlJmGmdFullI7KaEUPnKRpxf/QYQu6rI1VpCXVnW2LiRcnKPcpLvwFY5KfXOXqqWA==", + "license": "MIT" + }, "node_modules/path-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", diff --git a/td.vue/package.json b/td.vue/package.json index 5c2e41b1..596fcd95 100644 --- a/td.vue/package.json +++ b/td.vue/package.json @@ -78,6 +78,7 @@ "electron-updater": "^6.3.0", "is-electron": "^2.2.1", "jquery": "^3.7.1", + "passive-events-support": "^1.1.0", "uuid": "^8.3.2", "vue": "^2.7.3", "vue-i18n": "^8.27.2", diff --git a/td.vue/src/service/migration/diagram.js b/td.vue/src/service/migration/diagram.js index fae7fe04..d615b353 100644 --- a/td.vue/src/service/migration/diagram.js +++ b/td.vue/src/service/migration/diagram.js @@ -4,9 +4,14 @@ import graphFactory from '@/service/x6/graph/graph.js'; import events from '@/service/x6/graph/events.js'; import store from '@/store/index.js'; import tmActions from '@/store/actions/threatmodel.js'; +import { passiveSupport } from 'passive-events-support/src/utils'; const appVersion = require('../../../package.json').version; +passiveSupport({ + events: ['touchstart', 'mousewheel'] +}); + const drawV1 = (diagram, graph) => { const { nodes, edges } = cells.map(diagram); const batchName = 'td-init'; From 378e272bf07c6b89f9042cc558f64cd0a5933b21 Mon Sep 17 00:00:00 2001 From: Jon Gadsden Date: Wed, 12 Feb 2025 13:42:01 +0000 Subject: [PATCH 3/3] add passive-events-support to Jest ignore pattern --- td.vue/jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td.vue/jest.config.js b/td.vue/jest.config.js index ab6b655e..3fec9bdb 100644 --- a/td.vue/jest.config.js +++ b/td.vue/jest.config.js @@ -22,7 +22,7 @@ module.exports = async () => { resetMocks: true, restoreMocks: true, transformIgnorePatterns: [ - '/node_modules/(?!lodash-es|axios)' + '/node_modules/(?!lodash-es|axios|passive-events-support)' ] }; };