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
@@ -17,6 +17,7 @@ import config from '@payload-config'
|
||||
import type { Locale } from './i18n'
|
||||
import { resolveCtaHref, type CtaLink } from './cta-link'
|
||||
import { readGated } from './translation-gate'
|
||||
import { publicPartners, type PartnerView } from './partner-references'
|
||||
|
||||
let cached: ReturnType<typeof getPayload> | undefined
|
||||
|
||||
@@ -105,19 +106,11 @@ export async function getLegalPage(slug: 'adatvedelem' | 'hasznalati-feltetelek'
|
||||
})
|
||||
}
|
||||
|
||||
export type PartnerView = { name: string; url: string; logo: { url: string; alt: string } }
|
||||
export type { PartnerView } from './partner-references'
|
||||
|
||||
/** MITHOME-131: only entries with a written permission, a category and a logo. */
|
||||
export async function getPartners(): Promise<PartnerView[]> {
|
||||
const payload = await payloadClient()
|
||||
const result = await payload.find({ collection: 'partners', limit: 100, sort: 'name' })
|
||||
return result.docs
|
||||
.filter((doc) => typeof doc.logo === 'object' && doc.logo?.url)
|
||||
.map((doc) => ({
|
||||
name: doc.name,
|
||||
url: doc.url,
|
||||
logo: {
|
||||
url: (doc.logo as { url: string }).url,
|
||||
alt: (doc.logo as { alt?: string }).alt ?? doc.name,
|
||||
},
|
||||
}))
|
||||
const result = await payload.find({ collection: 'partners', limit: 100, sort: 'name', depth: 1 })
|
||||
return publicPartners(result.docs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user