|View Issue Details|
|Type||Category||Severity||Reproducibility||Date Submitted||Last Update|
|feature request||[POS2] Core||major||always||2021-04-22 13:06||2022-02-01 08:07|
|Assigned To||Triage Platform Base|
|Priority||normal||Resolution||open||Fixed in Version|
|Status||acknowledged||Fix in branch||Fixed in SCM revision|
|OS Version||Database version||Ant version|
|Product Version||SCM revision|
|Review Assigned To|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
0046322: Ability to extend ConfigurationSet's selectorFunction
|Description||A configuration set is defined with a selector function, which returns the name of the configuration currently selected. Example:|
const configSet = ConfigurationSet.newInstance('OBPOS2_ButtonBar1')
In this case the selectLayoutConfig is a function that returns the config based on the layout.
This approach makes it difficult to extend the configuration set from external modules, as it highly depends on the selector function implementation details. I mean, if the selector function is developed in a way that can't be extended from external modules, then you are totally blocked, and the benefits of using a Configuration Set would be lost.
I see here two possible solutions to be able to extend it from external modules:
1. To be able to include several selector functions (one in the module that defines the Configuration Set, and other functions in external modules). The functions will be executed like a chain, and the next function will receive the output of the previous one (if any).
This way we could easily reuse code. For example, in the example of the selectLayoutConfig, let's imagine that returns 'phone'. My external module function could read that 'phone' and decide what to do with it (reuse or replace).
2. Another possibility (that could complement previous option) will be to allow to change the configuration by any other *standard* mechanism, that would be totally independent of the selector function implementation, for example through a change in the state.
|Steps To Reproduce||I found this problem trying to change the configuration of the Product Popover configuration set (OBPOS2_ProductPopover).|
The selector function selectLayoutConfig originally linked to this configuration set didn't allow me to change the configuration in an external module (allergens), because that selector function was looking only at layout stuff, and I needed something to proactively change the config based on a user interaction (view allergens info button).
The solution in my case was to replace the setSelector function by another implementation, loosing any logic about layout selection.
The implementation was to add the configuration name in the UI model so this selection function could read it and return it immediately. I honestly think this is the way to go, maybe something like:
|Tags||No tags attached.|
|2021-04-22 13:06||vmromanos||New Issue|
|2021-04-22 13:06||vmromanos||Assigned To||=> Retail|
|2021-04-22 13:06||vmromanos||Triggers an Emergency Pack||=> No|
|2021-04-29 09:44||guilleaer||Assigned To||Retail => platform|
|2021-04-29 10:49||guilleaer||Status||new => acknowledged|
|2022-02-01 08:07||alostale||Assigned To||platform => Triage Platform Base|
|Copyright © 2000 - 2009 MantisBT Group|