refactor: finalize bootstrap-driven layout and widget runtime
This commit is contained in:
@@ -2,6 +2,8 @@ import { ApiEndpointsConfig } from './api-endpoints.model';
|
||||
import { BrandingConfig } from './branding.model';
|
||||
import { CompanyConfig } from './company.model';
|
||||
import { FeatureFlagsConfig } from './feature-flags.model';
|
||||
import { FooterConfig } from './footer-config.model';
|
||||
import { PlatformLayoutConfig } from './layout.model';
|
||||
import { LocalizationConfig } from './localization.model';
|
||||
import { NavigationConfig } from './navigation.model';
|
||||
import { PageConfig } from './page.model';
|
||||
@@ -10,6 +12,7 @@ import { SeoConfig } from './seo.model';
|
||||
import { StaticPagesConfig } from './static-page.model';
|
||||
import { TenantConfig } from './tenant.model';
|
||||
import { ThemeConfig } from './theme.model';
|
||||
import { WidgetRegistryConfig } from './widget-registry.model';
|
||||
|
||||
export interface BootstrapConfig {
|
||||
schemaVersion: string;
|
||||
@@ -23,7 +26,10 @@ export interface BootstrapConfig {
|
||||
localization: LocalizationConfig;
|
||||
seo: SeoConfig;
|
||||
permissions: PermissionsConfig;
|
||||
layout?: PlatformLayoutConfig;
|
||||
navigation: NavigationConfig;
|
||||
footer?: FooterConfig;
|
||||
pages: PageConfig[];
|
||||
staticPages?: StaticPagesConfig;
|
||||
widgetRegistry?: WidgetRegistryConfig;
|
||||
}
|
||||
|
||||
15
src/app/shared/models/config/footer-config.model.ts
Normal file
15
src/app/shared/models/config/footer-config.model.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { LocalizedTextContent } from './static-page.model';
|
||||
|
||||
export interface FooterPaymentIconConfig {
|
||||
src: string;
|
||||
alt: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface FooterConfig {
|
||||
logoUrl?: string;
|
||||
paymentIcons?: FooterPaymentIconConfig[];
|
||||
copyrightText?: string | LocalizedTextContent;
|
||||
legalPageKeys?: string[];
|
||||
}
|
||||
@@ -3,6 +3,8 @@ export * from './bootstrap-config.model';
|
||||
export * from './branding.model';
|
||||
export * from './company.model';
|
||||
export * from './feature-flags.model';
|
||||
export * from './footer-config.model';
|
||||
export * from './layout.model';
|
||||
export * from './localization.model';
|
||||
export * from './navigation.model';
|
||||
export * from './page.model';
|
||||
@@ -13,3 +15,4 @@ export * from './static-page.model';
|
||||
export * from './tenant.model';
|
||||
export * from './theme.model';
|
||||
export * from './widget.model';
|
||||
export * from './widget-registry.model';
|
||||
|
||||
6
src/app/shared/models/config/layout.model.ts
Normal file
6
src/app/shared/models/config/layout.model.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type PlatformLayoutType = 'default' | 'sidebar-left' | 'carousel-home' | 'minimal' | string;
|
||||
|
||||
export interface PlatformLayoutConfig {
|
||||
type: PlatformLayoutType;
|
||||
options?: Record<string, unknown>;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { SectionConfig } from './section.model';
|
||||
import { PlatformLayoutConfig } from './layout.model';
|
||||
|
||||
export interface PageRouteConfig {
|
||||
path: string;
|
||||
@@ -10,7 +11,7 @@ export interface PageConfig {
|
||||
key: string;
|
||||
title: string;
|
||||
route: PageRouteConfig;
|
||||
layout: string;
|
||||
layout: string | PlatformLayoutConfig;
|
||||
sections: SectionConfig[];
|
||||
seoKey?: string;
|
||||
featureFlag?: string;
|
||||
|
||||
3
src/app/shared/models/config/widget-registry.model.ts
Normal file
3
src/app/shared/models/config/widget-registry.model.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface WidgetRegistryConfig {
|
||||
manifestUrl: string;
|
||||
}
|
||||
@@ -4,10 +4,19 @@ export interface WidgetActionConfig {
|
||||
payload?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface WidgetVisibilityConfig {
|
||||
desktop?: boolean;
|
||||
tablet?: boolean;
|
||||
mobile?: boolean;
|
||||
}
|
||||
|
||||
export interface WidgetConfig {
|
||||
id: string;
|
||||
type: string;
|
||||
version: string;
|
||||
order?: number;
|
||||
padding?: string;
|
||||
visibility?: WidgetVisibilityConfig;
|
||||
props: Record<string, unknown>;
|
||||
actions?: Record<string, WidgetActionConfig>;
|
||||
featureFlag?: string;
|
||||
|
||||
Reference in New Issue
Block a user