global-context/services/domain/widget-control.service.ts
Service responsible for managing widget-level control settings and their interaction with dashboard-level controls. Handles the resolution of settings based on display mode, link states, and refresh options.
Key responsibilities:
Methods |
| getConfigSettingsFromWidgetControls | ||||||||||||||||
getConfigSettingsFromWidgetControls(controls: WidgetControls, displayMode: GlobalContextDisplayMode, refreshOption: RefreshOption | string)
|
||||||||||||||||
|
Extracts configuration settings from widget controls for the specified display mode and refresh option. Applies fallback logic for invalid refresh options, defaulting to LIVE mode.
Parameters :
Returns :
Partial<GlobalContextSettings>
Configuration settings for the specified mode and refresh option |
| getDefaultLinksFromControls | ||||||||||||||||
getDefaultLinksFromControls(controls: WidgetControls, displayMode: GlobalContextDisplayMode, refreshOption: RefreshOption | string)
|
||||||||||||||||
|
Extracts default link states from widget controls for the specified display mode and refresh option. Applies fallback logic for invalid refresh options, defaulting to LIVE mode.
Parameters :
Returns :
LinkStatesMap
Default link states for the specified mode and refresh option |
| getInlineSettingsFromWidgetControls | ||||||||||||||||
getInlineSettingsFromWidgetControls(controls: WidgetControls, displayMode: GlobalContextDisplayMode, refreshOption: RefreshOption | string)
|
||||||||||||||||
|
Extracts inline settings from widget controls for the specified display mode and refresh option. Applies fallback logic for invalid refresh options, defaulting to LIVE mode.
Parameters :
Returns :
Partial<GlobalContextSettings>
Inline settings for the specified mode and refresh option |
| resolveConfigControlSettings | ||||||||||||||||
resolveConfigControlSettings(controls: WidgetControls, mode: GlobalContextDisplayMode, refreshOption: RefreshOption)
|
||||||||||||||||
|
Resolves widget settings for configuration controls based on the specified mode and refresh option. Configuration controls are simpler and don't require dashboard control calculations.
Parameters :
Returns :
WidgetSettingsResult
Resolved configuration settings with empty links and dashboard controls |
| resolveInlineControlSettings | ||||||||||||||||
resolveInlineControlSettings(controls: WidgetControls, mode: GlobalContextDisplayMode, refreshOption: RefreshOption)
|
||||||||||||||||
|
Resolves widget settings for inline controls based on the specified mode and refresh option. For dashboard mode, calculates the split between inline and dashboard controls.
Parameters :
Returns :
WidgetSettingsResult
Resolved settings with inline controls, links, and dashboard controls |
| toggleAllControlLinks | ||||||||||||||||
toggleAllControlLinks(state: boolean, currentSettings: Partial
|
||||||||||||||||
|
Sets all link states to the specified value and recalculates the resulting settings. This is used for bulk operations like "link all" or "unlink all" controls.
Parameters :
Returns :
WidgetSettingsResult
Updated settings with all links set to the specified state |
| toggleControlLink | ||||||||||||||||
toggleControlLink(linkKey: string, currentSettings: Partial
|
||||||||||||||||
|
Toggles a single link state and recalculates the resulting settings and dashboard controls. When a link is toggled, it affects how controls are distributed between inline and dashboard.
Parameters :
Returns :
WidgetSettingsResult
Updated settings with toggled link and recalculated dashboard controls |