feat: Update version to 3.0.1 and enhance portal settings configuration
This commit is contained in:
@@ -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[];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user