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

fix(ktable): remove next page clicked logic [KHCP-13030] #2352

Closed
wants to merge 12 commits into from

Conversation

portikM
Copy link
Member

@portikM portikM commented Aug 21, 2024

Summary

Addresses: https://konghq.atlassian.net/browse/KHCP-13030

Fixes bug when KTable sets page to 1 unexpectedly

@portikM portikM self-assigned this Aug 21, 2024
@portikM portikM requested a review from a team as a code owner August 21, 2024 14:37
Copy link

netlify bot commented Aug 21, 2024

Deploy Preview for kongponents-sandbox ready!

Name Link
🔨 Latest commit 3e36dea
🔍 Latest deploy log https://app.netlify.com/sites/kongponents-sandbox/deploys/66c7a419f09d1700087cdeef
😎 Deploy Preview https://deploy-preview-2352--kongponents-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 21, 2024

Deploy Preview for kongponents ready!

Name Link
🔨 Latest commit 3e36dea
🔍 Latest deploy log https://app.netlify.com/sites/kongponents/deploys/66c7a419943d85000839e482
😎 Deploy Preview https://deploy-preview-2352--kongponents.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@portikM portikM marked this pull request as draft August 22, 2024 20:36
@portikM portikM changed the title fix(ktable): send to page 1 when refreshed [KHCP-13030] fix(ktable): remove next page clicked logic [KHCP-13030] Aug 22, 2024
@portikM portikM marked this pull request as ready for review August 22, 2024 21:06
// this will ensure buttons display the correct state for cases like search
if (!nextPageClicked.value) {
page.value = 1
}
} else {
offset.value = res.pagination.offset
Copy link
Contributor

Choose a reason for hiding this comment

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

I don’t quite understand why we updated the offset here and then fixed it in the fetcher. Wouldn’t it make more sense to save res.pagination.offset into a variable like nextPageOffset and update the offset only when moving to the next page?

Copy link
Contributor

@2eha0 2eha0 Aug 23, 2024

Choose a reason for hiding this comment

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

I don't have permission to push a branch, I modified it locally and verified that it seems to work
image

@portikM portikM closed this Aug 27, 2024
@portikM portikM deleted the fix/khcp-13030-ktable-refetch branch August 27, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants