-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: SIP-34 table list view for databases #10705
Conversation
8e8d6c6
to
384706e
Compare
related to #8976 |
f9a4309
to
dd701f9
Compare
@@ -96,6 +270,18 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) { | |||
/* TODO: add database logic here */ | |||
}} | |||
/> | |||
|
|||
<ListView<DatabaseObject> |
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.
question: just wondering what does <DatabaseObject>
do here
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.
It allows specifying the generic for the ListView props. This means that props like renderCard
are not (data: any) => ReactNode
and are instead (data: DatabaseObject) => ReactNode
.
You can read more about it here: https://mariusschulz.com/articles/passing-generics-to-jsx-elements-in-typescript
superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx
Outdated
Show resolved
Hide resolved
last_name: string; | ||
}; | ||
|
||
export type DatabaseObject = { |
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.
Not sure how we want to handle the DatabaseObject
between the list and the modal; especially since the modal has some extra fields, do we want to include those as optional props or just create a second type to use in the modal?
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.
Do we expect them to be significantly different? If so we can create separate types, or create a base type and extend it for each of the instances. Ideally they wouldn't be too different.
7a80c53
to
dcc389f
Compare
dcc389f
to
035a282
Compare
94fde9a
to
8e1788f
Compare
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 with one nit
original: { allow_dml: allowDML }, | ||
}, | ||
}: any) => | ||
allowDML ? <IconBlack name="check" /> : <IconBlack name="cancel-x" />, |
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.
Nit: this ternary is repeated a number of times with the same display element. Is there an easy way to DRY it up?
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.
Good suggestion. Fixed!
8e1788f
to
f99e7f2
Compare
…boards_permissions * upstream/master: (32 commits) docs: Add a note to contributing.md on reporting security vulnerabilities (apache#10796) Fix: Include RLS filters for cache keys (apache#10805) feat: filters for database list view (apache#10772) fix: MVC show saved query (apache#10781) added creator column and adjusted order columns (apache#10789) security: disallow uuid package on jinja2 (apache#10794) feat: CRUD REST API for saved queries (apache#10777) fix: disable domain sharding on explore view (apache#10787) fix: can not type `0.05` in `TextControl` (apache#10778) fix: pivot table timestamp grouping (apache#10774) fix: add validator information to email/slack alerts (apache#10762) More Label touchups (margins) (apache#10722) fix: dashboard extra filters (apache#10692) fix: re-installing local superset in cache image (apache#10766) feat: SIP-34 table list view for databases (apache#10705) refactor: convert DatasetList schema filter to use new distinct api (apache#10746) chore: removing fsevents dependency (apache#10751) Fix precommit hook for docs/installation.rst (apache#10759) feat(database): POST, PUT, DELETE API endpoints (apache#10741) docs: Update OAuth configuration in installation.rst (apache#10748) ...
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
TEST PLAN
-CI (enzyme tests), 👀
ADDITIONAL INFORMATION
ENABLE_REACT_CRUD_VIEWS
config flag andSIP_34_DATABASE_UI
feature flag)