Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions payload-components/source/blocks/EmbedBasic/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export const EmbedBasic: Block = {
{
name: 'caption',
type: 'text',
admin: {
placeholder: 'Optional caption shown below the embed',
},
},
{
name: 'allowFullscreen',
Expand Down
4 changes: 4 additions & 0 deletions payload-components/source/blocks/HeroBasic/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ export const HeroBasic: Block = {
name: 'proofItems',
type: 'array',
admin: {
description: 'Add 2-4 short trust badges (e.g. SOC 2 Type II).',
initCollapsed: true,
},
fields: [
{
name: 'label',
type: 'text',
required: true,
admin: {
placeholder: 'SOC 2 Type II',
},
},
],
maxRows: 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ export const callToActionFields: Field[] = [
name: 'title',
type: 'text',
required: true,
admin: {
placeholder: 'Action-oriented headline (e.g. Start building today)',
},
},
{
name: 'description',
type: 'textarea',
admin: {
placeholder: 'A short nudge toward the primary action',
},
},
]
10 changes: 10 additions & 0 deletions payload-components/source/blocks/shared/contentFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,35 @@ export const contentFields: Field[] = [
{
name: 'eyebrow',
type: 'text',
admin: {
placeholder: 'Optional kicker shown above the title',
},
},
{
name: 'title',
type: 'text',
required: true,
admin: {
placeholder: 'Section heading',
},
},
{
name: 'paragraphs',
type: 'array',
minRows: 1,
maxRows: 4,
admin: {
description: 'One to four short paragraphs of body copy.',
initCollapsed: true,
},
fields: [
{
name: 'text',
type: 'textarea',
required: true,
admin: {
placeholder: 'A short paragraph of body copy',
},
},
],
},
Expand Down
9 changes: 9 additions & 0 deletions payload-components/source/blocks/shared/featureFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,23 @@ export const featureFields: Field[] = [
{
name: 'eyebrow',
type: 'text',
admin: {
placeholder: 'Optional kicker shown above the section title',
},
},
{
name: 'title',
type: 'text',
required: true,
admin: {
placeholder: 'Section heading for the feature group',
},
},
{
name: 'description',
type: 'textarea',
admin: {
placeholder: 'A sentence framing the features below',
},
},
]
9 changes: 9 additions & 0 deletions payload-components/source/blocks/shared/heroFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,25 @@ export const heroFields: Field[] = [
{
name: 'eyebrow',
type: 'text',
admin: {
placeholder: 'Optional kicker shown above the headline',
},
},
{
name: 'title',
type: 'text',
required: true,
admin: {
placeholder: 'Headline — the main outcome you deliver',
},
},
{
name: 'description',
type: 'textarea',
required: true,
admin: {
placeholder: 'A sentence or two expanding on the headline',
},
},
linkGroup({
overrides: {
Expand Down
16 changes: 16 additions & 0 deletions payload-components/source/blocks/shared/integrationFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ export const integrationFields: Field[] = [
name: 'heading',
type: 'text',
required: true,
admin: {
placeholder: 'Heading shown above the integrations',
},
},
{
name: 'subtext',
type: 'textarea',
admin: {
placeholder: 'Optional sentence below the heading',
},
},
{
name: 'integrations',
Expand All @@ -37,6 +43,7 @@ export const integrationFields: Field[] = [
minRows: 2,
maxRows: 12,
admin: {
description: 'Add the integrations — upload a logo and an accessible name for each.',
initCollapsed: true,
},
fields: [
Expand All @@ -50,14 +57,23 @@ export const integrationFields: Field[] = [
name: 'name',
type: 'text',
required: true,
admin: {
placeholder: 'Accessible integration name',
},
},
{
name: 'description',
type: 'textarea',
admin: {
placeholder: 'Optional one-line description',
},
},
{
name: 'href',
type: 'text',
admin: {
placeholder: 'Optional link, e.g. https://tool.com',
},
},
],
},
Expand Down
10 changes: 10 additions & 0 deletions payload-components/source/blocks/shared/logoCloudFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const logoCloudFields: Field[] = [
name: 'heading',
type: 'text',
required: true,
admin: {
placeholder: 'Heading shown above the logo wall',
},
},
{
name: 'logos',
Expand All @@ -30,6 +33,7 @@ export const logoCloudFields: Field[] = [
minRows: 2,
maxRows: 12,
admin: {
description: 'Add the brand logos — upload an image and an accessible name for each.',
initCollapsed: true,
},
fields: [
Expand All @@ -43,10 +47,16 @@ export const logoCloudFields: Field[] = [
name: 'name',
type: 'text',
required: true,
admin: {
placeholder: 'Accessible brand name (used as alt text)',
},
},
{
name: 'href',
type: 'text',
admin: {
placeholder: 'Optional link, e.g. https://brand.com',
},
},
],
},
Expand Down
15 changes: 15 additions & 0 deletions payload-components/source/blocks/shared/teamFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ export const teamFields: Field[] = [
{
name: 'eyebrow',
type: 'text',
admin: {
placeholder: 'Optional kicker shown above the title',
},
},
{
name: 'title',
type: 'text',
required: true,
admin: {
placeholder: 'Section heading',
},
},
]

Expand All @@ -41,14 +47,23 @@ export const teamMemberFields: Field[] = [
name: 'name',
type: 'text',
required: true,
admin: {
placeholder: 'Full name',
},
},
{
name: 'role',
type: 'text',
required: true,
admin: {
placeholder: 'Job title or role',
},
},
{
name: 'href',
type: 'text',
admin: {
placeholder: 'Optional profile link',
},
},
]
2 changes: 1 addition & 1 deletion tests/int/fresh-payload-smoke.int.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { loadManifest } from '../../tools/payload-components/manifest'
import {
sampleContentNeedsSmokeMedia,
writeSeedScript,
} from '../../tools/payload-components/smoke/fresh-payload-repo'
} from '../../tools/payload-components/seed/seed-script'

describe('fresh Payload smoke seed generation', () => {
const tempDirs: string[] = []
Expand Down
35 changes: 35 additions & 0 deletions tests/int/payload-components-add-command.int.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ describe('payload-components add command orchestration', () => {
})
const printHeader = vi.fn()
const runCommand = vi.fn().mockResolvedValue(undefined)
const seedCommand = vi.fn().mockResolvedValue(undefined)

vi.doMock('../../tools/payload-components/manifest', () => ({
loadManifest,
Expand Down Expand Up @@ -147,6 +148,9 @@ describe('payload-components add command orchestration', () => {
runCommand,
}
})
vi.doMock('../../tools/payload-components/commands/seed', () => ({
seedCommand,
}))

const addCommandModule = await import('../../tools/payload-components/commands/add')

Expand All @@ -165,6 +169,7 @@ describe('payload-components add command orchestration', () => {
recordInstallFailure,
recordInstalledState,
runCommand,
seedCommand,
verifyInstalledManifestFiles,
verifyInstalledPayloadFragments,
},
Expand Down Expand Up @@ -327,4 +332,34 @@ describe('payload-components add command orchestration', () => {
expect(mocks.runCommand).toHaveBeenCalledOnce()
expect(mocks.recordInstalledState).toHaveBeenCalledOnce()
})

it('writes the demo seed script after a successful install when --demo is set', async () => {
const { addCommand, mocks } = await setup()

mocks.checkDependencyRequirements
.mockResolvedValueOnce({ installed: { payload: '3.82.1' }, missing: [] })
.mockResolvedValueOnce({ installed: {}, missing: [] })

await addCommand({ componentName: 'hero-basic', cwd: '/tmp/fixture', demo: true })

expect(mocks.recordInstalledState).toHaveBeenCalledOnce()
expect(mocks.seedCommand).toHaveBeenCalledOnce()
expect(mocks.seedCommand).toHaveBeenCalledWith({
componentName: 'hero-basic',
cwd: '/tmp/fixture',
})
})

it('does not write the demo seed script by default', async () => {
const { addCommand, mocks } = await setup()

mocks.checkDependencyRequirements
.mockResolvedValueOnce({ installed: { payload: '3.82.1' }, missing: [] })
.mockResolvedValueOnce({ installed: {}, missing: [] })

await addCommand({ componentName: 'hero-basic', cwd: '/tmp/fixture' })

expect(mocks.recordInstalledState).toHaveBeenCalledOnce()
expect(mocks.seedCommand).not.toHaveBeenCalled()
})
})
Loading