-
Notifications
You must be signed in to change notification settings - Fork 174
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
[dataquery/dictionary] Add option to display enums as either value or field in dataquery module #9224
Conversation
This adds an option in the data query tool to display Enum data types as either a field value or the human readable field label.
edf9e3f
to
35d8633
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch (props.enumDisplay) { | ||
case EnumDisplayTypes.EnumLabel: | ||
if (props.dictionary.labels && props.dictionary.options) { | ||
for (let i = 0; i < props.dictionary.options.length; i++) { | ||
if (props.dictionary.options[i] == props.value) { | ||
display= props.dictionary.labels[i]; | ||
break; | ||
} | ||
} | ||
} | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect other cases in the future for enum?
Just wondering why the switch-case with only one option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I started with both values then realized the EnumValue option didn't actually need any code.. but I think it's also possible people will ask for other cases at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#9221 fixed too.
The dataquery module was showing the backend enum value, rather than the frontend label, which isn't very useful to most users.
This adds an option for the user to select how they want to display enums.
It also updates the menu label from "alpha" to "beta" since the module has now been tested with large data sets.