-
Notifications
You must be signed in to change notification settings - Fork 272
chore: add shared plugin controls utilities #389
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/superset/superset-ui/5nom0vq4d |
@@ -0,0 +1,299 @@ | |||
/** |
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.
I think this could be a part of @superset-ui/legacy-preset-chart-nvd3 since it's written for (and only used by) that one plugin.
Same applies to the DeckGL equivalent - those shared controls could live with that plugin.
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.
Oh thanks for the pointer, if it's only used there then that's way better.
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.
Agree with @rusackas
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.
Maybe create a new pakage superset-ui/controls
? It may also make sense to leave the NVD3 controls in incubator-superset
for now. The way I see it, they are more like visualization-specific metadata that should go with the plugins.
// input choices & options | ||
export const D3_FORMAT_OPTIONS = [ | ||
['SMART_NUMBER', 'Adaptative formating'], | ||
[' ', 'Original value'], |
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.
This has been updated to "~g"
. See: apache/superset#9608
Codecov Report
@@ Coverage Diff @@
## master #389 +/- ##
==========================================
+ Coverage 26.31% 26.53% +0.21%
==========================================
Files 192 196 +4
Lines 5293 5307 +14
Branches 475 475
==========================================
+ Hits 1393 1408 +15
Misses 3864 3864
+ Partials 36 35 -1
Continue to review full report at Codecov.
|
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, but we may want to get this one in first: apache/superset#9578
Agree with @ktmud. |
@@ -27,6 +27,8 @@ | |||
"access": "public" | |||
}, | |||
"dependencies": { | |||
"@superset-ui/translation": "^0.12.21", |
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.
These should be peerDependencies
. (translation
needs to be a singleton. validator
not necessariliy, but I have been making all @superset-ui/xxx
peerDependencies
by convention to avoid having multiple copies of some singleton by mistake)
@kristw @ktmud I'm inclined to say this is OK as-is, and push it through for now. We should sync up about the plan for remaining controls and their dependencies. If they need to be in a new package (I'm not sure, but I'm open to it), we can address that in a separate PR. I would just want to call it something like |
@rusackas , can you clarify on this statement? I was creating a new control type today (a radio button, to be specific) and thought it'd be beneficial to create it as a shared control. A |
💔 Breaking Changes
🏆 Enhancements
This moves several files from incubator-superset into
@superset-ui/chart
. These will allow moving the plugin controls config out of Superset'ssetupPlugins.ts
and into the individual plugins for all the plugins. This covers the dependencies for all plugin controls except the DeckGL plugins. Those will come later.The new modules are not exported directly by
@superset-ui/chart
, and must be imported by their directory paths under@superset-ui/chart/controls/[...]
. This is to keep things organized and to avoid bloating the package size.📜 Documentation
Added a paragraph to the readme. It's not enough documentation really, but things are very much in flux and I'd prefer to write more comprehensive docs once the plugin situation is more locked down.
🐛 Bug Fix
🏠 Internal