mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-16 03:03:06 +00:00
- redesign petition page layout with responsive hero, content section, and form card () - refactor frontend theming setup: - add with in frontend layout - migrate/clean global style tokens and base styles in - adjust header/social visuals for theme-aware rendering (, , , , ) - expand petition form with additional fields and new UI primitives (native select, textarea, button, state/city flow) (, , , ) - add new Payload collections and wire them into config: , , (, , , , ) - update petition collection admin grouping and project config (, , ) - add supporting dependency/lockfile updates and workspace tooling tweaks (, , , )
66 lines
1.2 KiB
TypeScript
66 lines
1.2 KiB
TypeScript
import { revalidateDocumentById } from '@/utilities/documents'
|
|
import type { CollectionConfig } from 'payload'
|
|
|
|
const slug = 'petition'
|
|
|
|
export const Petition: CollectionConfig<typeof slug> = {
|
|
slug,
|
|
labels: {
|
|
singular: 'Abaixo-assinado',
|
|
plural: 'Abaixo-assinados',
|
|
},
|
|
admin: {
|
|
group: 'Abaixo-assinados',
|
|
useAsTitle: 'title',
|
|
livePreview: {
|
|
url: ({ data }) => `/abaixo-assinado/${data.id}`,
|
|
},
|
|
},
|
|
versions: {
|
|
drafts: {
|
|
autosave: {
|
|
interval: 1000,
|
|
},
|
|
schedulePublish: true,
|
|
},
|
|
maxPerDoc: 5,
|
|
},
|
|
access: {
|
|
read: () => true,
|
|
},
|
|
hooks: {
|
|
beforeChange: [({ data }) => revalidateDocumentById(slug, data.id)],
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'id',
|
|
type: 'text',
|
|
label: 'Trecho Identificador da URL',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'title',
|
|
type: 'text',
|
|
label: 'Título',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'subtitle',
|
|
type: 'text',
|
|
label: 'Subtítulo',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'enabled',
|
|
type: 'checkbox',
|
|
label: 'Ativo',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'body',
|
|
type: 'richText',
|
|
label: 'Corpo',
|
|
required: true,
|
|
},
|
|
],
|
|
}
|