File tree Expand file tree Collapse file tree 5 files changed +10
-2
lines changed
Expand file tree Collapse file tree 5 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ API_BASE_URL=http://localhost:5500
9090VITE_DEV_NETWORK_LATENCY = 0
9191# Whether to force clear queries when the pathname changes
9292VITE_DEV_FORCE_CLEAR_QUERY_CACHE = false
93+ # Whether to disable tutorial in dev mode
94+ VITE_DEV_DISABLE_TUTORIAL = false
9395# Plausable analytics config (optional, set both to an empty string to disable)
9496PLAUSIBLE_BASE_URL =
9597PLAUSIBLE_WEB_DATA_DOMAIN =
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const $Config = z.object({
1010 } )
1111 . optional ( ) ,
1212 dev : z . object ( {
13+ disableTutorial : $BooleanString . optional ( ) ,
1314 isBypassAuthEnabled : $BooleanString . optional ( ) ,
1415 isForceClearQueryCacheEnabled : $BooleanString . optional ( ) ,
1516 networkLatency : z . coerce . number ( ) . int ( ) . nonnegative ( ) . optional ( ) ,
@@ -38,6 +39,7 @@ export const config = await $Config
3839 }
3940 : undefined ,
4041 dev : {
42+ disableTutorial : import . meta. env . VITE_DEV_DISABLE_TUTORIAL ,
4143 isBypassAuthEnabled : import . meta. env . VITE_DEV_BYPASS_AUTH ,
4244 isForceClearQueryCacheEnabled : import . meta. env . VITE_DEV_FORCE_CLEAR_QUERY_CACHE ,
4345 networkLatency : import . meta. env . VITE_DEV_NETWORK_LATENCY ,
Original file line number Diff line number Diff line change 1+ import { reviver } from '@douglasneuroinformatics/libjs' ;
12import { $InstrumentRecord } from '@opendatacapture/schemas/instrument-records' ;
23import type { InstrumentRecordQueryParams } from '@opendatacapture/schemas/instrument-records' ;
34import { useQuery } from '@tanstack/react-query' ;
@@ -18,7 +19,8 @@ export const useInstrumentRecords = (
1819 enabled,
1920 queryFn : async ( ) => {
2021 const response = await axios . get ( '/v1/instrument-records' , {
21- params
22+ params,
23+ transformResponse : [ ( data : string ) => JSON . parse ( data , reviver ) as unknown ]
2224 } ) ;
2325 return $InstrumentRecord . array ( ) . parseAsync ( response . data ) ;
2426 } ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import type { NavigateOptions } from 'react-router-dom';
1212import { match } from 'ts-pattern' ;
1313import type { Promisable } from 'type-fest' ;
1414
15+ import { config } from '@/config' ;
1516import type { StartSessionFormData } from '@/features/session/components/StartSessionForm' ;
1617import { useIsDesktop } from '@/hooks/useIsDesktop' ;
1718import { useAppStore } from '@/store' ;
@@ -429,7 +430,7 @@ export const WalkthroughProvider: React.FC<{ children: React.ReactElement }> = (
429430 const isDesktop = useIsDesktop ( ) ;
430431
431432 useEffect ( ( ) => {
432- if ( isDisclaimerAccepted && ! isWalkthroughComplete ) {
433+ if ( isDisclaimerAccepted && ! isWalkthroughComplete && ! ( import . meta . env . DEV && config . dev . disableTutorial ) ) {
433434 setIsWalkthroughOpen ( true ) ;
434435 }
435436 } , [ isDisclaimerAccepted , isWalkthroughComplete ] ) ;
Original file line number Diff line number Diff line change 33// All of these should be undefined in production
44interface ImportMetaDevEnv {
55 readonly VITE_DEV_BYPASS_AUTH ?: string ;
6+ readonly VITE_DEV_DISABLE_TUTORIAL ?: string ;
67 readonly VITE_DEV_FORCE_CLEAR_QUERY_CACHE ?: string ;
78 readonly VITE_DEV_NETWORK_LATENCY ?: string ;
89 readonly VITE_DEV_PASSWORD ?: string ;
You can’t perform that action at this time.
0 commit comments