-
Notifications
You must be signed in to change notification settings - Fork 14.9k
refactor(Table): Use Table instead of html <table> in CollectionTable #33159
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
refactor(Table): Use Table instead of html <table> in CollectionTable #33159
Conversation
Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment
|
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Inefficient Expanded Rows Calculation ▹ view | 🧠 Not in standard |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/components/Datasource/types.ts | ✅ |
superset-frontend/src/components/Table/index.tsx | ✅ |
superset-frontend/cypress-base/cypress/support/directories.ts | ✅ |
superset-frontend/src/components/Datasource/CollectionTable.tsx | ✅ |
superset-frontend/src/components/Datasource/DatasourceEditor.jsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
const expandedRowKeys = Object.keys(this.state.expandedColumns).filter( | ||
id => this.state.expandedColumns[id], | ||
); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@EnxDev Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments |
@EnxDev Ephemeral environment spinning up at http://35.89.175.154:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup. |
@@ -113,6 +56,32 @@ const StyledButtonWrapper = styled.span` | |||
`} | |||
`; | |||
|
|||
type CollectionItem = { id: string | number; [key: string]: any }; |
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.
Would it be possible to define a more specific type here if we had better knowledge of the properties, to avoid any
type?
I noticed there are quite a few other any
types in the code — can we try to avoid them as well?
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 need generics for this type but the only component that uses this is jsx so generics don't do anything. But we should definitely consider replacing these with proper types when DatasourceEditor is typescript
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.
Yeah I think that's fine. The original intent when I built this a long time ago was for it to become the basis for all CRUD in the app, but ended up going a different way. If anything in the future, we'd remove this base component and go more towards what other CRUDs are using, if that makes sense. For now we'll flag as "needs refactor" and can do minimal edits to get theming through.
)} | ||
</> | ||
), | ||
render: (text: any, record: CollectionItem) => |
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.
here as well
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.
Same thing here, this could be anything and best way to handle this is through generics which we can't do.
ColumnsType, | ||
SortOrder, | ||
SorterResult, | ||
TablePaginationConfig, |
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 need to be imported as type for proper tree shaking
@EnxDev Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments |
@EnxDev Ephemeral environment spinning up at http://44.247.53.125:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup. |
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
I believe this bug was introduced, could we fix it in a separate PR? Recording.2025-04-25.195442.mp4 |
SUMMARY
Refactor DatasourceEditor and CollectionTable components to use our Table component instead of html table.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:


After:


TESTING INSTRUCTIONS
ADDITIONAL INFORMATION