From 3eeb02c6a838ec0140e03686d4819c2be7050f1b Mon Sep 17 00:00:00 2001 From: joshunrau Date: Wed, 8 Jan 2025 10:34:05 -0500 Subject: [PATCH 1/4] fix: set default background color for interactive task to white --- .../src/components/InteractiveContent/InteractiveContent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/instrument-renderer/src/components/InteractiveContent/InteractiveContent.tsx b/packages/instrument-renderer/src/components/InteractiveContent/InteractiveContent.tsx index c92cbca92..33d1142cd 100644 --- a/packages/instrument-renderer/src/components/InteractiveContent/InteractiveContent.tsx +++ b/packages/instrument-renderer/src/components/InteractiveContent/InteractiveContent.tsx @@ -112,7 +112,7 @@ export const InteractiveContent = React.memo(function I name="interactive-instrument" ref={iFrameRef} srcDoc={``} - style={{ height: dimensions, scale: `${scale}%`, width: dimensions }} + style={{ backgroundColor: 'white', height: dimensions, scale: `${scale}%`, width: dimensions }} title="Open Data Capture - Interactive Instrument" /> From 434d7f5fc81c4476ccfd3e699e47f0eb1ba62915 Mon Sep 17 00:00:00 2001 From: joshunrau Date: Wed, 8 Jan 2025 10:54:47 -0500 Subject: [PATCH 2/4] fix: set default value for API_RESPONSE_DELAY to undefined --- .env.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.template b/.env.template index 04d356b86..e95404fbd 100644 --- a/.env.template +++ b/.env.template @@ -77,7 +77,7 @@ GATEWAY_DEV_SERVER_PORT=3500 # The port to use for the Vite (full web app) development server WEB_DEV_SERVER_PORT=3000 # Set an arbitrary delay (in milliseconds) for all responses (useful for testing suspense) -API_RESPONSE_DELAY=0 +API_RESPONSE_DELAY= # If set to 'true' and NODE_ENV === 'development', then login is automated VITE_DEV_BYPASS_AUTH=false # The username to use if VITE_DEV_BYPASS_AUTH is set to true From cfbc156f37a8c964ec2d247ee8ecdc7d25e1d79c Mon Sep 17 00:00:00 2001 From: joshunrau Date: Wed, 8 Jan 2025 11:12:56 -0500 Subject: [PATCH 3/4] fix: issues with number parsing --- .../src/configuration/configuration.schema.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/api/src/configuration/configuration.schema.ts b/apps/api/src/configuration/configuration.schema.ts index 450b07f74..93e4f8f5c 100644 --- a/apps/api/src/configuration/configuration.schema.ts +++ b/apps/api/src/configuration/configuration.schema.ts @@ -1,3 +1,4 @@ +import { isNumberLike, parseNumber } from '@douglasneuroinformatics/libjs'; import { $BooleanString } from '@opendatacapture/schemas/core'; import { z } from 'zod'; @@ -10,18 +11,27 @@ const $OptionalURL = z.preprocess( .transform((arg) => (arg ? new URL(arg) : undefined)) ); +const $ParsedNumber = (schema: TSchema) => { + return z.preprocess((arg) => { + if (!isNumberLike(arg)) { + return undefined; + } + return parseNumber(arg); + }, schema); +}; + export const $Configuration = z .object({ - API_DEV_SERVER_PORT: z.coerce.number().positive().int().optional(), - API_PROD_SERVER_PORT: z.coerce.number().positive().int().default(80), - API_RESPONSE_DELAY: z.coerce.number().positive().int().optional(), + API_DEV_SERVER_PORT: $ParsedNumber(z.number().positive().int().optional()), + API_PROD_SERVER_PORT: $ParsedNumber(z.number().positive().int().default(80)), + API_RESPONSE_DELAY: $ParsedNumber(z.number().positive().int().optional()), DANGEROUSLY_DISABLE_PBKDF2_ITERATION: $BooleanString.default(false), DEBUG: $BooleanString, GATEWAY_API_KEY: z.string().min(32), - GATEWAY_DEV_SERVER_PORT: z.coerce.number().positive().int().optional(), + GATEWAY_DEV_SERVER_PORT: $ParsedNumber(z.number().positive().int().optional()), GATEWAY_ENABLED: $BooleanString, GATEWAY_INTERNAL_NETWORK_URL: $OptionalURL, - GATEWAY_REFRESH_INTERVAL: z.coerce.number().positive().int(), + GATEWAY_REFRESH_INTERVAL: $ParsedNumber(z.number().positive().int()), GATEWAY_SITE_ADDRESS: $OptionalURL, MONGO_DIRECT_CONNECTION: z.string().optional(), MONGO_REPLICA_SET: z.string().optional(), From d0b307a012e59523e2c4cb8e8fb9aeb7850e235b Mon Sep 17 00:00:00 2001 From: joshunrau Date: Wed, 8 Jan 2025 11:14:07 -0500 Subject: [PATCH 4/4] chore: increment version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b952070f5..a8b2ee33e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "opendatacapture", "type": "module", - "version": "1.8.3", + "version": "1.8.4", "private": true, "packageManager": "pnpm@9.14.2", "license": "Apache-2.0",