Files
ipal-kit/reference/src/globals/Header.ts
T
Radosław SmolińskiandClaude Opus 5.5 4e68b7e44a 1.17.2 (owner's Q1-Q3): form submissions over REST for staff only; Payload's job queue for an admin or Bearer CRON_SECRET; doctor visitor-writes; explicit write rules on the reference site
- form-submissions create: a staff account with its second factor (formSubmissionOverrides.access.create keeps the way back)
- jobsRunAccess (default on when the project writes no jobs.access.run): admin with the second factor or Bearer CRON_SECRET (16+); start-up note when the secret is missing; jobsRunAccess: false keeps Payload's default
- iapl-doctor deep rule visitor-writes: entities a visitor login account may write, asked by behaviour
- reference: Pages, Posts, CaseStudies, Media, Header, Footer, Company get adminOrEditor write rules
- closed doors: submissions, pages, media, header, company closed for customers; the fixture's job queue refused without the secret, run with it
- route snapshot reasons, docs, AGENT.md, skills, changelog draft 1.17.2

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:44:18 +01:00

35 lines
1.4 KiB
TypeScript

import type { GlobalConfig } from 'payload'
import { adminOrEditor, buildGlobalRevalidateHook, buildLinkField, buildLinksField, rowLabel } from '@intecion/ipal-kit'
import { revalidatePath } from 'next/cache'
/** iapl-nav: menu with one submenu level, a CTA button, the mobile menu label. Logo comes from Site settings. */
export const Header: GlobalConfig = {
slug: 'header',
// write rules of its own: Payload's default is "any signed-in account" — a visitor login collection would reach it (security.md "Visitor accounts")
access: { read: () => true, update: adminOrEditor },
fields: [
{
name: 'navItems',
type: 'array',
admin: { components: rowLabel('link.label', 'Menu item'), initCollapsed: true },
fields: [
buildLinkField({ appearances: false }),
{
name: 'subItems',
type: 'array',
admin: { components: rowLabel('link.label', 'Submenu item'), initCollapsed: true },
fields: [buildLinkField({ appearances: false })],
labels: { plural: 'Submenu', singular: 'Submenu item' },
maxRows: 10,
},
],
labels: { plural: 'Menu items', singular: 'Menu item' },
maxRows: 8,
},
buildLinksField({ maxRows: 1 }),
{ name: 'menuLabel', type: 'text', admin: { description: 'Accessible label of the mobile menu button, e.g. "Menu".' }, localized: true },
],
hooks: { afterChange: [buildGlobalRevalidateHook({ revalidatePath })] },
}