global-context/services/domain/widget-config-migration.service.ts
Methods |
constructor(dateTimeContextPickerService: DateTimeContextPickerService)
|
||||||
|
Parameters :
|
| hasNoTimeContextFields | ||||||
hasNoTimeContextFields(config: object)
|
||||||
|
True when a config carries neither the new
Parameters :
Returns :
boolean
|
| migrateWidgetConfig | ||||||||||||
migrateWidgetConfig(config: T, options?: MigrateWidgetConfigOptions)
|
||||||||||||
Type parameters :
|
||||||||||||
|
Transforms legacy widget configurations into the standardized GlobalContextState format. This migration handles the transition from various legacy configuration formats to the new unified global context system. It detects which properties need updating and preserves configurations that are already in the correct format. What is migrated:
Use case: Call this on every widget configuration before rendering to ensure compatibility with the global context system, regardless of when the widget was created or last saved. Can be any object type, but should contain widget configuration fields. legacy format or preserved if already valid. Returns input unchanged if null/undefined. Example :
Parameters :
Returns :
Partial<GlobalContextState>
Configuration with all required GlobalContextState properties, either migrated from legacy format or preserved if already valid. Returns input unchanged if null/undefined. |