[dashboard] New, list view (react)#8845
Conversation
131466e to
319e011
Compare
|
This is awesome, I hope this be ported to Flask-AppBuilder lists |
6f00ff4 to
ebeebe3
Compare
There was a problem hiding this comment.
so type errors don't cause jest tests to fail (they're still reported though)
There was a problem hiding this comment.
the newest version of react-table doesn't have types in https://github.com/DefinitelyTyped/DefinitelyTyped
found these online and adjusted to for the features we're using.
There was a problem hiding this comment.
We don't have these rules enabled in eslint and I found them to be very tedious. Opened #8865 for larger discussion
There was a problem hiding this comment.
found I had to run superset init after adding this decorator. Not sure if there's a way around it. This is necessary to override FAB's default list view.
There was a problem hiding this comment.
One possible way could be to override with:
Class Dashboard(BaseSupersetView):
class_permission_name = "DashboardModelView"
method_permission_name = {
"new": "add",
"list_all": "list",
}Note: This would deprecate the Dashboard.new permission
Codecov Report
@@ Coverage Diff @@
## master #8845 +/- ##
==========================================
+ Coverage 58.69% 59.16% +0.47%
==========================================
Files 363 367 +4
Lines 11417 11679 +262
Branches 2801 2861 +60
==========================================
+ Hits 6701 6910 +209
- Misses 4538 4590 +52
- Partials 178 179 +1
Continue to review full report at Codecov.
|
|
@etr2460 @graceguo-supercat @michellethomas Would be great to get some 👀 on this from folks who spend more of their time in the frontend. |
dpgaspar
left a comment
There was a problem hiding this comment.
Tested it locally and looks good, but noticed the following:
- when switching languages the user is redirected to the old dashboard list (previous MVC page)
- column labels are not translated
- Button labels are not translated
- Edit form back button does not work work properly (previous MVC), I would say that it's only usable when using modal forms form add and edit
|
@dpgaspar I've updated with the changes your requested as best I could.
looks like the user is redirected to the edit page of a specific dashboard, not sure how that's happening but doubt it's due to any change I made. Seems like that url is exposed in FAB and I don't really understand how that works right now.
I've updated the code to use the
I've updated the code to use the
This is true. looks like that links to |
There was a problem hiding this comment.
I'm unclear about the pros/cons of using interface over propTypes, assuming this is more typescript-friendly (?). Tradeoff seems to be consistency vs being more ts friendly (?)
There was a problem hiding this comment.
We could use both. PropTypes are checked at runtime by react in development and log to the console. Interface/types are checked by the typescript compiler/vscode and produce errors at build time and are highlighted in the editor. I'd say typescript is favorable once the entire repo converts to typescript as the types will be available in the editor (on hover, cmd click, etc). For now I'm happy to also add PropTypes until we transition more to typescript.
FWIW: The react dev team recommends flow/typescript over PropTypes for larger projects: https://reactjs.org/docs/static-type-checking.html
There was a problem hiding this comment.
Is this the same as setting state in the constructor?
There was a problem hiding this comment.
Yes, they are essentially the same thing. The class properties is just sugar for setting variables in constructor. I personally prefer this over using the constructor as the constructor requires a call to super() which can sometimes be overlooked.
There was a problem hiding this comment.
I've added the babel plugin for transform-class-properties. The proposal for these is currently in stage 3, I believe, which is the step right before formal adoption into the standard. The proposal states that implementation is already under way in the latest chrome and in node 12.
proposal:
https://github.com/tc39/proposal-class-fields#class-field-declarations-for-javascript
Happy to switch back too. FWIW, every react project I've worked on has had this syntax enabled by babel.
* adds dashboard listview component * use new api * use json over rison * lint * adds seperate dashboard list view * edit and delete actions * fix lint ignore * fix common_bootstrap_payload is now a function * fix license * fix pylint * isort * fix tests * lint * lint ts * fix js tests * fix double import from bad rebase * fix indent error * lookup permissions * generic permission lookup * get tslint to pass * adds js specs * lint * fix rebase * lint * lint again * fix type errors preventing build * adds more specs * fix tslint error * fix null check * remove unecessary code * use translations provided by api * more translations * linting * fix spec * i18n * fix register order

CATEGORY
Choose one
SUMMARY
Replaces the current dashboard list view generated by FAB with one that is client rendered in react using the FAB/dashboard api. Design has tried to stay as close to the current design as possible, with some minor improvements. There have been recent efforts to redesign most of the views in superset, so having pages that are rendered in react will greatly facilitate those changes. The work in this PR is intended to lay the foundation for all list views that are to come.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
old view
new view
TEST PLAN
ADDITIONAL INFORMATION
REVIEWERS