-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add memberNames
attr identifier to enhance kind="enum"
#12
Comments
@ying-jeanne this might be more straightforward to work on than trying to dynamically inject the cuetsy attributes |
Lets not promote that one :) The "number" case is an artifact of defining an enum directly -- it translates to numbers, but I think is something we should avoid generally. (and need good ways to map from numbers to strings in migrations) |
Fair enough, removed the heterogeneous case :) It'll still be supported, necessarily, but no need to promote it. Is the concern about numeric enums specific to what we want to define as best practices in Grafana, or does it extend to TS more widely? |
@sdboyer Make sense, I could take over this request, I don't have right to assign myself to the issue somehow :). |
@ying-jeanne assigned! will add you to repo, too |
By default,
kind="enum"
uses a CamelCasing-ish strategy on values to decide on member names to correspond to those values. This is a nice default, but it doesn't help when the values of the disjunct are numerics instead of strings, or if the user just plain wants some other pattern.For that, we need cuetsy to support another attribute identifier. What i did here should work fine - a
memberNames
attr identifier, which expects a|
-delimited list of strings, equal in count to the number of elements in the disjunction.memberNames
will be required if the disjunction contains any numeric values.The text was updated successfully, but these errors were encountered: