Skip to content

Commit 0a0a1a3

Browse files
authored
Merge pull request #1073 from joshunrau/playground-background
fix: set default background color for interactive task to white
2 parents d00aca4 + d0b307a commit 0a0a1a3

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ GATEWAY_DEV_SERVER_PORT=3500
7777
# The port to use for the Vite (full web app) development server
7878
WEB_DEV_SERVER_PORT=3000
7979
# Set an arbitrary delay (in milliseconds) for all responses (useful for testing suspense)
80-
API_RESPONSE_DELAY=0
80+
API_RESPONSE_DELAY=
8181
# If set to 'true' and NODE_ENV === 'development', then login is automated
8282
VITE_DEV_BYPASS_AUTH=false
8383
# The username to use if VITE_DEV_BYPASS_AUTH is set to true

apps/api/src/configuration/configuration.schema.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isNumberLike, parseNumber } from '@douglasneuroinformatics/libjs';
12
import { $BooleanString } from '@opendatacapture/schemas/core';
23
import { z } from 'zod';
34

@@ -10,18 +11,27 @@ const $OptionalURL = z.preprocess(
1011
.transform((arg) => (arg ? new URL(arg) : undefined))
1112
);
1213

14+
const $ParsedNumber = <TSchema extends z.ZodTypeAny>(schema: TSchema) => {
15+
return z.preprocess((arg) => {
16+
if (!isNumberLike(arg)) {
17+
return undefined;
18+
}
19+
return parseNumber(arg);
20+
}, schema);
21+
};
22+
1323
export const $Configuration = z
1424
.object({
15-
API_DEV_SERVER_PORT: z.coerce.number().positive().int().optional(),
16-
API_PROD_SERVER_PORT: z.coerce.number().positive().int().default(80),
17-
API_RESPONSE_DELAY: z.coerce.number().positive().int().optional(),
25+
API_DEV_SERVER_PORT: $ParsedNumber(z.number().positive().int().optional()),
26+
API_PROD_SERVER_PORT: $ParsedNumber(z.number().positive().int().default(80)),
27+
API_RESPONSE_DELAY: $ParsedNumber(z.number().positive().int().optional()),
1828
DANGEROUSLY_DISABLE_PBKDF2_ITERATION: $BooleanString.default(false),
1929
DEBUG: $BooleanString,
2030
GATEWAY_API_KEY: z.string().min(32),
21-
GATEWAY_DEV_SERVER_PORT: z.coerce.number().positive().int().optional(),
31+
GATEWAY_DEV_SERVER_PORT: $ParsedNumber(z.number().positive().int().optional()),
2232
GATEWAY_ENABLED: $BooleanString,
2333
GATEWAY_INTERNAL_NETWORK_URL: $OptionalURL,
24-
GATEWAY_REFRESH_INTERVAL: z.coerce.number().positive().int(),
34+
GATEWAY_REFRESH_INTERVAL: $ParsedNumber(z.number().positive().int()),
2535
GATEWAY_SITE_ADDRESS: $OptionalURL,
2636
MONGO_DIRECT_CONNECTION: z.string().optional(),
2737
MONGO_REPLICA_SET: z.string().optional(),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "opendatacapture",
33
"type": "module",
4-
"version": "1.8.3",
4+
"version": "1.8.4",
55
"private": true,
66
"packageManager": "[email protected]",
77
"license": "Apache-2.0",

packages/instrument-renderer/src/components/InteractiveContent/InteractiveContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const InteractiveContent = React.memo<InteractiveContentProps>(function I
112112
name="interactive-instrument"
113113
ref={iFrameRef}
114114
srcDoc={`<script type="module">${bootstrapScript}</script>`}
115-
style={{ height: dimensions, scale: `${scale}%`, width: dimensions }}
115+
style={{ backgroundColor: 'white', height: dimensions, scale: `${scale}%`, width: dimensions }}
116116
title="Open Data Capture - Interactive Instrument"
117117
/>
118118
</div>

0 commit comments

Comments
 (0)