Add migration scripts and preload participation awards script
- Created migration index file to manage database migrations. - Added script to preload participation awards and related blog posts into the CMS. - Introduced new types and default data for application phases. - Added award articles data structure for the upcoming awards.
This commit is contained in:
@@ -76,6 +76,7 @@ const ctaGroup = (name: string, label: string, labelDefault: string, urlDefault:
|
||||
type: 'group',
|
||||
fields: linkGroup(labelDefault, urlDefault),
|
||||
})
|
||||
const awardCardDefaults = participationContent.awardsGrid.cards.map(({ imageFilename: _imageFilename, ...card }) => card)
|
||||
|
||||
export const participationFields: Field[] = [
|
||||
{
|
||||
@@ -153,31 +154,9 @@ export const participationFields: Field[] = [
|
||||
ctaGroup('nudgeCta', 'Bottom CTA', participationContent.eligibility.nudgeCta.label, participationContent.eligibility.nudgeCta.url),
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'evaluation',
|
||||
label: '04 · Criteria / evaluation section',
|
||||
type: 'group',
|
||||
admin: sectionAdmin('Navy evaluation section with image, link, and criteria grid.'),
|
||||
fields: [
|
||||
uploadField('image', 'Image', `Current frontend image: /images/${participationContent.evaluation.imageFilename}`),
|
||||
text('imageAlt', 'Image alt text', participationContent.evaluation.imageAlt),
|
||||
text('eyebrow', 'Eyebrow', participationContent.evaluation.eyebrow),
|
||||
textarea('heading', 'Heading', participationContent.evaluation.heading),
|
||||
textarea('body', 'Body copy', participationContent.evaluation.body),
|
||||
ctaGroup('link', 'External criteria link', participationContent.evaluation.link.label, participationContent.evaluation.link.url),
|
||||
{
|
||||
name: 'criteria',
|
||||
label: 'Evaluation criteria',
|
||||
type: 'array',
|
||||
dbName: 'eval_crit',
|
||||
defaultValue: participationContent.evaluation.criteria,
|
||||
fields: factFields,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'applicationWays',
|
||||
label: '05 · Application paths',
|
||||
label: '04 · Application paths',
|
||||
type: 'group',
|
||||
admin: sectionAdmin('Cream section explaining proposal, self-application, and special award paths.'),
|
||||
fields: [
|
||||
@@ -236,7 +215,7 @@ export const participationFields: Field[] = [
|
||||
},
|
||||
{
|
||||
name: 'datesBanner',
|
||||
label: '06 · Dates banner',
|
||||
label: '05 · Dates banner',
|
||||
type: 'group',
|
||||
admin: sectionAdmin('Gold important-dates banner. Mobile and desktop labels differ slightly in the current design.'),
|
||||
fields: [
|
||||
@@ -260,6 +239,33 @@ export const participationFields: Field[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'awardsGrid',
|
||||
label: '06 · Awards grid',
|
||||
type: 'group',
|
||||
admin: sectionAdmin('Three-column awards grid rendered directly after the dates banner.'),
|
||||
fields: [
|
||||
text('eyebrow', 'Eyebrow', participationContent.awardsGrid.eyebrow),
|
||||
textarea('heading', 'Heading', participationContent.awardsGrid.heading),
|
||||
textarea('description', 'Intro paragraph', participationContent.awardsGrid.description),
|
||||
{
|
||||
name: 'cards',
|
||||
label: 'Award cards',
|
||||
type: 'array',
|
||||
dbName: 'award_cards',
|
||||
defaultValue: awardCardDefaults,
|
||||
fields: [
|
||||
text('label', 'Card label'),
|
||||
uploadField('image', 'Card image'),
|
||||
text('imageAlt', 'Image alt text'),
|
||||
textarea('title', 'Title'),
|
||||
textarea('description', 'Description'),
|
||||
ctaGroup('articleCta', 'Article CTA', 'Artikel lesen', '/presse'),
|
||||
ctaGroup('mailtoCta', 'Mail CTA', 'Kontakt aufnehmen', 'mailto:info@bmp-bayern.de'),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'applicationForm',
|
||||
label: '07 · Application form wrapper',
|
||||
|
||||
Reference in New Issue
Block a user