Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

fix: lazily create metadata #74

Merged
merged 1 commit into from
Apr 26, 2019
Merged

fix: lazily create metadata #74

merged 1 commit into from
Apr 26, 2019

Conversation

kristw
Copy link
Collaborator

@kristw kristw commented Apr 26, 2019

🏆 Enhancements

  • Delay creation of chart metadata which calls the translation function.

@kristw kristw requested a review from a team as a code owner April 26, 2019 05:54
@netlify
Copy link

netlify bot commented Apr 26, 2019

Deploy preview for superset-ui-plugins ready!

Built with commit d31f603

https://deploy-preview-74--superset-ui-plugins.netlify.com

Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an issue because the translation has to happen dynamically?

@kristw
Copy link
Collaborator Author

kristw commented Apr 26, 2019

There is an issue in the dataportal tests that crashes when t() is called before it is configured. That is super weird because it will only issue warning if not configured so I am not sure why it crashes.

However, by creating constant metadata and return. t() is called as soon as this file is imported. A little bit harder to organize import order to ensure configure() is called before t(). By delaying its creation until the plugin instance is instantiated. By that time the translation module should have been configured.

@kristw kristw merged commit 2fef425 into master Apr 26, 2019
@delete-merged-branch delete-merged-branch bot deleted the kristw--metadata branch April 26, 2019 20:25
nytai pushed a commit to preset-io/superset-ui-plugins that referenced this pull request Apr 27, 2020
* Convert translation to typescript

* update input types

* update travis

* update node version
nytai pushed a commit to preset-io/superset-ui-plugins that referenced this pull request Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants