feat static pages system with dynamic footer and safe html rendering
This commit is contained in:
@@ -7,6 +7,7 @@ import { NavigationConfig } from './navigation.model';
|
||||
import { PageConfig } from './page.model';
|
||||
import { PermissionsConfig } from './permissions.model';
|
||||
import { SeoConfig } from './seo.model';
|
||||
import { StaticPagesConfig } from './static-page.model';
|
||||
import { TenantConfig } from './tenant.model';
|
||||
import { ThemeConfig } from './theme.model';
|
||||
|
||||
@@ -24,4 +25,5 @@ export interface BootstrapConfig {
|
||||
permissions: PermissionsConfig;
|
||||
navigation: NavigationConfig;
|
||||
pages: PageConfig[];
|
||||
staticPages?: StaticPagesConfig;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ export * from './page.model';
|
||||
export * from './permissions.model';
|
||||
export * from './section.model';
|
||||
export * from './seo.model';
|
||||
export * from './static-page.model';
|
||||
export * from './tenant.model';
|
||||
export * from './theme.model';
|
||||
export * from './widget.model';
|
||||
|
||||
@@ -1,15 +1,37 @@
|
||||
export interface NavigationLocalizedText {
|
||||
[locale: string]: string;
|
||||
}
|
||||
|
||||
export interface NavigationItemConfig {
|
||||
id: string;
|
||||
labelKey: string;
|
||||
route: string;
|
||||
labelKey?: string;
|
||||
label?: string | NavigationLocalizedText;
|
||||
route?: string;
|
||||
type?: string;
|
||||
key?: string;
|
||||
icon?: string;
|
||||
order: number;
|
||||
order?: number;
|
||||
visible?: boolean;
|
||||
visibleWhenFlags?: string[];
|
||||
children?: NavigationItemConfig[];
|
||||
}
|
||||
|
||||
export interface FooterNavigationItemConfig {
|
||||
type: string;
|
||||
key?: string;
|
||||
label?: string | NavigationLocalizedText;
|
||||
labelKey?: string;
|
||||
route?: string;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
export interface FooterNavigationGroupConfig {
|
||||
groupTitle?: string | NavigationLocalizedText;
|
||||
items: FooterNavigationItemConfig[];
|
||||
}
|
||||
|
||||
export interface NavigationConfig {
|
||||
header: NavigationItemConfig[];
|
||||
footer: NavigationItemConfig[];
|
||||
footer: NavigationItemConfig[] | FooterNavigationGroupConfig[];
|
||||
sidebar?: NavigationItemConfig[];
|
||||
}
|
||||
|
||||
36
src/app/shared/models/config/static-page.model.ts
Normal file
36
src/app/shared/models/config/static-page.model.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export interface LocalizedHtmlContent {
|
||||
[locale: string]: string;
|
||||
}
|
||||
|
||||
export interface LocalizedTextContent {
|
||||
[locale: string]: string;
|
||||
}
|
||||
|
||||
export interface StaticPageConfig {
|
||||
route: string;
|
||||
title: LocalizedTextContent;
|
||||
content: LocalizedHtmlContent;
|
||||
seo?: {
|
||||
title?: LocalizedTextContent;
|
||||
description?: LocalizedTextContent;
|
||||
robots?: string;
|
||||
};
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
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;
|
||||
route: string;
|
||||
title: string;
|
||||
html: string;
|
||||
}
|
||||
Reference in New Issue
Block a user