-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: Update typing for Table
component
#22832
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22832 +/- ##
=======================================
Coverage 67.42% 67.42%
=======================================
Files 1877 1877
Lines 72110 72110
Branches 7863 7863
=======================================
Hits 48621 48621
Misses 21470 21470
Partials 2019 2019
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Table
componentTable
component
@@ -302,7 +298,7 @@ export default function DrillDetailPane({ | |||
recordCount={resultsPage?.total} | |||
usePagination | |||
loading={isLoading} | |||
onChange={(pagination: 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.
wouldn't we want to leave the annotations to make it more clear on what data is being passed from the function?
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 took it out because TS can infer this type, so you'll still see TablePaginationConfig
as the type if you inspect in your IDE and you'll still get the same lint errors as if it were explicitly annotated, and I usually wouldn't include an annotation in those cases to keep the code cleaner. But, no strong feelings – do you think explicit annotation is helpful here?
c4b641a
to
06b622a
Compare
ab45c95
to
fcd364d
Compare
fcd364d
to
165f132
Compare
/testenv up |
@codyml Ephemeral environment creation is currently limited to committers. |
/testenv up |
@codyml Ephemeral environment spinning up at http://52.32.70.238:8080. Credentials are |
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
This PR resolves some typing and props issues in the Table component:
any
Table
component type and its correspondingTableProps
interface generic, requiring theRecordType
type variable. This makesTable
more compatible with the AntD components/types it extends.TableProps
from inheriting from its AntD counterpart. OurTable
component only knows how to handle a subset of the properties in the AntDTableProps
, but it currently accepts every prop defined in AntDTableProps
.onRow
prop, which is described in Storybook but isn't currently working.antd/lib/table
,antd/lib/config-provider
, andantd/lib/pagination
selectionType
propTESTING INSTRUCTIONS
ADDITIONAL INFORMATION