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 editing a Handlebars chart, if you modify the dataset and save, the Handlebars template will revert to its default state. If you are unaware of this behavior and save the chart, your custom template will be lost.
Open a Handlebars chart.
Edit the dataset and save the changes.
Observe that the Handlebars template field has been reset to the default, and your custom code has been replaced.
Screenshots/recordings
output.mp4
Superset version
master / latest-dev
Python version
I don't know
Node version
I don't know
Browser
Firefox
Additional context
This is not a new bug. I noticed it first in 4.0.0
Checklist
I have searched Superset docs and Slack and didn't find a solution to my problem.
I have searched the GitHub issue tracker and didn't find a similar bug report.
I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
The text was updated successfully, but these errors were encountered:
Hey @dkrat7, I'm here to help you with any bugs, questions, or contributions you have for Superset. Let's tackle this issue together!
The issue you're experiencing, where the Handlebars template reverts to its default state upon changing the dataset, is likely related to how the HandlebarsViewer component handles state changes. The useMemo hook in this component triggers a recompile of the template whenever the templateSource or data changes, which could lead to the template resetting if not managed properly [1].
To address this, you might need to ensure that the custom template state is preserved across dataset changes. This could involve modifying the logic that handles state updates to prevent overwriting the custom template with the default one. You may want to look into how the state is managed and updated when a dataset change occurs, possibly by implementing a mechanism to save and restore the custom template state.
Bug description
When editing a Handlebars chart, if you modify the dataset and save, the Handlebars template will revert to its default state. If you are unaware of this behavior and save the chart, your custom template will be lost.
Screenshots/recordings
output.mp4
Superset version
master / latest-dev
Python version
I don't know
Node version
I don't know
Browser
Firefox
Additional context
This is not a new bug. I noticed it first in 4.0.0
Checklist
The text was updated successfully, but these errors were encountered: