Skip to content

Commit df03e66

Browse files
authored
Merge branch 'DouglasNeuroInformatics:main' into large-upload-fix
2 parents 7d75838 + 7de0f45 commit df03e66

File tree

48 files changed

+462
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+462
-270
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ testing/k6/notebooks/
5959
# autogenerated api docs
6060
apps/outreach/src/content/docs/en/runtime-core-docs/
6161

62-
# mongodb
62+
# docker dbs
6363
mongo/
64+
sqlite/

apps/api/src/instruments/instruments.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ export class InstrumentsService {
164164
options: EntityOperationOptions = {}
165165
): Promise<InstrumentInfo[]> {
166166
const instances = await this.find(query, options);
167-
return instances.map(({ __runtimeVersion, details, id, kind, language, tags }) => ({
167+
return instances.map(({ __runtimeVersion, clientDetails, details, id, kind, language, tags }) => ({
168168
__runtimeVersion,
169+
clientDetails,
169170
details,
170171
id,
171172
kind,

apps/api/src/setup/setup.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ForbiddenException, Injectable, ServiceUnavailableException } from '@nestjs/common';
2-
import { getReleaseInfo } from '@opendatacapture/release-info';
32
import { type CreateAdminData } from '@opendatacapture/schemas/setup';
43
import type { InitAppOptions, SetupState, UpdateSetupStateData } from '@opendatacapture/schemas/setup';
54

@@ -31,7 +30,7 @@ export class SetupService {
3130
isExperimentalFeaturesEnabled: Boolean(savedOptions?.isExperimentalFeaturesEnabled),
3231
isGatewayEnabled: this.configurationService.get('GATEWAY_ENABLED'),
3332
isSetup: Boolean(savedOptions?.isSetup),
34-
release: import.meta.release ?? (await getReleaseInfo()),
33+
release: __RELEASE__,
3534
uptime: Math.round(process.uptime())
3635
} satisfies SetupState;
3736
}

apps/api/src/typings/global.d.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
/* eslint-disable @typescript-eslint/consistent-type-definitions */
2-
31
import type { ReleaseInfo } from '@opendatacapture/schemas/setup';
42

53
declare global {
6-
interface ImportMeta {
7-
readonly release?: ReleaseInfo;
8-
}
4+
const __RELEASE__: ReleaseInfo;
95
}

apps/gateway/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM node:iron-alpine AS base
22
WORKDIR /app
33
ARG RELEASE_VERSION
4-
ENV GATEWAY_DATABASE_URL=file:/app/gateway.db
4+
ENV GATEWAY_DATABASE_URL=file:/app/sqlite/gateway.db
55
ENV PNPM_HOME="/pnpm"
66
ENV PATH="$PNPM_HOME:$PATH"
77
ENV NODE_OPTIONS="--max-old-space-size=8192"
@@ -25,12 +25,13 @@ RUN turbo run db:push --filter=@opendatacapture/gateway
2525

2626
# RUN SERVER
2727
FROM base AS runner
28-
COPY --from=installer /app/gateway.db /app/gateway.db
28+
COPY apps/gateway/scripts/run.sh run.sh
29+
COPY --from=installer /app/sqlite/gateway.db /app/gateway.tmpl.db
2930
COPY --from=installer /app/apps/gateway/dist/ /app/dist/
3031
COPY --from=installer /app/apps/gateway/public/ /app/public/
3132
COPY --from=installer /app/apps/gateway/dist/runtime/ /runtime/
3233
COPY --from=installer /app/apps/gateway/dist/prisma/client/ /.prisma/client/
3334

3435
RUN echo '{ "type": "module" }' > package.json
3536
RUN echo '{ "type": "module" }' > /runtime/package.json
36-
CMD [ "node", "./dist/main.js" ]
37+
CMD [ "./run.sh" ]

apps/gateway/scripts/run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
DATABASE_FILE=${GATEWAY_DATABASE_URL#file:}
4+
EMPTY_DATABASE_FILE="/app/gateway.tmpl.db"
5+
6+
if [[ ! -f "$DATABASE_FILE" ]]; then
7+
cp "$EMPTY_DATABASE_FILE" "$DATABASE_FILE"
8+
fi
9+
10+
node ./dist/main.js

apps/playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "Apache-2.0",
77
"scripts": {
88
"build": "tsc && env-cmd -f ../../.env pnpm exec vite build",
9-
"deploy": "rsync -r dist/* douglasneuroinformatics.ca:/home/unrjos/www/playground.opendatacapture.org",
9+
"deploy": "rsync -r dist/* unrjos@cloud1.douglasneuroinformatics.ca:/home/unrjos/www/playground.opendatacapture.org",
1010
"dev": "NODE_ENV=development env-cmd -f ../../.env pnpm exec vite",
1111
"format": "prettier --write src",
1212
"lint": "tsc && eslint --fix src",

apps/playground/src/components/Editor/EditorPane.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export const EditorPane = React.forwardRef<EditorPaneRef, EditorPaneProps>(funct
142142
options={{
143143
automaticLayout: true,
144144
codeLens: false,
145+
colorDecorators: true,
145146
contextmenu: false,
146147
fixedOverflowWidgets: true,
147148
minimap: {
@@ -150,9 +151,13 @@ export const EditorPane = React.forwardRef<EditorPaneRef, EditorPaneProps>(funct
150151
quickSuggestions: true,
151152
quickSuggestionsDelay: 10,
152153
scrollBeyondLastLine: false,
154+
showDeprecated: true,
153155
stickyScroll: {
154156
enabled: false
155157
},
158+
suggest: {
159+
showDeprecated: false
160+
},
156161
suggestOnTriggerCharacters: true,
157162
tabCompletion: 'on',
158163
tabSize: 2

apps/playground/src/instruments/examples/form/Form-Reference/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ export default defineInstrument({
188188
}
189189
}
190190
],
191+
clientDetails: {
192+
estimatedDuration: 5,
193+
instructions: ['Please complete all questions']
194+
},
191195
details: {
192196
description: 'This example includes all possible static field variants',
193197
title: 'Reference Instrument',
194-
estimatedDuration: 5,
195-
instructions: ['Please complete all questions'],
196198
license: 'Apache-2.0'
197199
},
198200
measures: {},

apps/playground/src/instruments/examples/form/Form-With-Computed-Measures/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ export default defineInstrument({
3333
variant: 'slider'
3434
}
3535
},
36+
clientDetails: {
37+
estimatedDuration: 1,
38+
instructions: ['Please respond to all questions']
39+
},
3640
details: {
3741
description: 'This is an example of a form with computed measures',
38-
estimatedDuration: 1,
39-
instructions: ['Please respond to all questions'],
4042
license: 'Apache-2.0',
4143
title: 'Happiness Questionnaire'
4244
},

0 commit comments

Comments
 (0)