-
Notifications
You must be signed in to change notification settings - Fork 12
Add Dash table #27
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 Dash table #27
Conversation
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 overall, but this really highlights that tests are desperately needed, especially for serialization. I would suggest we use the same strategy for serialization everywhere (JsonProperty vs anonymous records) though. Also, is the DashApp still correctly serialized with this setting?
@@ -120,6 +126,13 @@ module ComponentPropTypes = | |||
Title:string | |||
} | |||
static member create label value disabled title = {Label=label; Value=value; Disabled=disabled; Title=title} | |||
static member convert this = |
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.
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.
Good point - that would be clearer.
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.
Just to make sure we're on the same page: The problem with the camel-case field names is with "external" data, i.e. when it is being used to pass data in, e.g.
DataTable.dataTable "memory-table" [
DataTable.Attr.data [
{| Country = "Canada" |}
{| Country = "USA" |}
]
]
Country
would be camel-cased and would fail to bind correctly to the header record "Country".
Yes - As far as I can tell. Tested using Giraffe and Suave |
I'll add it to |
If issue !29 gets the go-ahead, updating to JsonProperty can be done as part of that? |
* Also get property name from Prop
Updated with JSON attributes |
Add converted
dash_table
component.Note: Changed JSON serializer's configuration to use default naming standard.
Using camel-case naming forces DataTable (and probably everything else) to only work with data with camel-case field names. I.e.
{| State = "online" |}
does not work.