feat: Update version to 3.0.1 and enhance portal settings configuration

This commit is contained in:
Torsten Brendgen
2026-08-18 15:09:56 +02:00
parent 490e9adbd8
commit 6f548362e2
11 changed files with 58 additions and 13 deletions
@@ -5,7 +5,8 @@ import {
IBrandingNormalizationResult,
ICssFile,
ICustomBrandingApplicationCustomizerProperties,
ICustomBrandingConfig
ICustomBrandingConfig,
IPortalSettingsDescriptor
} from './BrandingTypes';
export const BrandingSchemaVersion: number = 2;
@@ -59,6 +60,7 @@ export function normalizeBrandingConfig(
const config: ICustomBrandingConfig = {
schemaVersion: BrandingSchemaVersion,
portalSettings: createPortalSettingsDescriptor(),
enabled: raw.enabled !== false,
debug: raw.debug === true,
allowedCssHosts: allowedCssHosts,
@@ -128,6 +130,7 @@ export function sanitizeStyle(propertyName: string, value: string): string | und
function createEmptyConfig(): ICustomBrandingConfig {
return {
schemaVersion: BrandingSchemaVersion,
portalSettings: createPortalSettingsDescriptor(),
enabled: true,
debug: false,
allowedCssHosts: [],
@@ -137,6 +140,14 @@ function createEmptyConfig(): ICustomBrandingConfig {
};
}
function createPortalSettingsDescriptor(): IPortalSettingsDescriptor {
return {
providerKey: 'custombranding',
contractVersion: 1,
minimumPortalSettingsVersion: '3.0.0'
};
}
function normalizeHosts(value: any): string[] {
if (!Array.isArray(value)) {
return [];
@@ -303,4 +314,3 @@ function hasKeys(value: { [key: string]: string }): boolean {
}
return false;
}
@@ -17,8 +17,15 @@ export interface IPlaceholderConfig {
elements: IBrandingElement[];
}
export interface IPortalSettingsDescriptor {
providerKey: 'custombranding';
contractVersion: number;
minimumPortalSettingsVersion: string;
}
export interface ICustomBrandingConfig {
schemaVersion: number;
portalSettings: IPortalSettingsDescriptor;
enabled: boolean;
debug: boolean;
allowedCssHosts: string[];
@@ -29,6 +36,7 @@ export interface ICustomBrandingConfig {
export interface ICustomBrandingApplicationCustomizerProperties {
schemaVersion?: number;
portalSettings?: IPortalSettingsDescriptor;
enabled?: boolean;
debug?: boolean;
allowedCssHosts?: string[];
@@ -42,4 +50,3 @@ export interface IBrandingNormalizationResult {
config: ICustomBrandingConfig;
warnings: string[];
}