From 31fc22287689efe071032aa270c433e3d623d415 Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Sun, 23 Jul 2023 15:10:53 +0200 Subject: [PATCH] many hotfixes (#465) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style: disable menu bar in run mode * fix: external devices in dev mode * fix: add missing elements to translations * ux: improve translation strings * refactor: improve typing * style: blink on event change * refactor: param options is object --------- Co-authored-by: Hannes Rüger --- apps/client/src/common/api/apiConstants.ts | 9 ++++++--- .../view-params-editor/ParamInput.tsx | 6 +++--- .../view-params-editor/constants.ts | 10 +++++----- .../components/view-params-editor/types.ts | 2 +- apps/client/src/features/menu/MenuBar.tsx | 5 +++++ .../features/viewers/backstage/Backstage.scss | 20 +++++++++++++++++-- .../features/viewers/backstage/Backstage.tsx | 20 ++++++++++++++++--- .../src/translation/Translation.types.ts | 0 apps/client/src/translation/languages/de.ts | 3 ++- apps/client/src/translation/languages/en.ts | 3 +++ apps/client/src/translation/languages/es.ts | 5 +++-- apps/client/src/translation/languages/no.ts | 5 +++-- apps/client/src/translation/languages/pt.ts | 3 ++- apps/client/src/translation/languages/sv.ts | 5 +++-- apps/server/src/external/styles/override.css | 1 + 15 files changed, 72 insertions(+), 25 deletions(-) delete mode 100644 apps/client/src/translation/Translation.types.ts diff --git a/apps/client/src/common/api/apiConstants.ts b/apps/client/src/common/api/apiConstants.ts index 714af6c81..6e86b7cfb 100644 --- a/apps/client/src/common/api/apiConstants.ts +++ b/apps/client/src/common/api/apiConstants.ts @@ -12,9 +12,12 @@ export const APP_SETTINGS = ['appSettings']; export const VIEW_SETTINGS = ['viewSettings']; export const RUNTIME = ['runtimeStore']; -export const serverPort = import.meta.env.DEV ? STATIC_PORT : window.location.port; -export const serverURL = import.meta.env.DEV ? `http://localhost:${serverPort}` : window.location.origin; -export const websocketUrl = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.hostname}:${serverPort}/ws`; +const location = window.location; +const socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws'; + +export const serverPort = import.meta.env.DEV ? STATIC_PORT : location.port; +export const serverURL = import.meta.env.DEV ? `http://${location.hostname}:${serverPort}` : location.origin; +export const websocketUrl = `${socketProtocol}://${location.hostname}:${serverPort}/ws`; export const eventURL = `${serverURL}/eventdata`; export const rundownURL = `${serverURL}/events`; diff --git a/apps/client/src/common/components/view-params-editor/ParamInput.tsx b/apps/client/src/common/components/view-params-editor/ParamInput.tsx index 73af5dab6..54fb5a183 100644 --- a/apps/client/src/common/components/view-params-editor/ParamInput.tsx +++ b/apps/client/src/common/components/view-params-editor/ParamInput.tsx @@ -15,12 +15,12 @@ export default function ParamInput({ paramField }: EditFormInputProps) { if (type === 'option') { const optionFromParams = searchParams.get(id); - const defaultOptionValue = paramField.values.find((value) => value === optionFromParams); + const defaultOptionValue = optionFromParams || undefined; return (