You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating UI for foreign key references, the UI's use the "id" field for the human select of the setup. This is rarely meaningful. JDL should have a way to indicate which field should be used in this circumstance.
current generated code (react style):
<option value="" key="0" />
{billingUnits
? billingUnits.map(otherEntity => (
<option value={otherEntity.id} key={otherEntity.id}>
{otherEntity.id}
</option>
))
: null}
better code (now switch from "id" to "name" :
<option value="" key="0" />
{billingUnits
? billingUnits.map(otherEntity => (
<option value={otherEntity.id} key={otherEntity.id}>
{otherEntity.name}
</option>
))
: null}
The idea is that in the JDL the field "name" would be marked somehow as the "human readable" version of the field. Let's be honest, the "id" almost never is useful to a human.
Motivation for or Use Case
Adding this feature is not perfect. certainly some people might want to use a combination of fields or a function to create the label. But it would make the auto-generated UI more useful to humans.
Related issues or PR
[x ] Checking this box is mandatory (this is just to show you read everything)
The text was updated successfully, but these errors were encountered:
AHA! Seemed so obviously needed that I was surprised I could not find it. I may try to submit a documentation PR to make things more clear, first I need to really understand it myself! will close
Overview of the feature request
When generating UI for foreign key references, the UI's use the "id" field for the human select of the setup. This is rarely meaningful. JDL should have a way to indicate which field should be used in this circumstance. current generated code (react style): <option value="" key="0" /> {billingUnits ? billingUnits.map(otherEntity => ( <option value={otherEntity.id} key={otherEntity.id}> {otherEntity.id} </option> )) : null} better code (now switch from "id" to "name" : <option value="" key="0" /> {billingUnits ? billingUnits.map(otherEntity => ( <option value={otherEntity.id} key={otherEntity.id}> {otherEntity.name} </option> )) : null} The idea is that in the JDL the field "name" would be marked somehow as the "human readable" version of the field. Let's be honest, the "id" almost never is useful to a human. Motivation for or Use Case Adding this feature is not perfect. certainly some people might want to use a combination of fields or a function to create the label. But it would make the auto-generated UI more useful to humans. Related issues or PR [x ] Checking this box is mandatory (this is just to show you read everything)
The text was updated successfully, but these errors were encountered: