From 8bc49bdcd3151828ea622147d0429d0c3b687e77 Mon Sep 17 00:00:00 2001 From: Frank Kopp Date: Sun, 25 Dec 2022 18:58:20 +0100 Subject: [PATCH] fix: Fixed issues which prevented ACE to work (#7667) --- package-lock.json | 72 +++++++++++++++---- package.json | 7 +- .../Form/SimpleInput/SimpleInput.tsx | 3 +- .../src/components/McduServerClient.ts | 4 +- 4 files changed, 67 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7c95b380482c..3d036673aaa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "a32nx", - "version": "0.9.0", + "version": "0.10.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "a32nx", - "version": "0.9.0", + "version": "0.10.0", "dependencies": { "@flybywiresim/api-client": "^0.16.2", "@flybywiresim/react-components": "^0.3.1", @@ -57,6 +57,7 @@ "tailwindcss": "^2.2.2", "type-to-reducer": "^1.2.0", "use-long-press": "^1.1.2", + "uuid": "^9.0.0", "ws": "^7.4.5" }, "devDependencies": { @@ -24426,6 +24427,16 @@ "node": ">=0.8" } }, + "node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -28581,13 +28592,11 @@ } }, "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "bin": { - "uuid": "bin/uuid" + "uuid": "dist/bin/uuid" } }, "node_modules/v8-compile-cache": { @@ -33315,6 +33324,16 @@ "object.getownpropertydescriptors": "^2.0.3" } }, + "node_modules/vuepress/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/vuepress/node_modules/vuepress-html-webpack-plugin": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/vuepress-html-webpack-plugin/-/vuepress-html-webpack-plugin-3.2.0.tgz", @@ -35484,6 +35503,16 @@ "node": ">=6" } }, + "node_modules/webpack-log/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/webpack-merge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", @@ -51527,7 +51556,7 @@ } }, "msfssdk": { - "version": "file:msfs-avionics-mirror/src/sdk/build/msfssdk-0.1.0.tgz" + "version": "file:msfs-avionics-mirror\\src\\sdk\\build\\msfssdk-0.1.0.tgz" }, "multicast-dns": { "version": "6.2.3", @@ -55140,6 +55169,12 @@ "psl": "^1.1.28", "punycode": "^2.1.1" } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true } } }, @@ -58458,10 +58493,9 @@ "dev": true }, "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" }, "v8-compile-cache": { "version": "2.3.0", @@ -62333,6 +62367,12 @@ "object.getownpropertydescriptors": "^2.0.3" } }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, "vuepress-html-webpack-plugin": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/vuepress-html-webpack-plugin/-/vuepress-html-webpack-plugin-3.2.0.tgz", @@ -64090,6 +64130,12 @@ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true } } }, diff --git a/package.json b/package.json index b576446c0a2f..62795f1d788b 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "@flybywiresim/api-client": "^0.16.2", "@flybywiresim/react-components": "^0.3.1", "@flybywiresim/tailwind-config": "^0.5.0", + "@localazy/cli": "^1.6.0", "@reduxjs/toolkit": "^1.6.2", "@rollup/plugin-json": "^4.1.0", "@sentry/browser": "^6.17.7", @@ -109,15 +110,14 @@ "@sentry/tracing": "^6.17.7", "@tabler/icons": "^1.41.2", "@types/react-canvas-draw": "^1.1.1", - "@localazy/cli": "^1.6.0", "byte-data": "^19.0.1", "classnames": "^2.2.6", "geolib": "^3.3.3", "i18next": "^21.6.14", "immer": "^9.0.3", "lodash": "^4.17.20", - "msfssdk": "file:msfs-avionics-mirror/src/sdk/build/msfssdk-0.1.0.tgz", "msfs-geo": "^0.1.0-alpha3", + "msfssdk": "file:msfs-avionics-mirror/src/sdk/build/msfssdk-0.1.0.tgz", "nanoid": "^3.3.1", "network": "^0.6.1", "pdf-to-printer": "^5.1.1", @@ -143,11 +143,12 @@ "redux-thunk": "^2.3.0", "rollup-plugin-scss": "^3.0.0", "safe-stable-stringify": "^2.3.1", - "simple-keyboard-layouts": "^3.1.32", "sass": "^1.45.1", + "simple-keyboard-layouts": "^3.1.32", "tailwindcss": "^2.2.2", "type-to-reducer": "^1.2.0", "use-long-press": "^1.1.2", + "uuid": "^9.0.0", "ws": "^7.4.5" } } diff --git a/src/instruments/src/EFB/UtilComponents/Form/SimpleInput/SimpleInput.tsx b/src/instruments/src/EFB/UtilComponents/Form/SimpleInput/SimpleInput.tsx index e0a329df05af..fb0419f51b2e 100644 --- a/src/instruments/src/EFB/UtilComponents/Form/SimpleInput/SimpleInput.tsx +++ b/src/instruments/src/EFB/UtilComponents/Form/SimpleInput/SimpleInput.tsx @@ -1,6 +1,7 @@ import { usePersistentNumberProperty } from '@instruments/common/persistence'; import React, { useEffect, useRef, useState, PropsWithChildren } from 'react'; import { getRootElement } from '@instruments/common/defaults'; +import { v4 as uuidv4 } from 'uuid'; import { useAppDispatch } from '../../../Store/store'; import { setOffsetY } from '../../../Store/features/keyboard'; import { KeyboardWrapper } from '../../KeyboardWrapper'; @@ -24,7 +25,7 @@ interface SimpleInputProps { } export const SimpleInput = (props: PropsWithChildren) => { - const [guid] = useState(`SI-${Utils.generateGUID()}`); + const [guid] = useState(uuidv4()); const [displayValue, setDisplayValue] = useState(props.value?.toString() ?? ''); const [focused, setFocused] = useState(false); diff --git a/src/simbridge-client/src/components/McduServerClient.ts b/src/simbridge-client/src/components/McduServerClient.ts index db223f24e42a..0159467f23cf 100644 --- a/src/simbridge-client/src/components/McduServerClient.ts +++ b/src/simbridge-client/src/components/McduServerClient.ts @@ -8,9 +8,9 @@ import { ClientState } from './ClientState'; * Class to communicate with the SimBridge MCDU server */ export class McduServerClient { - public static port: string = NXDataStore.get('CONFIG_SIMBRIDGE_PORT', '8380'); + public static port = () => NXDataStore.get('CONFIG_SIMBRIDGE_PORT', '8380'); - public static url: string = `ws://127.0.0.1:${this.port}/interfaces/v1/mcdu`.replace(/\s+/g, ''); + public static url: string = `ws://127.0.0.1:${this.port()}/interfaces/v1/mcdu`.replace(/\s+/g, ''); private state: ClientState = ClientState.getInstance();