villebro commented on pull request #12960:
URL: https://github.com/apache/superset/pull/12960#issuecomment-775038150


   > @etr2460 I noticed a similar weirdness when I was fixing a regression in 
the table chart. For some reason the chart looked different in the dashboard 
compared to the Explore view. When looking at the metadata I noticed that the 
chart was missing a control value that had been added to the control panel 
after the chart had been created. Upon closer inspection it turned out Explore 
merges the chart metadata on top of the default control values, but dashboard 
doesn't. I didn't yet have time to look into this more closely, but I believe 
making sure the metadata flow is the same in Dashboard and Explore view might 
solve this problem, potentially making the migration unnecessary.
   
   I looked into this, and it turns out default values are in fact applied on 
the Chart form data on the Dashboard similarly as on the Explore view. The 
control panel on the Table chart was just setting the value of the `queryModel` 
control (which had the default value `null`) while rendering the control panel 
based on other form data.
   
   Going forward we should potentially make default values "smarter", by making 
it possible to introduce hooks that return defaults based on other context. In 
the case of `queryMode` in table model, it would be inferred from the other 
`formData`, and in the case of granularity, it could default to `main_dttm_col` 
in the dataset if missing/unset.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to