Files
marketplaces/src/app/shared/models/config/static-page.model.ts
sdarbinyan b31c75214d feat(builder): implement professional content management experience
Content dashboard with real published/draft/SEO-health/completion metrics and a recommended-next-action; static pages editor rebuilt as visual page cards (icon/status/SEO badge/last edited) with legal pages surfaced first; full-page editor grouped into Content/SEO/Sharing/Advanced tabs, raw HTML moved behind an Advanced disclosure; hero image now supports alt text and caption; content-health-widget is a reusable checklist+completion component.
2026-07-18 11:02:26 +04:00

105 lines
2.8 KiB
TypeScript

export interface LocalizedHtmlContent {
[locale: string]: string;
}
export interface LocalizedTextContent {
[locale: string]: string;
}
export interface StaticPageSeoConfig {
title?: string | LocalizedTextContent;
description?: string | LocalizedTextContent;
keywords?: string;
canonical?: string;
ogTitle?: string | LocalizedTextContent;
ogDescription?: string | LocalizedTextContent;
ogImage?: string;
robots?: string;
}
export interface StaticPageTranslationConfig {
title?: string;
html?: string;
seo?: {
title?: string;
description?: string;
keywords?: string;
canonical?: string;
ogTitle?: string;
ogDescription?: string;
ogImage?: string;
robots?: string;
};
}
export interface StaticPageConfig {
id: string;
slug: string;
title: string | LocalizedTextContent;
showInFooter?: boolean;
showInHeader?: boolean;
showInSitemap?: boolean;
icon?: string;
order?: number;
visibility?: {
desktop?: boolean;
tablet?: boolean;
mobile?: boolean;
};
requiresAuthentication?: boolean;
footerGroup?: string;
translations?: Record<string, StaticPageTranslationConfig>;
html?: string | LocalizedHtmlContent;
seo?: StaticPageSeoConfig;
visible?: boolean;
route?: string;
content?: LocalizedHtmlContent;
/** Master on/off switch. Kept in sync with `visible` on serialize; a disabled page never resolves on the storefront regardless of `status`. */
enabled?: boolean;
/** Per-page publish lifecycle, independent of the whole-bootstrap draft/publish cycle. A `draft` page never resolves on the storefront even when the surrounding bootstrap is published. */
status?: 'draft' | 'published';
customTemplate?: string;
heroImage?: string;
heroImageAlt?: string;
heroImageCaption?: string;
thumbnail?: string;
gallery?: string[];
/** ISO timestamp set whenever the page is saved; drives the CMS content dashboard's last-edited/health metrics. */
updatedAt?: string;
}
export interface LegacyStaticPageConfig {
key: string;
route: string | { path: string; exact?: boolean };
title?: string | LocalizedTextContent;
content?: string | LocalizedHtmlContent | { value?: string; contentType?: string; source?: string };
visible?: boolean;
}
export type StaticPagesConfig = Record<string, StaticPageConfig> | LegacyStaticPageConfig[];
export interface ResolvedStaticPage {
key: string;
id: string;
slug: string;
route: string;
title: string;
html: string;
icon?: string;
requiresAuthentication?: boolean;
seo?: {
title?: string;
description?: string;
keywords?: string;
canonical?: string;
ogTitle?: string;
ogDescription?: string;
ogImage?: string;
robots?: string;
};
customTemplate?: string;
heroImage?: string;
thumbnail?: string;
gallery?: string[];
}