fix: resolve contact form placeholders, restore process block layout, and fix testimonials carousel scroll logic

This commit is contained in:
MichalC
2026-09-17 22:25:25 +02:00
parent 7cc68b9f36
commit ab4c5c83dd
91 changed files with 4790 additions and 319 deletions
+47
View File
@@ -0,0 +1,47 @@
import { getPayload } from 'payload'
import configPromise from '../src/payload.config'
async function run() {
const payload = await getPayload({ config: configPromise })
for (const locale of ['pl', 'de']) {
const pages = await payload.find({
collection: 'pages',
locale: locale as 'pl' | 'de',
where: { slug: { equals: 'kontakt' } }
})
if (pages.docs.length > 0) {
const page = pages.docs[0];
const formBlock = page.layout?.find(b => b.blockType === 'contactSection');
if (formBlock && formBlock.form) {
// Fetch the form
const formId = typeof formBlock.form === 'object' ? formBlock.form.id : formBlock.form;
console.log(`\n=== FORMULARZ PODPIĘTY POD /${locale}/kontakt (ID: ${formId}) ===`);
const form = await payload.findByID({
collection: 'forms',
id: formId as number,
locale: locale as 'pl' | 'de',
});
const serviceField = form.fields?.find(f => f.name === 'service' && f.blockType === 'select');
console.log(`POLE SERVICE OPTIONS (LOCALE: ${locale}):`);
console.log(JSON.stringify(serviceField?.options, null, 2));
// Let's also check placeholders and other texts for step 5
console.log(`\nPOZOSTAŁE POLA (LOCALE: ${locale}):`);
form.fields?.forEach(f => {
if (f.blockType !== 'select') {
const placeholderValue = f.defaultValue || (f.name === 'email' ? (f.label === 'Adres e-mail' ? '[email protected]' : '[email protected]') : '');
console.log(`- ${f.name} (${f.blockType}): label="${f.label}", placeholder="${placeholderValue}"`);
}
});
}
}
}
process.exit(0);
}
run().catch(console.error);