Pogues
Pogues copied to clipboard
Dynamic Unit on InputNumber
ToDo
Eno : https://github.com/InseeFr/Eno/issues/715 Lunatic: https://github.com/InseeFr/Lunatic/issues/668
As mentioned in previous issues, i would prefer to have in this case an exclusive path, like a switch button for choosing between static and dynamic measure units?
But most importantly, if we allow for dynamic, what is the use for a static unit list? Most designers would just use the dynamic option and write whatever they like as units. 🤔
So probably having dynamic measure units means deleting static ones, maybe at the expense of harmonization.
⚠️ impacts on Pogues-model & ddi
Currently in jsonPogues, unit is actually an url, used in transformation to ddi for getting the value of the unit.
{
"id": "lypl2fz1",
"Name": "QUESTIONNO",
"type": "CollectedVariableType",
"Label": "QUESTIONNO label",
"Datatype": {
"Unit": "url_of_unit",
"type": "NumericDatatypeType",
"Maximum": "10",
"Minimum": "1",
"Decimals": "",
"typeName": "NUMERIC"
}
}
If we want to make the difference between VTL expression or url (that leads to a different transformation), we need to change Pogues-Model
Then, in ddi, we do have
<l:VariableRepresentation>
<r:NumericRepresentation>
<r:MeasurementUnit>€</r:MeasurementUnit>
<r:NumberRange>
<r:Low isInclusive="true">1</r:Low>
<r:High isInclusive="true">10</r:High>
</r:NumberRange>
<r:NumericTypeCode controlledVocabularyID="INSEE-CIS-NTC-CV">Decimal</r:NumericTypeCode>
</r:NumericRepresentation>
</l:VariableRepresentation>
We cannot directly give the expression in <r:MeasurementUnit>
Modélisation:
<r:MeasurementUnit>¤VAR_COLLECTED¤</r:MeasurementUnit>
ou
<r:MeasurementUnit>€</r:MeasurementUnit>
Because of DDI modelisation, for dynamic unit we must save as value the id of a variable. Instead of displaying a 'VTL field' , we propose to display a dropdown containing all the variables (collected, external, calculated), then the user must chose a reference variable that may contain a VTL expression