Skip to content
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(InfiniteQueryTable): add infinite query table for paginated react query hooks #973

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

cogwirrel
Copy link
Member

Users of PDK's Type Safe API can make use of react query hooks generated from their API model. "Infinite query" hooks are generated for paginated operations.

This change adds a table component which accepts the result of such a hook, and manages pagination by interacting with the hook, simplifying the effort required to build paginated tables when using Type Safe API and Northstar in tandem.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@jessieweiyi jessieweiyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments.
Thanks for your contribution and good work.

@@ -96,6 +98,9 @@
"@types/uuid": "^9.0.0",
"amazon-cognito-identity-js": "^6.2.0",
"cross-fetch": "^3.1.6",
"lodash.chunk": "^4.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All lodash.* should be added to the dependencies (given that we might use it other occasions). Otherwise, consumers will not install them


/**
* Extends the Cloudscape Table component with pagination options for @tanstack/react-query infinite query hooks.
* Compatible with generated hooks for paginated operations from AWS PDK Type Safe API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to provide an URL from PDK doc, something like,

<a href='http://example.com' target="_blank" rel="noreferrer noopener">

…t query hooks

Users of PDK's Type Safe API can make use of react query hooks generated from their
API model. "Infinite query" hooks are generated for paginated operations.

This change adds a table component which accepts the result of such a hook, and
manages pagination by interacting with the hook, simplifying the effort required
to build paginated tables when using Type Safe API and Northstar in tandem.
@cogwirrel cogwirrel merged commit ba0f449 into main Sep 21, 2023
3 checks passed
@cogwirrel cogwirrel deleted the feat/infinite-query-table branch September 21, 2023 02:04
@aws-prototyping-bot
Copy link
Collaborator

🎉 This PR is included in version @aws-northstar/ui-v1.1.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants