File tree Expand file tree Collapse file tree 6 files changed +25
-16
lines changed
payload-cms/plugins/form/hooks Expand file tree Collapse file tree 6 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ VAPID_PRIVATE_KEY=KnO8-qCBi_rTMiSD29_eiDUgvODHX7p8zqthFCWXBsw
5757# Feature Toggles
5858# ###################################
5959FEATURE_ENABLE_APP_FEATURE = true
60+ FEATURE_ENABLE_WORKFLOWS = true
6061
6162# ###################################
6263# public env variables
Original file line number Diff line number Diff line change 11{
22 "name" : " conveniat27" ,
3- "version" : " 0.42.2 " ,
3+ "version" : " 0.42.3 " ,
44 "description" : " The official website of conveniat27" ,
55 "license" : " MIT" ,
66 "author" : " Cyrill Püntener v/o JPG (cyrill.puentener@cevi.ch)" ,
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ export const environmentVariables = createEnv({
4545 SMTP_PASS : z . string ( ) . optional ( ) ,
4646 VAPID_PRIVATE_KEY : z . string ( ) . min ( 5 ) ,
4747 FEATURE_ENABLE_APP_FEATURE : z . string ( ) . transform ( ( value ) => value === 'true' ) ,
48+ FEATURE_ENABLE_WORKFLOWS : z
49+ . string ( )
50+ . transform ( ( value ) => value === 'true' )
51+ . default ( 'true' ) ,
4852
4953 // Map Config
5054 CAMP_MAP_INITIAL_ZOOM : z . coerce . number ( ) ,
Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ export interface UseFormStepsReturn {
2121
2222const scrollToTop = ( formId ?: string ) : void => {
2323 if ( typeof globalThis !== 'undefined' ) {
24- const element = formId ? document . querySelector ( formId ) : undefined ;
24+ const element = formId ? document . querySelector ( `# ${ CSS . escape ( formId ) } ` ) : undefined ;
2525 if ( element ) {
26- // scroll to element - 60px to account for sticky nav
26+ // scroll to element - 100px to account for sticky nav
2727 const topPos = element . getBoundingClientRect ( ) . top + window . pageYOffset - 100 ;
2828 window . scrollTo ( { top : topPos , behavior : 'smooth' } ) ;
2929 }
Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ export const linkJobSubmission: CollectionBeforeChangeHook<FormSubmission> = asy
9898 return data ;
9999 }
100100
101- const submissionData = ( data . submissionData as SubmissionField [ ] | undefined ) ?? [ ] ;
101+ const submissionData = Array . isArray ( data . submissionData )
102+ ? ( data . submissionData as SubmissionField [ ] )
103+ : [ ] ;
102104
103105 // If a job selection is within an optional block and not selected, its field
104106 // is completely missing from submissionData. Append missing fields as empty.
Original file line number Diff line number Diff line change @@ -137,18 +137,20 @@ const jobsConfig: JobsConfig = {
137137 checkHitobitoApprovalsTask ,
138138 ] ,
139139 workflows : [ registrationWorkflow , brevoContactWorkflow ] ,
140- autoRun : [
141- {
142- cron : '*/10 * * * * *' , // Every 10 seconds
143- limit : 10 ,
144- queue : 'workflows' ,
145- } ,
146- {
147- cron : '*/10 * * * * *' , // Every 10 seconds
148- limit : 10 ,
149- queue : 'default' ,
150- } ,
151- ] ,
140+ autoRun : env . FEATURE_ENABLE_WORKFLOWS
141+ ? [
142+ {
143+ cron : '*/10 * * * * *' , // Every 10 seconds
144+ limit : 10 ,
145+ queue : 'workflows' ,
146+ } ,
147+ {
148+ cron : '*/10 * * * * *' , // Every 10 seconds
149+ limit : 10 ,
150+ queue : 'default' ,
151+ } ,
152+ ]
153+ : [ ] ,
152154} ;
153155
154156export const payloadConfig : RoutableConfig = {
You can’t perform that action at this time.
0 commit comments