Skip to content

Commit f21876a

Browse files
authored
Version 0.42.3: hotfix
fixes a query selector bug
2 parents 5d79e45 + a16b100 commit f21876a

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ VAPID_PRIVATE_KEY=KnO8-qCBi_rTMiSD29_eiDUgvODHX7p8zqthFCWXBsw
5757
# Feature Toggles
5858
####################################
5959
FEATURE_ENABLE_APP_FEATURE=true
60+
FEATURE_ENABLE_WORKFLOWS=true
6061

6162
####################################
6263
# public env variables

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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)",

src/config/environment-variables.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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(),

src/features/payload-cms/components/form/hooks/use-form-steps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export interface UseFormStepsReturn {
2121

2222
const 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
}

src/features/payload-cms/payload-cms/plugins/form/hooks/link-job-submission.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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.

src/features/payload-cms/payload.config.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff 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

154156
export const payloadConfig: RoutableConfig = {

0 commit comments

Comments
 (0)