Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Unit on InputNumber #695

Open
laurentC35 opened this issue Sep 13, 2023 · 7 comments
Open

Dynamic Unit on InputNumber #695

laurentC35 opened this issue Sep 13, 2023 · 7 comments
Assignees

Comments

@laurentC35
Copy link
Contributor

laurentC35 commented Sep 13, 2023

ToDo

image

Eno : InseeFr/Eno#715
Lunatic: InseeFr/Lunatic#668

@romaintailhurat
Copy link
Collaborator

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.

@QRuhier
Copy link
Contributor

QRuhier commented Jul 17, 2024

⚠️ 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>

@laurentC35
Copy link
Contributor Author

Modélisation:

<r:MeasurementUnit>¤VAR_COLLECTED¤</r:MeasurementUnit>

ou

<r:MeasurementUnit>€</r:MeasurementUnit>

@QRuhier
Copy link
Contributor

QRuhier commented Sep 10, 2024

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

@BulotF
Copy link
Contributor

BulotF commented Sep 16, 2024

Pour gérer l'identification du caractère dynamique de l'unité : ajout de :
<xs:element name="IsDynamicUnit" type="xs:boolean" minOccurs="0"/>

Pour gérer le fait que Unit pour désormais soit contenir une Uri vers RMéS, soit un nom de variable entre $ :
<xs:element name="Unit" type="xs:token" minOccurs="0">
(avec mise à jour du commentaire)

@QRuhier
Copy link
Contributor

QRuhier commented Sep 18, 2024

need to update the saved variable in pogues-json when unit is dynamic (for ddi consideration) :
"Unit" : "MY_VAR" => "Unit" : "$MY_VAR$"

@JulienCarmona JulienCarmona added the State: Standby Waiting for another issue or other to be done label Nov 7, 2024
@JulienCarmona JulienCarmona removed the State: Standby Waiting for another issue or other to be done label Dec 3, 2024
@QRuhier
Copy link
Contributor

QRuhier commented Dec 6, 2024

finally we can directly use VTL field and save the content directly in Unit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants