feat: harden content workflows and staging smoke tests
CI — Test & Build / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI — Test & Build / 🏗️ Build Docker Image (push) Blocked by required conditions
CI — Test & Build / 🐳 Docker integration & API E2E (push) Blocked by required conditions
CI — Test & Build / 🌐 Staging Playwright smoke (push) Waiting to run
CI — Test & Build / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI — Test & Build / 🏗️ Build Docker Image (push) Blocked by required conditions
CI — Test & Build / 🐳 Docker integration & API E2E (push) Blocked by required conditions
CI — Test & Build / 🌐 Staging Playwright smoke (push) Waiting to run
This commit is contained in:
@@ -23,6 +23,7 @@ import type {
|
||||
ContactPageContent,
|
||||
LegalPageContent
|
||||
} from './types'
|
||||
import { validateContent } from './schema'
|
||||
|
||||
// Import JSON files
|
||||
import commonJson from './common.json'
|
||||
@@ -33,14 +34,22 @@ import contactJson from './pages/contact.json'
|
||||
import adatvedelemJson from './pages/adatvedelem.json'
|
||||
import hasznalatiFeltetelekJson from './pages/hasznalati-feltetelek.json'
|
||||
|
||||
// Type assertions for JSON imports
|
||||
const common: CommonContent = commonJson as CommonContent
|
||||
const home: HomePageContent = homeJson as HomePageContent
|
||||
const about: AboutPageContent = aboutJson as AboutPageContent
|
||||
const services: ServicesPageContent = servicesJson as ServicesPageContent
|
||||
const contact: ContactPageContent = contactJson as ContactPageContent
|
||||
const adatvedelem: LegalPageContent = adatvedelemJson as LegalPageContent
|
||||
const hasznalatiFeltetelek: LegalPageContent = hasznalatiFeltetelekJson as LegalPageContent
|
||||
function loadValidatedContent<T>(fileKey: string, value: unknown): T {
|
||||
const result = validateContent(fileKey, value)
|
||||
if (!result.ok) {
|
||||
throw new Error(`Érvénytelen content JSON (${fileKey}): ${result.errors.join('; ')}`)
|
||||
}
|
||||
return value as T
|
||||
}
|
||||
|
||||
// Runtime validation prevents malformed JSON from silently reaching the UI.
|
||||
const common = loadValidatedContent<CommonContent>('common', commonJson)
|
||||
const home = loadValidatedContent<HomePageContent>('home', homeJson)
|
||||
const about = loadValidatedContent<AboutPageContent>('about', aboutJson)
|
||||
const services = loadValidatedContent<ServicesPageContent>('services', servicesJson)
|
||||
const contact = loadValidatedContent<ContactPageContent>('contact', contactJson)
|
||||
const adatvedelem = loadValidatedContent<LegalPageContent>('adatvedelem', adatvedelemJson)
|
||||
const hasznalatiFeltetelek = loadValidatedContent<LegalPageContent>('hasznalatiFeltetelek', hasznalatiFeltetelekJson)
|
||||
|
||||
// Combined content object
|
||||
export const content: SiteContent = {
|
||||
|
||||
Reference in New Issue
Block a user