feat(cms): partner categories, publication permission and CMS-managed references copy (MITHOME-131)
Per the managed web operations research (PLATFM-13), a client must not be
shown as a "partner" and names/logos need written permission. Partners
now carry a required relationship category and a publication permission
(default: none) with the permission's location and review date; only
entries with written permission, a category and a logo are public.
The homepage shows clients ("Akik már minket választottak") and other
relationships in separate blocks via ReferencesSection; every partner
shows its relationship type. The section copy moved from a hard-coded
constant into the Home global (localized). The 20260929_partner_references
migration marks Angele Pihenőház as a client reference with written
permission (owner-confirmed), hides any other uncategorised entry, and
seeds the copy in hu + en. The JSON seed uses the same source.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
526f413bfd
commit
5f9a53ed18
@@ -35,6 +35,7 @@ import { fileURLToPath } from 'url'
|
||||
import { getPayload, type Payload } from 'payload'
|
||||
import config from '../src/payload.config'
|
||||
import { internalPathToPageKey } from '../src/lib/cta-link'
|
||||
import { CONFIRMED_CLIENT_REFERENCES, REFERENCES_SECTION_COPY } from '../src/migrations/20260929_partner_references'
|
||||
|
||||
import homeJson from '../src/content/pages/home.json'
|
||||
import aboutJson from '../src/content/pages/about.json'
|
||||
@@ -82,9 +83,27 @@ function buildHomeData(json: typeof homeJson) {
|
||||
},
|
||||
cta,
|
||||
serviceFeatures,
|
||||
// MITHOME-131: seeded in the default locale (hu); en comes from the migration.
|
||||
referencesSection: {
|
||||
clientsTitle: REFERENCES_SECTION_COPY.clientsTitle.hu,
|
||||
clientsSubtitle: REFERENCES_SECTION_COPY.clientsSubtitle.hu,
|
||||
partnersTitle: REFERENCES_SECTION_COPY.partnersTitle.hu,
|
||||
partnersSubtitle: REFERENCES_SECTION_COPY.partnersSubtitle.hu,
|
||||
relationshipLabels: Object.fromEntries(
|
||||
Object.entries(REFERENCES_SECTION_COPY.relationshipLabels).map(([key, copy]) => [key, copy.hu]),
|
||||
) as Record<keyof typeof REFERENCES_SECTION_COPY.relationshipLabels, string>,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/** MITHOME-131: the JSON partners are confirmed client references with written permission. */
|
||||
function partnerMeta(name: string) {
|
||||
const confirmed = CONFIRMED_CLIENT_REFERENCES.find((c) => c.name === name)
|
||||
return confirmed
|
||||
? { relationship: 'client-reference' as const, publicationPermission: 'granted' as const, permissionReference: confirmed.permissionReference }
|
||||
: { relationship: 'client-reference' as const, publicationPermission: 'none' as const }
|
||||
}
|
||||
|
||||
function buildAboutData(json: typeof aboutJson) {
|
||||
const { meta, hero, story, mission, team, cta } = json
|
||||
return {
|
||||
@@ -184,12 +203,12 @@ async function upsertPartner(payload: Payload, partner: PartnerJson) {
|
||||
await payload.update({
|
||||
collection: 'partners',
|
||||
id: existingPartner.docs[0].id,
|
||||
data: { name: partner.name, url: partner.url, logo: mediaId, _status: 'published' },
|
||||
data: { name: partner.name, url: partner.url, logo: mediaId, ...partnerMeta(partner.name), _status: 'published' },
|
||||
})
|
||||
} else {
|
||||
await payload.create({
|
||||
collection: 'partners',
|
||||
data: { name: partner.name, url: partner.url, logo: mediaId, _status: 'published' },
|
||||
data: { name: partner.name, url: partner.url, logo: mediaId, ...partnerMeta(partner.name), _status: 'published' },
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user